feat: init Party Room

This commit is contained in:
xkeyC 2025-11-18 23:10:04 +08:00
parent f98235f2f3
commit aaaee30368
34 changed files with 10999 additions and 146 deletions

View File

@ -32,6 +32,13 @@ class URLConf {
static String get devReleaseUrl => "$gitApiHome/SCToolBox/Release/releases";
/// PartyRoom Server
static const String partyRoomServerAddress = "localhost";
static const int partyRoomServerPort = 50051;
/// RSI Avatar Base URL
static const String rsiAvatarBaseUrl = "https://robertsspaceindustries.com";
static Future<bool> checkHost() async {
// 使 DNS
final gitApiList = _genFinalList(await dnsLookupTxt("git.dns.scbox.org"));

View File

@ -0,0 +1,731 @@
// This is a generated file - do not edit.
//
// Generated from proto/auth/auth.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names
import 'dart:core' as $core;
import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:protobuf/protobuf.dart' as $pb;
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
///
class StatusRequest extends $pb.GeneratedMessage {
factory StatusRequest() => create();
StatusRequest._();
factory StatusRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory StatusRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'StatusRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
StatusRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
StatusRequest copyWith(void Function(StatusRequest) updates) =>
super.copyWith((message) => updates(message as StatusRequest))
as StatusRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static StatusRequest create() => StatusRequest._();
@$core.override
StatusRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static StatusRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<StatusRequest>(create);
static StatusRequest? _defaultInstance;
}
///
class StatusResponse extends $pb.GeneratedMessage {
factory StatusResponse({
$core.bool? online,
$core.String? message,
$fixnum.Int64? serverTime,
}) {
final result = create();
if (online != null) result.online = online;
if (message != null) result.message = message;
if (serverTime != null) result.serverTime = serverTime;
return result;
}
StatusResponse._();
factory StatusResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory StatusResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'StatusResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOB(1, _omitFieldNames ? '' : 'online')
..aOS(2, _omitFieldNames ? '' : 'message')
..aInt64(3, _omitFieldNames ? '' : 'serverTime')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
StatusResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
StatusResponse copyWith(void Function(StatusResponse) updates) =>
super.copyWith((message) => updates(message as StatusResponse))
as StatusResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static StatusResponse create() => StatusResponse._();
@$core.override
StatusResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static StatusResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<StatusResponse>(create);
static StatusResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.bool get online => $_getBF(0);
@$pb.TagNumber(1)
set online($core.bool value) => $_setBool(0, value);
@$pb.TagNumber(1)
$core.bool hasOnline() => $_has(0);
@$pb.TagNumber(1)
void clearOnline() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get message => $_getSZ(1);
@$pb.TagNumber(2)
set message($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasMessage() => $_has(1);
@$pb.TagNumber(2)
void clearMessage() => $_clearField(2);
@$pb.TagNumber(3)
$fixnum.Int64 get serverTime => $_getI64(2);
@$pb.TagNumber(3)
set serverTime($fixnum.Int64 value) => $_setInt64(2, value);
@$pb.TagNumber(3)
$core.bool hasServerTime() => $_has(2);
@$pb.TagNumber(3)
void clearServerTime() => $_clearField(3);
}
///
class LoginRequest extends $pb.GeneratedMessage {
factory LoginRequest() => create();
LoginRequest._();
factory LoginRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory LoginRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'LoginRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
LoginRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
LoginRequest copyWith(void Function(LoginRequest) updates) =>
super.copyWith((message) => updates(message as LoginRequest))
as LoginRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static LoginRequest create() => LoginRequest._();
@$core.override
LoginRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static LoginRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<LoginRequest>(create);
static LoginRequest? _defaultInstance;
}
///
class GameUserInfo extends $pb.GeneratedMessage {
factory GameUserInfo({
$core.String? gameUserId,
$core.String? handleName,
$core.String? avatarUrl,
$core.String? citizenRecord,
$fixnum.Int64? enlistedDate,
}) {
final result = create();
if (gameUserId != null) result.gameUserId = gameUserId;
if (handleName != null) result.handleName = handleName;
if (avatarUrl != null) result.avatarUrl = avatarUrl;
if (citizenRecord != null) result.citizenRecord = citizenRecord;
if (enlistedDate != null) result.enlistedDate = enlistedDate;
return result;
}
GameUserInfo._();
factory GameUserInfo.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GameUserInfo.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GameUserInfo',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'gameUserId')
..aOS(2, _omitFieldNames ? '' : 'handleName')
..aOS(3, _omitFieldNames ? '' : 'avatarUrl')
..aOS(4, _omitFieldNames ? '' : 'citizenRecord')
..aInt64(5, _omitFieldNames ? '' : 'enlistedDate')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GameUserInfo clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GameUserInfo copyWith(void Function(GameUserInfo) updates) =>
super.copyWith((message) => updates(message as GameUserInfo))
as GameUserInfo;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GameUserInfo create() => GameUserInfo._();
@$core.override
GameUserInfo createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GameUserInfo getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GameUserInfo>(create);
static GameUserInfo? _defaultInstance;
@$pb.TagNumber(1)
$core.String get gameUserId => $_getSZ(0);
@$pb.TagNumber(1)
set gameUserId($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasGameUserId() => $_has(0);
@$pb.TagNumber(1)
void clearGameUserId() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get handleName => $_getSZ(1);
@$pb.TagNumber(2)
set handleName($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasHandleName() => $_has(1);
@$pb.TagNumber(2)
void clearHandleName() => $_clearField(2);
@$pb.TagNumber(3)
$core.String get avatarUrl => $_getSZ(2);
@$pb.TagNumber(3)
set avatarUrl($core.String value) => $_setString(2, value);
@$pb.TagNumber(3)
$core.bool hasAvatarUrl() => $_has(2);
@$pb.TagNumber(3)
void clearAvatarUrl() => $_clearField(3);
@$pb.TagNumber(4)
$core.String get citizenRecord => $_getSZ(3);
@$pb.TagNumber(4)
set citizenRecord($core.String value) => $_setString(3, value);
@$pb.TagNumber(4)
$core.bool hasCitizenRecord() => $_has(3);
@$pb.TagNumber(4)
void clearCitizenRecord() => $_clearField(4);
@$pb.TagNumber(5)
$fixnum.Int64 get enlistedDate => $_getI64(4);
@$pb.TagNumber(5)
set enlistedDate($fixnum.Int64 value) => $_setInt64(4, value);
@$pb.TagNumber(5)
$core.bool hasEnlistedDate() => $_has(4);
@$pb.TagNumber(5)
void clearEnlistedDate() => $_clearField(5);
}
///
class LoginResponse extends $pb.GeneratedMessage {
factory LoginResponse({
$core.String? uuid,
GameUserInfo? userInfo,
$fixnum.Int64? lastLoginTime,
}) {
final result = create();
if (uuid != null) result.uuid = uuid;
if (userInfo != null) result.userInfo = userInfo;
if (lastLoginTime != null) result.lastLoginTime = lastLoginTime;
return result;
}
LoginResponse._();
factory LoginResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory LoginResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'LoginResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'uuid')
..aOM<GameUserInfo>(2, _omitFieldNames ? '' : 'userInfo',
subBuilder: GameUserInfo.create)
..aInt64(3, _omitFieldNames ? '' : 'lastLoginTime')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
LoginResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
LoginResponse copyWith(void Function(LoginResponse) updates) =>
super.copyWith((message) => updates(message as LoginResponse))
as LoginResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static LoginResponse create() => LoginResponse._();
@$core.override
LoginResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static LoginResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<LoginResponse>(create);
static LoginResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.String get uuid => $_getSZ(0);
@$pb.TagNumber(1)
set uuid($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasUuid() => $_has(0);
@$pb.TagNumber(1)
void clearUuid() => $_clearField(1);
@$pb.TagNumber(2)
GameUserInfo get userInfo => $_getN(1);
@$pb.TagNumber(2)
set userInfo(GameUserInfo value) => $_setField(2, value);
@$pb.TagNumber(2)
$core.bool hasUserInfo() => $_has(1);
@$pb.TagNumber(2)
void clearUserInfo() => $_clearField(2);
@$pb.TagNumber(2)
GameUserInfo ensureUserInfo() => $_ensure(1);
@$pb.TagNumber(3)
$fixnum.Int64 get lastLoginTime => $_getI64(2);
@$pb.TagNumber(3)
set lastLoginTime($fixnum.Int64 value) => $_setInt64(2, value);
@$pb.TagNumber(3)
$core.bool hasLastLoginTime() => $_has(2);
@$pb.TagNumber(3)
void clearLastLoginTime() => $_clearField(3);
}
///
class PreRegisterRequest extends $pb.GeneratedMessage {
factory PreRegisterRequest({
$core.String? uuid,
$core.String? gameUserId,
}) {
final result = create();
if (uuid != null) result.uuid = uuid;
if (gameUserId != null) result.gameUserId = gameUserId;
return result;
}
PreRegisterRequest._();
factory PreRegisterRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory PreRegisterRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'PreRegisterRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'uuid')
..aOS(2, _omitFieldNames ? '' : 'gameUserId')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PreRegisterRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PreRegisterRequest copyWith(void Function(PreRegisterRequest) updates) =>
super.copyWith((message) => updates(message as PreRegisterRequest))
as PreRegisterRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static PreRegisterRequest create() => PreRegisterRequest._();
@$core.override
PreRegisterRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static PreRegisterRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<PreRegisterRequest>(create);
static PreRegisterRequest? _defaultInstance;
@$pb.TagNumber(1)
$core.String get uuid => $_getSZ(0);
@$pb.TagNumber(1)
set uuid($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasUuid() => $_has(0);
@$pb.TagNumber(1)
void clearUuid() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get gameUserId => $_getSZ(1);
@$pb.TagNumber(2)
set gameUserId($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasGameUserId() => $_has(1);
@$pb.TagNumber(2)
void clearGameUserId() => $_clearField(2);
}
///
class PreRegisterResponse extends $pb.GeneratedMessage {
factory PreRegisterResponse({
$core.String? verificationCode,
$fixnum.Int64? expireTime,
}) {
final result = create();
if (verificationCode != null) result.verificationCode = verificationCode;
if (expireTime != null) result.expireTime = expireTime;
return result;
}
PreRegisterResponse._();
factory PreRegisterResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory PreRegisterResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'PreRegisterResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'verificationCode')
..aInt64(2, _omitFieldNames ? '' : 'expireTime')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PreRegisterResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PreRegisterResponse copyWith(void Function(PreRegisterResponse) updates) =>
super.copyWith((message) => updates(message as PreRegisterResponse))
as PreRegisterResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static PreRegisterResponse create() => PreRegisterResponse._();
@$core.override
PreRegisterResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static PreRegisterResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<PreRegisterResponse>(create);
static PreRegisterResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.String get verificationCode => $_getSZ(0);
@$pb.TagNumber(1)
set verificationCode($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasVerificationCode() => $_has(0);
@$pb.TagNumber(1)
void clearVerificationCode() => $_clearField(1);
@$pb.TagNumber(2)
$fixnum.Int64 get expireTime => $_getI64(1);
@$pb.TagNumber(2)
set expireTime($fixnum.Int64 value) => $_setInt64(1, value);
@$pb.TagNumber(2)
$core.bool hasExpireTime() => $_has(1);
@$pb.TagNumber(2)
void clearExpireTime() => $_clearField(2);
}
///
class RegisterRequest extends $pb.GeneratedMessage {
factory RegisterRequest({
$core.String? uuid,
$core.String? gameUserId,
}) {
final result = create();
if (uuid != null) result.uuid = uuid;
if (gameUserId != null) result.gameUserId = gameUserId;
return result;
}
RegisterRequest._();
factory RegisterRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory RegisterRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'RegisterRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'uuid')
..aOS(2, _omitFieldNames ? '' : 'gameUserId')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
RegisterRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
RegisterRequest copyWith(void Function(RegisterRequest) updates) =>
super.copyWith((message) => updates(message as RegisterRequest))
as RegisterRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static RegisterRequest create() => RegisterRequest._();
@$core.override
RegisterRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static RegisterRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<RegisterRequest>(create);
static RegisterRequest? _defaultInstance;
@$pb.TagNumber(1)
$core.String get uuid => $_getSZ(0);
@$pb.TagNumber(1)
set uuid($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasUuid() => $_has(0);
@$pb.TagNumber(1)
void clearUuid() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get gameUserId => $_getSZ(1);
@$pb.TagNumber(2)
set gameUserId($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasGameUserId() => $_has(1);
@$pb.TagNumber(2)
void clearGameUserId() => $_clearField(2);
}
///
class RegisterResponse extends $pb.GeneratedMessage {
factory RegisterResponse({
$core.String? partyRoomSecretKey,
GameUserInfo? userInfo,
}) {
final result = create();
if (partyRoomSecretKey != null)
result.partyRoomSecretKey = partyRoomSecretKey;
if (userInfo != null) result.userInfo = userInfo;
return result;
}
RegisterResponse._();
factory RegisterResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory RegisterResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'RegisterResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'partyRoomSecretKey')
..aOM<GameUserInfo>(2, _omitFieldNames ? '' : 'userInfo',
subBuilder: GameUserInfo.create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
RegisterResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
RegisterResponse copyWith(void Function(RegisterResponse) updates) =>
super.copyWith((message) => updates(message as RegisterResponse))
as RegisterResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static RegisterResponse create() => RegisterResponse._();
@$core.override
RegisterResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static RegisterResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<RegisterResponse>(create);
static RegisterResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.String get partyRoomSecretKey => $_getSZ(0);
@$pb.TagNumber(1)
set partyRoomSecretKey($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasPartyRoomSecretKey() => $_has(0);
@$pb.TagNumber(1)
void clearPartyRoomSecretKey() => $_clearField(1);
@$pb.TagNumber(2)
GameUserInfo get userInfo => $_getN(1);
@$pb.TagNumber(2)
set userInfo(GameUserInfo value) => $_setField(2, value);
@$pb.TagNumber(2)
$core.bool hasUserInfo() => $_has(1);
@$pb.TagNumber(2)
void clearUserInfo() => $_clearField(2);
@$pb.TagNumber(2)
GameUserInfo ensureUserInfo() => $_ensure(1);
}
///
class UnregisterRequest extends $pb.GeneratedMessage {
factory UnregisterRequest() => create();
UnregisterRequest._();
factory UnregisterRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UnregisterRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'UnregisterRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UnregisterRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UnregisterRequest copyWith(void Function(UnregisterRequest) updates) =>
super.copyWith((message) => updates(message as UnregisterRequest))
as UnregisterRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UnregisterRequest create() => UnregisterRequest._();
@$core.override
UnregisterRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static UnregisterRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<UnregisterRequest>(create);
static UnregisterRequest? _defaultInstance;
}
///
class UnregisterResponse extends $pb.GeneratedMessage {
factory UnregisterResponse({
$core.bool? success,
}) {
final result = create();
if (success != null) result.success = success;
return result;
}
UnregisterResponse._();
factory UnregisterResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UnregisterResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'UnregisterResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'auth'),
createEmptyInstance: create)
..aOB(1, _omitFieldNames ? '' : 'success')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UnregisterResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UnregisterResponse copyWith(void Function(UnregisterResponse) updates) =>
super.copyWith((message) => updates(message as UnregisterResponse))
as UnregisterResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UnregisterResponse create() => UnregisterResponse._();
@$core.override
UnregisterResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static UnregisterResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<UnregisterResponse>(create);
static UnregisterResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.bool get success => $_getBF(0);
@$pb.TagNumber(1)
set success($core.bool value) => $_setBool(0, value);
@$pb.TagNumber(1)
$core.bool hasSuccess() => $_has(0);
@$pb.TagNumber(1)
void clearSuccess() => $_clearField(1);
}
const $core.bool _omitFieldNames =
$core.bool.fromEnvironment('protobuf.omit_field_names');
const $core.bool _omitMessageNames =
$core.bool.fromEnvironment('protobuf.omit_message_names');

View File

@ -0,0 +1,11 @@
// This is a generated file - do not edit.
//
// Generated from proto/auth/auth.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names

View File

@ -0,0 +1,187 @@
// This is a generated file - do not edit.
//
// Generated from proto/auth/auth.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names
import 'dart:async' as $async;
import 'dart:core' as $core;
import 'package:grpc/service_api.dart' as $grpc;
import 'package:protobuf/protobuf.dart' as $pb;
import 'auth.pb.dart' as $0;
export 'auth.pb.dart';
///
@$pb.GrpcServiceName('auth.AuthService')
class AuthServiceClient extends $grpc.Client {
/// The hostname for this service.
static const $core.String defaultHost = '';
/// OAuth scopes needed for the client.
static const $core.List<$core.String> oauthScopes = [
'',
];
AuthServiceClient(super.channel, {super.options, super.interceptors});
///
$grpc.ResponseFuture<$0.StatusResponse> status(
$0.StatusRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$status, request, options: options);
}
///
$grpc.ResponseFuture<$0.LoginResponse> login(
$0.LoginRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$login, request, options: options);
}
///
$grpc.ResponseFuture<$0.PreRegisterResponse> preRegister(
$0.PreRegisterRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$preRegister, request, options: options);
}
///
$grpc.ResponseFuture<$0.RegisterResponse> register(
$0.RegisterRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$register, request, options: options);
}
///
$grpc.ResponseFuture<$0.UnregisterResponse> unregister(
$0.UnregisterRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$unregister, request, options: options);
}
// method descriptors
static final _$status =
$grpc.ClientMethod<$0.StatusRequest, $0.StatusResponse>(
'/auth.AuthService/Status',
($0.StatusRequest value) => value.writeToBuffer(),
$0.StatusResponse.fromBuffer);
static final _$login = $grpc.ClientMethod<$0.LoginRequest, $0.LoginResponse>(
'/auth.AuthService/Login',
($0.LoginRequest value) => value.writeToBuffer(),
$0.LoginResponse.fromBuffer);
static final _$preRegister =
$grpc.ClientMethod<$0.PreRegisterRequest, $0.PreRegisterResponse>(
'/auth.AuthService/PreRegister',
($0.PreRegisterRequest value) => value.writeToBuffer(),
$0.PreRegisterResponse.fromBuffer);
static final _$register =
$grpc.ClientMethod<$0.RegisterRequest, $0.RegisterResponse>(
'/auth.AuthService/Register',
($0.RegisterRequest value) => value.writeToBuffer(),
$0.RegisterResponse.fromBuffer);
static final _$unregister =
$grpc.ClientMethod<$0.UnregisterRequest, $0.UnregisterResponse>(
'/auth.AuthService/Unregister',
($0.UnregisterRequest value) => value.writeToBuffer(),
$0.UnregisterResponse.fromBuffer);
}
@$pb.GrpcServiceName('auth.AuthService')
abstract class AuthServiceBase extends $grpc.Service {
$core.String get $name => 'auth.AuthService';
AuthServiceBase() {
$addMethod($grpc.ServiceMethod<$0.StatusRequest, $0.StatusResponse>(
'Status',
status_Pre,
false,
false,
($core.List<$core.int> value) => $0.StatusRequest.fromBuffer(value),
($0.StatusResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.LoginRequest, $0.LoginResponse>(
'Login',
login_Pre,
false,
false,
($core.List<$core.int> value) => $0.LoginRequest.fromBuffer(value),
($0.LoginResponse value) => value.writeToBuffer()));
$addMethod(
$grpc.ServiceMethod<$0.PreRegisterRequest, $0.PreRegisterResponse>(
'PreRegister',
preRegister_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.PreRegisterRequest.fromBuffer(value),
($0.PreRegisterResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.RegisterRequest, $0.RegisterResponse>(
'Register',
register_Pre,
false,
false,
($core.List<$core.int> value) => $0.RegisterRequest.fromBuffer(value),
($0.RegisterResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.UnregisterRequest, $0.UnregisterResponse>(
'Unregister',
unregister_Pre,
false,
false,
($core.List<$core.int> value) => $0.UnregisterRequest.fromBuffer(value),
($0.UnregisterResponse value) => value.writeToBuffer()));
}
$async.Future<$0.StatusResponse> status_Pre(
$grpc.ServiceCall $call, $async.Future<$0.StatusRequest> $request) async {
return status($call, await $request);
}
$async.Future<$0.StatusResponse> status(
$grpc.ServiceCall call, $0.StatusRequest request);
$async.Future<$0.LoginResponse> login_Pre(
$grpc.ServiceCall $call, $async.Future<$0.LoginRequest> $request) async {
return login($call, await $request);
}
$async.Future<$0.LoginResponse> login(
$grpc.ServiceCall call, $0.LoginRequest request);
$async.Future<$0.PreRegisterResponse> preRegister_Pre($grpc.ServiceCall $call,
$async.Future<$0.PreRegisterRequest> $request) async {
return preRegister($call, await $request);
}
$async.Future<$0.PreRegisterResponse> preRegister(
$grpc.ServiceCall call, $0.PreRegisterRequest request);
$async.Future<$0.RegisterResponse> register_Pre($grpc.ServiceCall $call,
$async.Future<$0.RegisterRequest> $request) async {
return register($call, await $request);
}
$async.Future<$0.RegisterResponse> register(
$grpc.ServiceCall call, $0.RegisterRequest request);
$async.Future<$0.UnregisterResponse> unregister_Pre($grpc.ServiceCall $call,
$async.Future<$0.UnregisterRequest> $request) async {
return unregister($call, await $request);
}
$async.Future<$0.UnregisterResponse> unregister(
$grpc.ServiceCall call, $0.UnregisterRequest request);
}

View File

@ -0,0 +1,188 @@
// This is a generated file - do not edit.
//
// Generated from proto/auth/auth.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names, unused_import
import 'dart:convert' as $convert;
import 'dart:core' as $core;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use statusRequestDescriptor instead')
const StatusRequest$json = {
'1': 'StatusRequest',
};
/// Descriptor for `StatusRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List statusRequestDescriptor =
$convert.base64Decode('Cg1TdGF0dXNSZXF1ZXN0');
@$core.Deprecated('Use statusResponseDescriptor instead')
const StatusResponse$json = {
'1': 'StatusResponse',
'2': [
{'1': 'online', '3': 1, '4': 1, '5': 8, '10': 'online'},
{'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'},
{'1': 'server_time', '3': 3, '4': 1, '5': 3, '10': 'serverTime'},
],
};
/// Descriptor for `StatusResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List statusResponseDescriptor = $convert.base64Decode(
'Cg5TdGF0dXNSZXNwb25zZRIWCgZvbmxpbmUYASABKAhSBm9ubGluZRIYCgdtZXNzYWdlGAIgAS'
'gJUgdtZXNzYWdlEh8KC3NlcnZlcl90aW1lGAMgASgDUgpzZXJ2ZXJUaW1l');
@$core.Deprecated('Use loginRequestDescriptor instead')
const LoginRequest$json = {
'1': 'LoginRequest',
};
/// Descriptor for `LoginRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List loginRequestDescriptor =
$convert.base64Decode('CgxMb2dpblJlcXVlc3Q=');
@$core.Deprecated('Use gameUserInfoDescriptor instead')
const GameUserInfo$json = {
'1': 'GameUserInfo',
'2': [
{'1': 'game_user_id', '3': 1, '4': 1, '5': 9, '10': 'gameUserId'},
{'1': 'handle_name', '3': 2, '4': 1, '5': 9, '10': 'handleName'},
{'1': 'avatar_url', '3': 3, '4': 1, '5': 9, '10': 'avatarUrl'},
{'1': 'citizen_record', '3': 4, '4': 1, '5': 9, '10': 'citizenRecord'},
{'1': 'enlisted_date', '3': 5, '4': 1, '5': 3, '10': 'enlistedDate'},
],
};
/// Descriptor for `GameUserInfo`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List gameUserInfoDescriptor = $convert.base64Decode(
'CgxHYW1lVXNlckluZm8SIAoMZ2FtZV91c2VyX2lkGAEgASgJUgpnYW1lVXNlcklkEh8KC2hhbm'
'RsZV9uYW1lGAIgASgJUgpoYW5kbGVOYW1lEh0KCmF2YXRhcl91cmwYAyABKAlSCWF2YXRhclVy'
'bBIlCg5jaXRpemVuX3JlY29yZBgEIAEoCVINY2l0aXplblJlY29yZBIjCg1lbmxpc3RlZF9kYX'
'RlGAUgASgDUgxlbmxpc3RlZERhdGU=');
@$core.Deprecated('Use loginResponseDescriptor instead')
const LoginResponse$json = {
'1': 'LoginResponse',
'2': [
{'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'},
{
'1': 'user_info',
'3': 2,
'4': 1,
'5': 11,
'6': '.auth.GameUserInfo',
'10': 'userInfo'
},
{'1': 'last_login_time', '3': 3, '4': 1, '5': 3, '10': 'lastLoginTime'},
],
};
/// Descriptor for `LoginResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List loginResponseDescriptor = $convert.base64Decode(
'Cg1Mb2dpblJlc3BvbnNlEhIKBHV1aWQYASABKAlSBHV1aWQSLwoJdXNlcl9pbmZvGAIgASgLMh'
'IuYXV0aC5HYW1lVXNlckluZm9SCHVzZXJJbmZvEiYKD2xhc3RfbG9naW5fdGltZRgDIAEoA1IN'
'bGFzdExvZ2luVGltZQ==');
@$core.Deprecated('Use preRegisterRequestDescriptor instead')
const PreRegisterRequest$json = {
'1': 'PreRegisterRequest',
'2': [
{'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'},
{'1': 'game_user_id', '3': 2, '4': 1, '5': 9, '10': 'gameUserId'},
],
};
/// Descriptor for `PreRegisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List preRegisterRequestDescriptor = $convert.base64Decode(
'ChJQcmVSZWdpc3RlclJlcXVlc3QSEgoEdXVpZBgBIAEoCVIEdXVpZBIgCgxnYW1lX3VzZXJfaW'
'QYAiABKAlSCmdhbWVVc2VySWQ=');
@$core.Deprecated('Use preRegisterResponseDescriptor instead')
const PreRegisterResponse$json = {
'1': 'PreRegisterResponse',
'2': [
{
'1': 'verification_code',
'3': 1,
'4': 1,
'5': 9,
'10': 'verificationCode'
},
{'1': 'expire_time', '3': 2, '4': 1, '5': 3, '10': 'expireTime'},
],
};
/// Descriptor for `PreRegisterResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List preRegisterResponseDescriptor = $convert.base64Decode(
'ChNQcmVSZWdpc3RlclJlc3BvbnNlEisKEXZlcmlmaWNhdGlvbl9jb2RlGAEgASgJUhB2ZXJpZm'
'ljYXRpb25Db2RlEh8KC2V4cGlyZV90aW1lGAIgASgDUgpleHBpcmVUaW1l');
@$core.Deprecated('Use registerRequestDescriptor instead')
const RegisterRequest$json = {
'1': 'RegisterRequest',
'2': [
{'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'},
{'1': 'game_user_id', '3': 2, '4': 1, '5': 9, '10': 'gameUserId'},
],
};
/// Descriptor for `RegisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List registerRequestDescriptor = $convert.base64Decode(
'Cg9SZWdpc3RlclJlcXVlc3QSEgoEdXVpZBgBIAEoCVIEdXVpZBIgCgxnYW1lX3VzZXJfaWQYAi'
'ABKAlSCmdhbWVVc2VySWQ=');
@$core.Deprecated('Use registerResponseDescriptor instead')
const RegisterResponse$json = {
'1': 'RegisterResponse',
'2': [
{
'1': 'party_room_secret_key',
'3': 1,
'4': 1,
'5': 9,
'10': 'partyRoomSecretKey'
},
{
'1': 'user_info',
'3': 2,
'4': 1,
'5': 11,
'6': '.auth.GameUserInfo',
'10': 'userInfo'
},
],
};
/// Descriptor for `RegisterResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List registerResponseDescriptor = $convert.base64Decode(
'ChBSZWdpc3RlclJlc3BvbnNlEjEKFXBhcnR5X3Jvb21fc2VjcmV0X2tleRgBIAEoCVIScGFydH'
'lSb29tU2VjcmV0S2V5Ei8KCXVzZXJfaW5mbxgCIAEoCzISLmF1dGguR2FtZVVzZXJJbmZvUgh1'
'c2VySW5mbw==');
@$core.Deprecated('Use unregisterRequestDescriptor instead')
const UnregisterRequest$json = {
'1': 'UnregisterRequest',
};
/// Descriptor for `UnregisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List unregisterRequestDescriptor =
$convert.base64Decode('ChFVbnJlZ2lzdGVyUmVxdWVzdA==');
@$core.Deprecated('Use unregisterResponseDescriptor instead')
const UnregisterResponse$json = {
'1': 'UnregisterResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `UnregisterResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List unregisterResponseDescriptor =
$convert.base64Decode(
'ChJVbnJlZ2lzdGVyUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');

View File

@ -0,0 +1,601 @@
// This is a generated file - do not edit.
//
// Generated from proto/common/common.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names
import 'dart:core' as $core;
import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:protobuf/protobuf.dart' as $pb;
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
///
class GetServerTimeRequest extends $pb.GeneratedMessage {
factory GetServerTimeRequest() => create();
GetServerTimeRequest._();
factory GetServerTimeRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetServerTimeRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetServerTimeRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetServerTimeRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetServerTimeRequest copyWith(void Function(GetServerTimeRequest) updates) =>
super.copyWith((message) => updates(message as GetServerTimeRequest))
as GetServerTimeRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetServerTimeRequest create() => GetServerTimeRequest._();
@$core.override
GetServerTimeRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetServerTimeRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetServerTimeRequest>(create);
static GetServerTimeRequest? _defaultInstance;
}
///
class GetServerTimeResponse extends $pb.GeneratedMessage {
factory GetServerTimeResponse({
$fixnum.Int64? timestamp,
$core.String? timezone,
}) {
final result = create();
if (timestamp != null) result.timestamp = timestamp;
if (timezone != null) result.timezone = timezone;
return result;
}
GetServerTimeResponse._();
factory GetServerTimeResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetServerTimeResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetServerTimeResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..aInt64(1, _omitFieldNames ? '' : 'timestamp')
..aOS(2, _omitFieldNames ? '' : 'timezone')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetServerTimeResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetServerTimeResponse copyWith(
void Function(GetServerTimeResponse) updates) =>
super.copyWith((message) => updates(message as GetServerTimeResponse))
as GetServerTimeResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetServerTimeResponse create() => GetServerTimeResponse._();
@$core.override
GetServerTimeResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetServerTimeResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetServerTimeResponse>(create);
static GetServerTimeResponse? _defaultInstance;
@$pb.TagNumber(1)
$fixnum.Int64 get timestamp => $_getI64(0);
@$pb.TagNumber(1)
set timestamp($fixnum.Int64 value) => $_setInt64(0, value);
@$pb.TagNumber(1)
$core.bool hasTimestamp() => $_has(0);
@$pb.TagNumber(1)
void clearTimestamp() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get timezone => $_getSZ(1);
@$pb.TagNumber(2)
set timezone($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasTimezone() => $_has(1);
@$pb.TagNumber(2)
void clearTimezone() => $_clearField(2);
}
///
class GetVersionRequest extends $pb.GeneratedMessage {
factory GetVersionRequest() => create();
GetVersionRequest._();
factory GetVersionRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetVersionRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetVersionRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetVersionRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetVersionRequest copyWith(void Function(GetVersionRequest) updates) =>
super.copyWith((message) => updates(message as GetVersionRequest))
as GetVersionRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetVersionRequest create() => GetVersionRequest._();
@$core.override
GetVersionRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetVersionRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetVersionRequest>(create);
static GetVersionRequest? _defaultInstance;
}
///
class GetVersionResponse extends $pb.GeneratedMessage {
factory GetVersionResponse({
$core.int? version,
$core.int? latestVersion,
$core.int? minClientVersion,
}) {
final result = create();
if (version != null) result.version = version;
if (latestVersion != null) result.latestVersion = latestVersion;
if (minClientVersion != null) result.minClientVersion = minClientVersion;
return result;
}
GetVersionResponse._();
factory GetVersionResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetVersionResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetVersionResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..aI(1, _omitFieldNames ? '' : 'version')
..aI(2, _omitFieldNames ? '' : 'latestVersion')
..aI(3, _omitFieldNames ? '' : 'minClientVersion')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetVersionResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetVersionResponse copyWith(void Function(GetVersionResponse) updates) =>
super.copyWith((message) => updates(message as GetVersionResponse))
as GetVersionResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetVersionResponse create() => GetVersionResponse._();
@$core.override
GetVersionResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetVersionResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetVersionResponse>(create);
static GetVersionResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.int get version => $_getIZ(0);
@$pb.TagNumber(1)
set version($core.int value) => $_setSignedInt32(0, value);
@$pb.TagNumber(1)
$core.bool hasVersion() => $_has(0);
@$pb.TagNumber(1)
void clearVersion() => $_clearField(1);
@$pb.TagNumber(2)
$core.int get latestVersion => $_getIZ(1);
@$pb.TagNumber(2)
set latestVersion($core.int value) => $_setSignedInt32(1, value);
@$pb.TagNumber(2)
$core.bool hasLatestVersion() => $_has(1);
@$pb.TagNumber(2)
void clearLatestVersion() => $_clearField(2);
@$pb.TagNumber(3)
$core.int get minClientVersion => $_getIZ(2);
@$pb.TagNumber(3)
set minClientVersion($core.int value) => $_setSignedInt32(2, value);
@$pb.TagNumber(3)
$core.bool hasMinClientVersion() => $_has(2);
@$pb.TagNumber(3)
void clearMinClientVersion() => $_clearField(3);
}
///
class SignalType extends $pb.GeneratedMessage {
factory SignalType({
$core.String? id,
$core.String? name,
$core.bool? isSpecial,
}) {
final result = create();
if (id != null) result.id = id;
if (name != null) result.name = name;
if (isSpecial != null) result.isSpecial = isSpecial;
return result;
}
SignalType._();
factory SignalType.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory SignalType.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'SignalType',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'id')
..aOS(2, _omitFieldNames ? '' : 'name')
..aOB(3, _omitFieldNames ? '' : 'isSpecial')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
SignalType clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
SignalType copyWith(void Function(SignalType) updates) =>
super.copyWith((message) => updates(message as SignalType)) as SignalType;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignalType create() => SignalType._();
@$core.override
SignalType createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static SignalType getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<SignalType>(create);
static SignalType? _defaultInstance;
@$pb.TagNumber(1)
$core.String get id => $_getSZ(0);
@$pb.TagNumber(1)
set id($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasId() => $_has(0);
@$pb.TagNumber(1)
void clearId() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => $_clearField(2);
@$pb.TagNumber(3)
$core.bool get isSpecial => $_getBF(2);
@$pb.TagNumber(3)
set isSpecial($core.bool value) => $_setBool(2, value);
@$pb.TagNumber(3)
$core.bool hasIsSpecial() => $_has(2);
@$pb.TagNumber(3)
void clearIsSpecial() => $_clearField(3);
}
///
class GetSignalTypesRequest extends $pb.GeneratedMessage {
factory GetSignalTypesRequest() => create();
GetSignalTypesRequest._();
factory GetSignalTypesRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetSignalTypesRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetSignalTypesRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetSignalTypesRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetSignalTypesRequest copyWith(
void Function(GetSignalTypesRequest) updates) =>
super.copyWith((message) => updates(message as GetSignalTypesRequest))
as GetSignalTypesRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetSignalTypesRequest create() => GetSignalTypesRequest._();
@$core.override
GetSignalTypesRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetSignalTypesRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetSignalTypesRequest>(create);
static GetSignalTypesRequest? _defaultInstance;
}
///
class GetSignalTypesResponse extends $pb.GeneratedMessage {
factory GetSignalTypesResponse({
$core.Iterable<SignalType>? signals,
}) {
final result = create();
if (signals != null) result.signals.addAll(signals);
return result;
}
GetSignalTypesResponse._();
factory GetSignalTypesResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetSignalTypesResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetSignalTypesResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..pPM<SignalType>(1, _omitFieldNames ? '' : 'signals',
subBuilder: SignalType.create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetSignalTypesResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetSignalTypesResponse copyWith(
void Function(GetSignalTypesResponse) updates) =>
super.copyWith((message) => updates(message as GetSignalTypesResponse))
as GetSignalTypesResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetSignalTypesResponse create() => GetSignalTypesResponse._();
@$core.override
GetSignalTypesResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetSignalTypesResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetSignalTypesResponse>(create);
static GetSignalTypesResponse? _defaultInstance;
@$pb.TagNumber(1)
$pb.PbList<SignalType> get signals => $_getList(0);
}
///
class Tag extends $pb.GeneratedMessage {
factory Tag({
$core.String? id,
$core.String? name,
$core.String? info,
$core.String? color,
$core.Iterable<Tag>? subTags,
}) {
final result = create();
if (id != null) result.id = id;
if (name != null) result.name = name;
if (info != null) result.info = info;
if (color != null) result.color = color;
if (subTags != null) result.subTags.addAll(subTags);
return result;
}
Tag._();
factory Tag.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory Tag.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'Tag',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'id')
..aOS(2, _omitFieldNames ? '' : 'name')
..aOS(3, _omitFieldNames ? '' : 'info')
..aOS(4, _omitFieldNames ? '' : 'color')
..pPM<Tag>(5, _omitFieldNames ? '' : 'subTags', subBuilder: Tag.create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Tag clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Tag copyWith(void Function(Tag) updates) =>
super.copyWith((message) => updates(message as Tag)) as Tag;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static Tag create() => Tag._();
@$core.override
Tag createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static Tag getDefault() =>
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Tag>(create);
static Tag? _defaultInstance;
@$pb.TagNumber(1)
$core.String get id => $_getSZ(0);
@$pb.TagNumber(1)
set id($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasId() => $_has(0);
@$pb.TagNumber(1)
void clearId() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => $_clearField(2);
@$pb.TagNumber(3)
$core.String get info => $_getSZ(2);
@$pb.TagNumber(3)
set info($core.String value) => $_setString(2, value);
@$pb.TagNumber(3)
$core.bool hasInfo() => $_has(2);
@$pb.TagNumber(3)
void clearInfo() => $_clearField(3);
@$pb.TagNumber(4)
$core.String get color => $_getSZ(3);
@$pb.TagNumber(4)
set color($core.String value) => $_setString(3, value);
@$pb.TagNumber(4)
$core.bool hasColor() => $_has(3);
@$pb.TagNumber(4)
void clearColor() => $_clearField(4);
@$pb.TagNumber(5)
$pb.PbList<Tag> get subTags => $_getList(4);
}
///
class GetTagsRequest extends $pb.GeneratedMessage {
factory GetTagsRequest() => create();
GetTagsRequest._();
factory GetTagsRequest.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetTagsRequest.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetTagsRequest',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetTagsRequest clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetTagsRequest copyWith(void Function(GetTagsRequest) updates) =>
super.copyWith((message) => updates(message as GetTagsRequest))
as GetTagsRequest;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetTagsRequest create() => GetTagsRequest._();
@$core.override
GetTagsRequest createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetTagsRequest getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetTagsRequest>(create);
static GetTagsRequest? _defaultInstance;
}
///
class GetTagsResponse extends $pb.GeneratedMessage {
factory GetTagsResponse({
$core.Iterable<Tag>? tags,
}) {
final result = create();
if (tags != null) result.tags.addAll(tags);
return result;
}
GetTagsResponse._();
factory GetTagsResponse.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory GetTagsResponse.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'GetTagsResponse',
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
createEmptyInstance: create)
..pPM<Tag>(1, _omitFieldNames ? '' : 'tags', subBuilder: Tag.create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetTagsResponse clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GetTagsResponse copyWith(void Function(GetTagsResponse) updates) =>
super.copyWith((message) => updates(message as GetTagsResponse))
as GetTagsResponse;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetTagsResponse create() => GetTagsResponse._();
@$core.override
GetTagsResponse createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static GetTagsResponse getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<GetTagsResponse>(create);
static GetTagsResponse? _defaultInstance;
@$pb.TagNumber(1)
$pb.PbList<Tag> get tags => $_getList(0);
}
const $core.bool _omitFieldNames =
$core.bool.fromEnvironment('protobuf.omit_field_names');
const $core.bool _omitMessageNames =
$core.bool.fromEnvironment('protobuf.omit_message_names');

View File

@ -0,0 +1,11 @@
// This is a generated file - do not edit.
//
// Generated from proto/common/common.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names

View File

@ -0,0 +1,164 @@
// This is a generated file - do not edit.
//
// Generated from proto/common/common.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names
import 'dart:async' as $async;
import 'dart:core' as $core;
import 'package:grpc/service_api.dart' as $grpc;
import 'package:protobuf/protobuf.dart' as $pb;
import 'common.pb.dart' as $0;
export 'common.pb.dart';
///
@$pb.GrpcServiceName('common.CommonService')
class CommonServiceClient extends $grpc.Client {
/// The hostname for this service.
static const $core.String defaultHost = '';
/// OAuth scopes needed for the client.
static const $core.List<$core.String> oauthScopes = [
'',
];
CommonServiceClient(super.channel, {super.options, super.interceptors});
///
$grpc.ResponseFuture<$0.GetServerTimeResponse> getServerTime(
$0.GetServerTimeRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getServerTime, request, options: options);
}
///
$grpc.ResponseFuture<$0.GetVersionResponse> getVersion(
$0.GetVersionRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getVersion, request, options: options);
}
///
$grpc.ResponseFuture<$0.GetSignalTypesResponse> getSignalTypes(
$0.GetSignalTypesRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getSignalTypes, request, options: options);
}
///
$grpc.ResponseFuture<$0.GetTagsResponse> getTags(
$0.GetTagsRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getTags, request, options: options);
}
// method descriptors
static final _$getServerTime =
$grpc.ClientMethod<$0.GetServerTimeRequest, $0.GetServerTimeResponse>(
'/common.CommonService/GetServerTime',
($0.GetServerTimeRequest value) => value.writeToBuffer(),
$0.GetServerTimeResponse.fromBuffer);
static final _$getVersion =
$grpc.ClientMethod<$0.GetVersionRequest, $0.GetVersionResponse>(
'/common.CommonService/GetVersion',
($0.GetVersionRequest value) => value.writeToBuffer(),
$0.GetVersionResponse.fromBuffer);
static final _$getSignalTypes =
$grpc.ClientMethod<$0.GetSignalTypesRequest, $0.GetSignalTypesResponse>(
'/common.CommonService/GetSignalTypes',
($0.GetSignalTypesRequest value) => value.writeToBuffer(),
$0.GetSignalTypesResponse.fromBuffer);
static final _$getTags =
$grpc.ClientMethod<$0.GetTagsRequest, $0.GetTagsResponse>(
'/common.CommonService/GetTags',
($0.GetTagsRequest value) => value.writeToBuffer(),
$0.GetTagsResponse.fromBuffer);
}
@$pb.GrpcServiceName('common.CommonService')
abstract class CommonServiceBase extends $grpc.Service {
$core.String get $name => 'common.CommonService';
CommonServiceBase() {
$addMethod(
$grpc.ServiceMethod<$0.GetServerTimeRequest, $0.GetServerTimeResponse>(
'GetServerTime',
getServerTime_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.GetServerTimeRequest.fromBuffer(value),
($0.GetServerTimeResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.GetVersionRequest, $0.GetVersionResponse>(
'GetVersion',
getVersion_Pre,
false,
false,
($core.List<$core.int> value) => $0.GetVersionRequest.fromBuffer(value),
($0.GetVersionResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.GetSignalTypesRequest,
$0.GetSignalTypesResponse>(
'GetSignalTypes',
getSignalTypes_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.GetSignalTypesRequest.fromBuffer(value),
($0.GetSignalTypesResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.GetTagsRequest, $0.GetTagsResponse>(
'GetTags',
getTags_Pre,
false,
false,
($core.List<$core.int> value) => $0.GetTagsRequest.fromBuffer(value),
($0.GetTagsResponse value) => value.writeToBuffer()));
}
$async.Future<$0.GetServerTimeResponse> getServerTime_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.GetServerTimeRequest> $request) async {
return getServerTime($call, await $request);
}
$async.Future<$0.GetServerTimeResponse> getServerTime(
$grpc.ServiceCall call, $0.GetServerTimeRequest request);
$async.Future<$0.GetVersionResponse> getVersion_Pre($grpc.ServiceCall $call,
$async.Future<$0.GetVersionRequest> $request) async {
return getVersion($call, await $request);
}
$async.Future<$0.GetVersionResponse> getVersion(
$grpc.ServiceCall call, $0.GetVersionRequest request);
$async.Future<$0.GetSignalTypesResponse> getSignalTypes_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.GetSignalTypesRequest> $request) async {
return getSignalTypes($call, await $request);
}
$async.Future<$0.GetSignalTypesResponse> getSignalTypes(
$grpc.ServiceCall call, $0.GetSignalTypesRequest request);
$async.Future<$0.GetTagsResponse> getTags_Pre($grpc.ServiceCall $call,
$async.Future<$0.GetTagsRequest> $request) async {
return getTags($call, await $request);
}
$async.Future<$0.GetTagsResponse> getTags(
$grpc.ServiceCall call, $0.GetTagsRequest request);
}

View File

@ -0,0 +1,160 @@
// This is a generated file - do not edit.
//
// Generated from proto/common/common.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names, unused_import
import 'dart:convert' as $convert;
import 'dart:core' as $core;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use getServerTimeRequestDescriptor instead')
const GetServerTimeRequest$json = {
'1': 'GetServerTimeRequest',
};
/// Descriptor for `GetServerTimeRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getServerTimeRequestDescriptor =
$convert.base64Decode('ChRHZXRTZXJ2ZXJUaW1lUmVxdWVzdA==');
@$core.Deprecated('Use getServerTimeResponseDescriptor instead')
const GetServerTimeResponse$json = {
'1': 'GetServerTimeResponse',
'2': [
{'1': 'timestamp', '3': 1, '4': 1, '5': 3, '10': 'timestamp'},
{'1': 'timezone', '3': 2, '4': 1, '5': 9, '10': 'timezone'},
],
};
/// Descriptor for `GetServerTimeResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getServerTimeResponseDescriptor = $convert.base64Decode(
'ChVHZXRTZXJ2ZXJUaW1lUmVzcG9uc2USHAoJdGltZXN0YW1wGAEgASgDUgl0aW1lc3RhbXASGg'
'oIdGltZXpvbmUYAiABKAlSCHRpbWV6b25l');
@$core.Deprecated('Use getVersionRequestDescriptor instead')
const GetVersionRequest$json = {
'1': 'GetVersionRequest',
};
/// Descriptor for `GetVersionRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getVersionRequestDescriptor =
$convert.base64Decode('ChFHZXRWZXJzaW9uUmVxdWVzdA==');
@$core.Deprecated('Use getVersionResponseDescriptor instead')
const GetVersionResponse$json = {
'1': 'GetVersionResponse',
'2': [
{'1': 'version', '3': 1, '4': 1, '5': 5, '10': 'version'},
{'1': 'latest_version', '3': 2, '4': 1, '5': 5, '10': 'latestVersion'},
{
'1': 'min_client_version',
'3': 3,
'4': 1,
'5': 5,
'10': 'minClientVersion'
},
],
};
/// Descriptor for `GetVersionResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getVersionResponseDescriptor = $convert.base64Decode(
'ChJHZXRWZXJzaW9uUmVzcG9uc2USGAoHdmVyc2lvbhgBIAEoBVIHdmVyc2lvbhIlCg5sYXRlc3'
'RfdmVyc2lvbhgCIAEoBVINbGF0ZXN0VmVyc2lvbhIsChJtaW5fY2xpZW50X3ZlcnNpb24YAyAB'
'KAVSEG1pbkNsaWVudFZlcnNpb24=');
@$core.Deprecated('Use signalTypeDescriptor instead')
const SignalType$json = {
'1': 'SignalType',
'2': [
{'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
{'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
{'1': 'is_special', '3': 3, '4': 1, '5': 8, '10': 'isSpecial'},
],
};
/// Descriptor for `SignalType`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signalTypeDescriptor = $convert.base64Decode(
'CgpTaWduYWxUeXBlEg4KAmlkGAEgASgJUgJpZBISCgRuYW1lGAIgASgJUgRuYW1lEh0KCmlzX3'
'NwZWNpYWwYAyABKAhSCWlzU3BlY2lhbA==');
@$core.Deprecated('Use getSignalTypesRequestDescriptor instead')
const GetSignalTypesRequest$json = {
'1': 'GetSignalTypesRequest',
};
/// Descriptor for `GetSignalTypesRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getSignalTypesRequestDescriptor =
$convert.base64Decode('ChVHZXRTaWduYWxUeXBlc1JlcXVlc3Q=');
@$core.Deprecated('Use getSignalTypesResponseDescriptor instead')
const GetSignalTypesResponse$json = {
'1': 'GetSignalTypesResponse',
'2': [
{
'1': 'signals',
'3': 1,
'4': 3,
'5': 11,
'6': '.common.SignalType',
'10': 'signals'
},
],
};
/// Descriptor for `GetSignalTypesResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getSignalTypesResponseDescriptor =
$convert.base64Decode(
'ChZHZXRTaWduYWxUeXBlc1Jlc3BvbnNlEiwKB3NpZ25hbHMYASADKAsyEi5jb21tb24uU2lnbm'
'FsVHlwZVIHc2lnbmFscw==');
@$core.Deprecated('Use tagDescriptor instead')
const Tag$json = {
'1': 'Tag',
'2': [
{'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
{'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
{'1': 'info', '3': 3, '4': 1, '5': 9, '10': 'info'},
{'1': 'color', '3': 4, '4': 1, '5': 9, '10': 'color'},
{
'1': 'sub_tags',
'3': 5,
'4': 3,
'5': 11,
'6': '.common.Tag',
'10': 'subTags'
},
],
};
/// Descriptor for `Tag`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List tagDescriptor = $convert.base64Decode(
'CgNUYWcSDgoCaWQYASABKAlSAmlkEhIKBG5hbWUYAiABKAlSBG5hbWUSEgoEaW5mbxgDIAEoCV'
'IEaW5mbxIUCgVjb2xvchgEIAEoCVIFY29sb3ISJgoIc3ViX3RhZ3MYBSADKAsyCy5jb21tb24u'
'VGFnUgdzdWJUYWdz');
@$core.Deprecated('Use getTagsRequestDescriptor instead')
const GetTagsRequest$json = {
'1': 'GetTagsRequest',
};
/// Descriptor for `GetTagsRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getTagsRequestDescriptor =
$convert.base64Decode('Cg5HZXRUYWdzUmVxdWVzdA==');
@$core.Deprecated('Use getTagsResponseDescriptor instead')
const GetTagsResponse$json = {
'1': 'GetTagsResponse',
'2': [
{'1': 'tags', '3': 1, '4': 3, '5': 11, '6': '.common.Tag', '10': 'tags'},
],
};
/// Descriptor for `GetTagsResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getTagsResponseDescriptor = $convert.base64Decode(
'Cg9HZXRUYWdzUmVzcG9uc2USHwoEdGFncxgBIAMoCzILLmNvbW1vbi5UYWdSBHRhZ3M=');

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
// This is a generated file - do not edit.
//
// Generated from proto/partroom/partroom.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
///
class RoomEventType extends $pb.ProtobufEnum {
static const RoomEventType MEMBER_JOINED =
RoomEventType._(0, _omitEnumNames ? '' : 'MEMBER_JOINED');
static const RoomEventType MEMBER_LEFT =
RoomEventType._(1, _omitEnumNames ? '' : 'MEMBER_LEFT');
static const RoomEventType OWNER_CHANGED =
RoomEventType._(2, _omitEnumNames ? '' : 'OWNER_CHANGED');
static const RoomEventType ROOM_UPDATED =
RoomEventType._(3, _omitEnumNames ? '' : 'ROOM_UPDATED');
static const RoomEventType MEMBER_STATUS_UPDATED =
RoomEventType._(4, _omitEnumNames ? '' : 'MEMBER_STATUS_UPDATED');
static const RoomEventType SIGNAL_BROADCAST =
RoomEventType._(5, _omitEnumNames ? '' : 'SIGNAL_BROADCAST');
static const RoomEventType ROOM_DISMISSED =
RoomEventType._(6, _omitEnumNames ? '' : 'ROOM_DISMISSED');
static const RoomEventType MEMBER_KICKED =
RoomEventType._(7, _omitEnumNames ? '' : 'MEMBER_KICKED');
static const $core.List<RoomEventType> values = <RoomEventType>[
MEMBER_JOINED,
MEMBER_LEFT,
OWNER_CHANGED,
ROOM_UPDATED,
MEMBER_STATUS_UPDATED,
SIGNAL_BROADCAST,
ROOM_DISMISSED,
MEMBER_KICKED,
];
static final $core.List<RoomEventType?> _byValue =
$pb.ProtobufEnum.$_initByValueList(values, 7);
static RoomEventType? valueOf($core.int value) =>
value < 0 || value >= _byValue.length ? null : _byValue[value];
const RoomEventType._(super.value, super.name);
}
const $core.bool _omitEnumNames =
$core.bool.fromEnvironment('protobuf.omit_enum_names');

View File

@ -0,0 +1,543 @@
// This is a generated file - do not edit.
//
// Generated from proto/partroom/partroom.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names
import 'dart:async' as $async;
import 'dart:core' as $core;
import 'package:grpc/service_api.dart' as $grpc;
import 'package:protobuf/protobuf.dart' as $pb;
import 'partroom.pb.dart' as $0;
export 'partroom.pb.dart';
///
@$pb.GrpcServiceName('partroom.PartRoomService')
class PartRoomServiceClient extends $grpc.Client {
/// The hostname for this service.
static const $core.String defaultHost = '';
/// OAuth scopes needed for the client.
static const $core.List<$core.String> oauthScopes = [
'',
];
PartRoomServiceClient(super.channel, {super.options, super.interceptors});
///
$grpc.ResponseFuture<$0.GetRoomListResponse> getRoomList(
$0.GetRoomListRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getRoomList, request, options: options);
}
///
$grpc.ResponseFuture<$0.CreateRoomResponse> createRoom(
$0.CreateRoomRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$createRoom, request, options: options);
}
///
$grpc.ResponseFuture<$0.JoinRoomResponse> joinRoom(
$0.JoinRoomRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$joinRoom, request, options: options);
}
///
$grpc.ResponseFuture<$0.LeaveRoomResponse> leaveRoom(
$0.LeaveRoomRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$leaveRoom, request, options: options);
}
///
$grpc.ResponseFuture<$0.DismissRoomResponse> dismissRoom(
$0.DismissRoomRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$dismissRoom, request, options: options);
}
///
$grpc.ResponseFuture<$0.GetRoomInfoResponse> getRoomInfo(
$0.GetRoomInfoRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getRoomInfo, request, options: options);
}
///
$grpc.ResponseFuture<$0.GetRoomMembersResponse> getRoomMembers(
$0.GetRoomMembersRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getRoomMembers, request, options: options);
}
///
$grpc.ResponseFuture<$0.HeartbeatResponse> heartbeat(
$0.HeartbeatRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$heartbeat, request, options: options);
}
///
$grpc.ResponseFuture<$0.GetMyRoomResponse> getMyRoom(
$0.GetMyRoomRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getMyRoom, request, options: options);
}
///
$grpc.ResponseFuture<$0.UpdateRoomResponse> updateRoom(
$0.UpdateRoomRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$updateRoom, request, options: options);
}
///
$grpc.ResponseFuture<$0.KickMemberResponse> kickMember(
$0.KickMemberRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$kickMember, request, options: options);
}
///
$grpc.ResponseFuture<$0.SetStatusResponse> setStatus(
$0.SetStatusRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$setStatus, request, options: options);
}
///
$grpc.ResponseFuture<$0.SendSignalResponse> sendSignal(
$0.SendSignalRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$sendSignal, request, options: options);
}
///
$grpc.ResponseStream<$0.RoomEvent> listenRoomEvents(
$0.ListenRoomEventsRequest request, {
$grpc.CallOptions? options,
}) {
return $createStreamingCall(
_$listenRoomEvents, $async.Stream.fromIterable([request]),
options: options);
}
///
$grpc.ResponseFuture<$0.TransferOwnershipResponse> transferOwnership(
$0.TransferOwnershipRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$transferOwnership, request, options: options);
}
///
$grpc.ResponseFuture<$0.GetKickedMembersResponse> getKickedMembers(
$0.GetKickedMembersRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$getKickedMembers, request, options: options);
}
///
$grpc.ResponseFuture<$0.RemoveKickedMemberResponse> removeKickedMember(
$0.RemoveKickedMemberRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$removeKickedMember, request, options: options);
}
// method descriptors
static final _$getRoomList =
$grpc.ClientMethod<$0.GetRoomListRequest, $0.GetRoomListResponse>(
'/partroom.PartRoomService/GetRoomList',
($0.GetRoomListRequest value) => value.writeToBuffer(),
$0.GetRoomListResponse.fromBuffer);
static final _$createRoom =
$grpc.ClientMethod<$0.CreateRoomRequest, $0.CreateRoomResponse>(
'/partroom.PartRoomService/CreateRoom',
($0.CreateRoomRequest value) => value.writeToBuffer(),
$0.CreateRoomResponse.fromBuffer);
static final _$joinRoom =
$grpc.ClientMethod<$0.JoinRoomRequest, $0.JoinRoomResponse>(
'/partroom.PartRoomService/JoinRoom',
($0.JoinRoomRequest value) => value.writeToBuffer(),
$0.JoinRoomResponse.fromBuffer);
static final _$leaveRoom =
$grpc.ClientMethod<$0.LeaveRoomRequest, $0.LeaveRoomResponse>(
'/partroom.PartRoomService/LeaveRoom',
($0.LeaveRoomRequest value) => value.writeToBuffer(),
$0.LeaveRoomResponse.fromBuffer);
static final _$dismissRoom =
$grpc.ClientMethod<$0.DismissRoomRequest, $0.DismissRoomResponse>(
'/partroom.PartRoomService/DismissRoom',
($0.DismissRoomRequest value) => value.writeToBuffer(),
$0.DismissRoomResponse.fromBuffer);
static final _$getRoomInfo =
$grpc.ClientMethod<$0.GetRoomInfoRequest, $0.GetRoomInfoResponse>(
'/partroom.PartRoomService/GetRoomInfo',
($0.GetRoomInfoRequest value) => value.writeToBuffer(),
$0.GetRoomInfoResponse.fromBuffer);
static final _$getRoomMembers =
$grpc.ClientMethod<$0.GetRoomMembersRequest, $0.GetRoomMembersResponse>(
'/partroom.PartRoomService/GetRoomMembers',
($0.GetRoomMembersRequest value) => value.writeToBuffer(),
$0.GetRoomMembersResponse.fromBuffer);
static final _$heartbeat =
$grpc.ClientMethod<$0.HeartbeatRequest, $0.HeartbeatResponse>(
'/partroom.PartRoomService/Heartbeat',
($0.HeartbeatRequest value) => value.writeToBuffer(),
$0.HeartbeatResponse.fromBuffer);
static final _$getMyRoom =
$grpc.ClientMethod<$0.GetMyRoomRequest, $0.GetMyRoomResponse>(
'/partroom.PartRoomService/GetMyRoom',
($0.GetMyRoomRequest value) => value.writeToBuffer(),
$0.GetMyRoomResponse.fromBuffer);
static final _$updateRoom =
$grpc.ClientMethod<$0.UpdateRoomRequest, $0.UpdateRoomResponse>(
'/partroom.PartRoomService/UpdateRoom',
($0.UpdateRoomRequest value) => value.writeToBuffer(),
$0.UpdateRoomResponse.fromBuffer);
static final _$kickMember =
$grpc.ClientMethod<$0.KickMemberRequest, $0.KickMemberResponse>(
'/partroom.PartRoomService/KickMember',
($0.KickMemberRequest value) => value.writeToBuffer(),
$0.KickMemberResponse.fromBuffer);
static final _$setStatus =
$grpc.ClientMethod<$0.SetStatusRequest, $0.SetStatusResponse>(
'/partroom.PartRoomService/SetStatus',
($0.SetStatusRequest value) => value.writeToBuffer(),
$0.SetStatusResponse.fromBuffer);
static final _$sendSignal =
$grpc.ClientMethod<$0.SendSignalRequest, $0.SendSignalResponse>(
'/partroom.PartRoomService/SendSignal',
($0.SendSignalRequest value) => value.writeToBuffer(),
$0.SendSignalResponse.fromBuffer);
static final _$listenRoomEvents =
$grpc.ClientMethod<$0.ListenRoomEventsRequest, $0.RoomEvent>(
'/partroom.PartRoomService/ListenRoomEvents',
($0.ListenRoomEventsRequest value) => value.writeToBuffer(),
$0.RoomEvent.fromBuffer);
static final _$transferOwnership = $grpc.ClientMethod<
$0.TransferOwnershipRequest, $0.TransferOwnershipResponse>(
'/partroom.PartRoomService/TransferOwnership',
($0.TransferOwnershipRequest value) => value.writeToBuffer(),
$0.TransferOwnershipResponse.fromBuffer);
static final _$getKickedMembers = $grpc.ClientMethod<
$0.GetKickedMembersRequest, $0.GetKickedMembersResponse>(
'/partroom.PartRoomService/GetKickedMembers',
($0.GetKickedMembersRequest value) => value.writeToBuffer(),
$0.GetKickedMembersResponse.fromBuffer);
static final _$removeKickedMember = $grpc.ClientMethod<
$0.RemoveKickedMemberRequest, $0.RemoveKickedMemberResponse>(
'/partroom.PartRoomService/RemoveKickedMember',
($0.RemoveKickedMemberRequest value) => value.writeToBuffer(),
$0.RemoveKickedMemberResponse.fromBuffer);
}
@$pb.GrpcServiceName('partroom.PartRoomService')
abstract class PartRoomServiceBase extends $grpc.Service {
$core.String get $name => 'partroom.PartRoomService';
PartRoomServiceBase() {
$addMethod(
$grpc.ServiceMethod<$0.GetRoomListRequest, $0.GetRoomListResponse>(
'GetRoomList',
getRoomList_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.GetRoomListRequest.fromBuffer(value),
($0.GetRoomListResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.CreateRoomRequest, $0.CreateRoomResponse>(
'CreateRoom',
createRoom_Pre,
false,
false,
($core.List<$core.int> value) => $0.CreateRoomRequest.fromBuffer(value),
($0.CreateRoomResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.JoinRoomRequest, $0.JoinRoomResponse>(
'JoinRoom',
joinRoom_Pre,
false,
false,
($core.List<$core.int> value) => $0.JoinRoomRequest.fromBuffer(value),
($0.JoinRoomResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.LeaveRoomRequest, $0.LeaveRoomResponse>(
'LeaveRoom',
leaveRoom_Pre,
false,
false,
($core.List<$core.int> value) => $0.LeaveRoomRequest.fromBuffer(value),
($0.LeaveRoomResponse value) => value.writeToBuffer()));
$addMethod(
$grpc.ServiceMethod<$0.DismissRoomRequest, $0.DismissRoomResponse>(
'DismissRoom',
dismissRoom_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.DismissRoomRequest.fromBuffer(value),
($0.DismissRoomResponse value) => value.writeToBuffer()));
$addMethod(
$grpc.ServiceMethod<$0.GetRoomInfoRequest, $0.GetRoomInfoResponse>(
'GetRoomInfo',
getRoomInfo_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.GetRoomInfoRequest.fromBuffer(value),
($0.GetRoomInfoResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.GetRoomMembersRequest,
$0.GetRoomMembersResponse>(
'GetRoomMembers',
getRoomMembers_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.GetRoomMembersRequest.fromBuffer(value),
($0.GetRoomMembersResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.HeartbeatRequest, $0.HeartbeatResponse>(
'Heartbeat',
heartbeat_Pre,
false,
false,
($core.List<$core.int> value) => $0.HeartbeatRequest.fromBuffer(value),
($0.HeartbeatResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.GetMyRoomRequest, $0.GetMyRoomResponse>(
'GetMyRoom',
getMyRoom_Pre,
false,
false,
($core.List<$core.int> value) => $0.GetMyRoomRequest.fromBuffer(value),
($0.GetMyRoomResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.UpdateRoomRequest, $0.UpdateRoomResponse>(
'UpdateRoom',
updateRoom_Pre,
false,
false,
($core.List<$core.int> value) => $0.UpdateRoomRequest.fromBuffer(value),
($0.UpdateRoomResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.KickMemberRequest, $0.KickMemberResponse>(
'KickMember',
kickMember_Pre,
false,
false,
($core.List<$core.int> value) => $0.KickMemberRequest.fromBuffer(value),
($0.KickMemberResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.SetStatusRequest, $0.SetStatusResponse>(
'SetStatus',
setStatus_Pre,
false,
false,
($core.List<$core.int> value) => $0.SetStatusRequest.fromBuffer(value),
($0.SetStatusResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.SendSignalRequest, $0.SendSignalResponse>(
'SendSignal',
sendSignal_Pre,
false,
false,
($core.List<$core.int> value) => $0.SendSignalRequest.fromBuffer(value),
($0.SendSignalResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.ListenRoomEventsRequest, $0.RoomEvent>(
'ListenRoomEvents',
listenRoomEvents_Pre,
false,
true,
($core.List<$core.int> value) =>
$0.ListenRoomEventsRequest.fromBuffer(value),
($0.RoomEvent value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.TransferOwnershipRequest,
$0.TransferOwnershipResponse>(
'TransferOwnership',
transferOwnership_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.TransferOwnershipRequest.fromBuffer(value),
($0.TransferOwnershipResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.GetKickedMembersRequest,
$0.GetKickedMembersResponse>(
'GetKickedMembers',
getKickedMembers_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.GetKickedMembersRequest.fromBuffer(value),
($0.GetKickedMembersResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.RemoveKickedMemberRequest,
$0.RemoveKickedMemberResponse>(
'RemoveKickedMember',
removeKickedMember_Pre,
false,
false,
($core.List<$core.int> value) =>
$0.RemoveKickedMemberRequest.fromBuffer(value),
($0.RemoveKickedMemberResponse value) => value.writeToBuffer()));
}
$async.Future<$0.GetRoomListResponse> getRoomList_Pre($grpc.ServiceCall $call,
$async.Future<$0.GetRoomListRequest> $request) async {
return getRoomList($call, await $request);
}
$async.Future<$0.GetRoomListResponse> getRoomList(
$grpc.ServiceCall call, $0.GetRoomListRequest request);
$async.Future<$0.CreateRoomResponse> createRoom_Pre($grpc.ServiceCall $call,
$async.Future<$0.CreateRoomRequest> $request) async {
return createRoom($call, await $request);
}
$async.Future<$0.CreateRoomResponse> createRoom(
$grpc.ServiceCall call, $0.CreateRoomRequest request);
$async.Future<$0.JoinRoomResponse> joinRoom_Pre($grpc.ServiceCall $call,
$async.Future<$0.JoinRoomRequest> $request) async {
return joinRoom($call, await $request);
}
$async.Future<$0.JoinRoomResponse> joinRoom(
$grpc.ServiceCall call, $0.JoinRoomRequest request);
$async.Future<$0.LeaveRoomResponse> leaveRoom_Pre($grpc.ServiceCall $call,
$async.Future<$0.LeaveRoomRequest> $request) async {
return leaveRoom($call, await $request);
}
$async.Future<$0.LeaveRoomResponse> leaveRoom(
$grpc.ServiceCall call, $0.LeaveRoomRequest request);
$async.Future<$0.DismissRoomResponse> dismissRoom_Pre($grpc.ServiceCall $call,
$async.Future<$0.DismissRoomRequest> $request) async {
return dismissRoom($call, await $request);
}
$async.Future<$0.DismissRoomResponse> dismissRoom(
$grpc.ServiceCall call, $0.DismissRoomRequest request);
$async.Future<$0.GetRoomInfoResponse> getRoomInfo_Pre($grpc.ServiceCall $call,
$async.Future<$0.GetRoomInfoRequest> $request) async {
return getRoomInfo($call, await $request);
}
$async.Future<$0.GetRoomInfoResponse> getRoomInfo(
$grpc.ServiceCall call, $0.GetRoomInfoRequest request);
$async.Future<$0.GetRoomMembersResponse> getRoomMembers_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.GetRoomMembersRequest> $request) async {
return getRoomMembers($call, await $request);
}
$async.Future<$0.GetRoomMembersResponse> getRoomMembers(
$grpc.ServiceCall call, $0.GetRoomMembersRequest request);
$async.Future<$0.HeartbeatResponse> heartbeat_Pre($grpc.ServiceCall $call,
$async.Future<$0.HeartbeatRequest> $request) async {
return heartbeat($call, await $request);
}
$async.Future<$0.HeartbeatResponse> heartbeat(
$grpc.ServiceCall call, $0.HeartbeatRequest request);
$async.Future<$0.GetMyRoomResponse> getMyRoom_Pre($grpc.ServiceCall $call,
$async.Future<$0.GetMyRoomRequest> $request) async {
return getMyRoom($call, await $request);
}
$async.Future<$0.GetMyRoomResponse> getMyRoom(
$grpc.ServiceCall call, $0.GetMyRoomRequest request);
$async.Future<$0.UpdateRoomResponse> updateRoom_Pre($grpc.ServiceCall $call,
$async.Future<$0.UpdateRoomRequest> $request) async {
return updateRoom($call, await $request);
}
$async.Future<$0.UpdateRoomResponse> updateRoom(
$grpc.ServiceCall call, $0.UpdateRoomRequest request);
$async.Future<$0.KickMemberResponse> kickMember_Pre($grpc.ServiceCall $call,
$async.Future<$0.KickMemberRequest> $request) async {
return kickMember($call, await $request);
}
$async.Future<$0.KickMemberResponse> kickMember(
$grpc.ServiceCall call, $0.KickMemberRequest request);
$async.Future<$0.SetStatusResponse> setStatus_Pre($grpc.ServiceCall $call,
$async.Future<$0.SetStatusRequest> $request) async {
return setStatus($call, await $request);
}
$async.Future<$0.SetStatusResponse> setStatus(
$grpc.ServiceCall call, $0.SetStatusRequest request);
$async.Future<$0.SendSignalResponse> sendSignal_Pre($grpc.ServiceCall $call,
$async.Future<$0.SendSignalRequest> $request) async {
return sendSignal($call, await $request);
}
$async.Future<$0.SendSignalResponse> sendSignal(
$grpc.ServiceCall call, $0.SendSignalRequest request);
$async.Stream<$0.RoomEvent> listenRoomEvents_Pre($grpc.ServiceCall $call,
$async.Future<$0.ListenRoomEventsRequest> $request) async* {
yield* listenRoomEvents($call, await $request);
}
$async.Stream<$0.RoomEvent> listenRoomEvents(
$grpc.ServiceCall call, $0.ListenRoomEventsRequest request);
$async.Future<$0.TransferOwnershipResponse> transferOwnership_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.TransferOwnershipRequest> $request) async {
return transferOwnership($call, await $request);
}
$async.Future<$0.TransferOwnershipResponse> transferOwnership(
$grpc.ServiceCall call, $0.TransferOwnershipRequest request);
$async.Future<$0.GetKickedMembersResponse> getKickedMembers_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.GetKickedMembersRequest> $request) async {
return getKickedMembers($call, await $request);
}
$async.Future<$0.GetKickedMembersResponse> getKickedMembers(
$grpc.ServiceCall call, $0.GetKickedMembersRequest request);
$async.Future<$0.RemoveKickedMemberResponse> removeKickedMember_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.RemoveKickedMemberRequest> $request) async {
return removeKickedMember($call, await $request);
}
$async.Future<$0.RemoveKickedMemberResponse> removeKickedMember(
$grpc.ServiceCall call, $0.RemoveKickedMemberRequest request);
}

View File

@ -0,0 +1,759 @@
// This is a generated file - do not edit.
//
// Generated from proto/partroom/partroom.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names, unused_import
import 'dart:convert' as $convert;
import 'dart:core' as $core;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use roomEventTypeDescriptor instead')
const RoomEventType$json = {
'1': 'RoomEventType',
'2': [
{'1': 'MEMBER_JOINED', '2': 0},
{'1': 'MEMBER_LEFT', '2': 1},
{'1': 'OWNER_CHANGED', '2': 2},
{'1': 'ROOM_UPDATED', '2': 3},
{'1': 'MEMBER_STATUS_UPDATED', '2': 4},
{'1': 'SIGNAL_BROADCAST', '2': 5},
{'1': 'ROOM_DISMISSED', '2': 6},
{'1': 'MEMBER_KICKED', '2': 7},
],
};
/// Descriptor for `RoomEventType`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List roomEventTypeDescriptor = $convert.base64Decode(
'Cg1Sb29tRXZlbnRUeXBlEhEKDU1FTUJFUl9KT0lORUQQABIPCgtNRU1CRVJfTEVGVBABEhEKDU'
'9XTkVSX0NIQU5HRUQQAhIQCgxST09NX1VQREFURUQQAxIZChVNRU1CRVJfU1RBVFVTX1VQREFU'
'RUQQBBIUChBTSUdOQUxfQlJPQURDQVNUEAUSEgoOUk9PTV9ESVNNSVNTRUQQBhIRCg1NRU1CRV'
'JfS0lDS0VEEAc=');
@$core.Deprecated('Use roomListItemDescriptor instead')
const RoomListItem$json = {
'1': 'RoomListItem',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'owner_game_id', '3': 2, '4': 1, '5': 9, '10': 'ownerGameId'},
{'1': 'owner_handle_name', '3': 3, '4': 1, '5': 9, '10': 'ownerHandleName'},
{'1': 'owner_avatar', '3': 4, '4': 1, '5': 9, '10': 'ownerAvatar'},
{'1': 'main_tag_id', '3': 5, '4': 1, '5': 9, '10': 'mainTagId'},
{'1': 'sub_tag_id', '3': 6, '4': 1, '5': 9, '10': 'subTagId'},
{'1': 'created_at', '3': 7, '4': 1, '5': 3, '10': 'createdAt'},
{'1': 'owner_last_active', '3': 8, '4': 1, '5': 3, '10': 'ownerLastActive'},
{'1': 'current_members', '3': 9, '4': 1, '5': 5, '10': 'currentMembers'},
{'1': 'target_members', '3': 10, '4': 1, '5': 5, '10': 'targetMembers'},
{'1': 'has_password', '3': 11, '4': 1, '5': 8, '10': 'hasPassword'},
{'1': 'social_links', '3': 12, '4': 3, '5': 9, '10': 'socialLinks'},
],
};
/// Descriptor for `RoomListItem`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List roomListItemDescriptor = $convert.base64Decode(
'CgxSb29tTGlzdEl0ZW0SGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZBIiCg1vd25lcl9nYW'
'1lX2lkGAIgASgJUgtvd25lckdhbWVJZBIqChFvd25lcl9oYW5kbGVfbmFtZRgDIAEoCVIPb3du'
'ZXJIYW5kbGVOYW1lEiEKDG93bmVyX2F2YXRhchgEIAEoCVILb3duZXJBdmF0YXISHgoLbWFpbl'
'90YWdfaWQYBSABKAlSCW1haW5UYWdJZBIcCgpzdWJfdGFnX2lkGAYgASgJUghzdWJUYWdJZBId'
'CgpjcmVhdGVkX2F0GAcgASgDUgljcmVhdGVkQXQSKgoRb3duZXJfbGFzdF9hY3RpdmUYCCABKA'
'NSD293bmVyTGFzdEFjdGl2ZRInCg9jdXJyZW50X21lbWJlcnMYCSABKAVSDmN1cnJlbnRNZW1i'
'ZXJzEiUKDnRhcmdldF9tZW1iZXJzGAogASgFUg10YXJnZXRNZW1iZXJzEiEKDGhhc19wYXNzd2'
'9yZBgLIAEoCFILaGFzUGFzc3dvcmQSIQoMc29jaWFsX2xpbmtzGAwgAygJUgtzb2NpYWxMaW5r'
'cw==');
@$core.Deprecated('Use getRoomListRequestDescriptor instead')
const GetRoomListRequest$json = {
'1': 'GetRoomListRequest',
'2': [
{'1': 'main_tag_id', '3': 1, '4': 1, '5': 9, '10': 'mainTagId'},
{'1': 'sub_tag_id', '3': 2, '4': 1, '5': 9, '10': 'subTagId'},
{'1': 'search_owner_name', '3': 3, '4': 1, '5': 9, '10': 'searchOwnerName'},
{'1': 'page', '3': 4, '4': 1, '5': 5, '10': 'page'},
{'1': 'page_size', '3': 5, '4': 1, '5': 5, '10': 'pageSize'},
],
};
/// Descriptor for `GetRoomListRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getRoomListRequestDescriptor = $convert.base64Decode(
'ChJHZXRSb29tTGlzdFJlcXVlc3QSHgoLbWFpbl90YWdfaWQYASABKAlSCW1haW5UYWdJZBIcCg'
'pzdWJfdGFnX2lkGAIgASgJUghzdWJUYWdJZBIqChFzZWFyY2hfb3duZXJfbmFtZRgDIAEoCVIP'
'c2VhcmNoT3duZXJOYW1lEhIKBHBhZ2UYBCABKAVSBHBhZ2USGwoJcGFnZV9zaXplGAUgASgFUg'
'hwYWdlU2l6ZQ==');
@$core.Deprecated('Use getRoomListResponseDescriptor instead')
const GetRoomListResponse$json = {
'1': 'GetRoomListResponse',
'2': [
{
'1': 'rooms',
'3': 1,
'4': 3,
'5': 11,
'6': '.partroom.RoomListItem',
'10': 'rooms'
},
{'1': 'total', '3': 2, '4': 1, '5': 5, '10': 'total'},
{'1': 'page', '3': 3, '4': 1, '5': 5, '10': 'page'},
{'1': 'page_size', '3': 4, '4': 1, '5': 5, '10': 'pageSize'},
],
};
/// Descriptor for `GetRoomListResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getRoomListResponseDescriptor = $convert.base64Decode(
'ChNHZXRSb29tTGlzdFJlc3BvbnNlEiwKBXJvb21zGAEgAygLMhYucGFydHJvb20uUm9vbUxpc3'
'RJdGVtUgVyb29tcxIUCgV0b3RhbBgCIAEoBVIFdG90YWwSEgoEcGFnZRgDIAEoBVIEcGFnZRIb'
'CglwYWdlX3NpemUYBCABKAVSCHBhZ2VTaXpl');
@$core.Deprecated('Use createRoomRequestDescriptor instead')
const CreateRoomRequest$json = {
'1': 'CreateRoomRequest',
'2': [
{'1': 'main_tag_id', '3': 1, '4': 1, '5': 9, '10': 'mainTagId'},
{'1': 'sub_tag_id', '3': 2, '4': 1, '5': 9, '10': 'subTagId'},
{'1': 'target_members', '3': 3, '4': 1, '5': 5, '10': 'targetMembers'},
{'1': 'has_password', '3': 4, '4': 1, '5': 8, '10': 'hasPassword'},
{'1': 'password', '3': 5, '4': 1, '5': 9, '10': 'password'},
{'1': 'social_links', '3': 6, '4': 3, '5': 9, '10': 'socialLinks'},
],
};
/// Descriptor for `CreateRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List createRoomRequestDescriptor = $convert.base64Decode(
'ChFDcmVhdGVSb29tUmVxdWVzdBIeCgttYWluX3RhZ19pZBgBIAEoCVIJbWFpblRhZ0lkEhwKCn'
'N1Yl90YWdfaWQYAiABKAlSCHN1YlRhZ0lkEiUKDnRhcmdldF9tZW1iZXJzGAMgASgFUg10YXJn'
'ZXRNZW1iZXJzEiEKDGhhc19wYXNzd29yZBgEIAEoCFILaGFzUGFzc3dvcmQSGgoIcGFzc3dvcm'
'QYBSABKAlSCHBhc3N3b3JkEiEKDHNvY2lhbF9saW5rcxgGIAMoCVILc29jaWFsTGlua3M=');
@$core.Deprecated('Use createRoomResponseDescriptor instead')
const CreateRoomResponse$json = {
'1': 'CreateRoomResponse',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
],
};
/// Descriptor for `CreateRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List createRoomResponseDescriptor =
$convert.base64Decode(
'ChJDcmVhdGVSb29tUmVzcG9uc2USGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZA==');
@$core.Deprecated('Use joinRoomRequestDescriptor instead')
const JoinRoomRequest$json = {
'1': 'JoinRoomRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
],
};
/// Descriptor for `JoinRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List joinRoomRequestDescriptor = $convert.base64Decode(
'Cg9Kb2luUm9vbVJlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZBIaCghwYXNzd2'
'9yZBgCIAEoCVIIcGFzc3dvcmQ=');
@$core.Deprecated('Use joinRoomResponseDescriptor instead')
const JoinRoomResponse$json = {
'1': 'JoinRoomResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `JoinRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List joinRoomResponseDescriptor = $convert.base64Decode(
'ChBKb2luUm9vbVJlc3BvbnNlEhgKB3N1Y2Nlc3MYASABKAhSB3N1Y2Nlc3M=');
@$core.Deprecated('Use leaveRoomRequestDescriptor instead')
const LeaveRoomRequest$json = {
'1': 'LeaveRoomRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
],
};
/// Descriptor for `LeaveRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List leaveRoomRequestDescriptor = $convert.base64Decode(
'ChBMZWF2ZVJvb21SZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aWQ=');
@$core.Deprecated('Use leaveRoomResponseDescriptor instead')
const LeaveRoomResponse$json = {
'1': 'LeaveRoomResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `LeaveRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List leaveRoomResponseDescriptor = $convert.base64Decode(
'ChFMZWF2ZVJvb21SZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');
@$core.Deprecated('Use dismissRoomRequestDescriptor instead')
const DismissRoomRequest$json = {
'1': 'DismissRoomRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
],
};
/// Descriptor for `DismissRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List dismissRoomRequestDescriptor =
$convert.base64Decode(
'ChJEaXNtaXNzUm9vbVJlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZA==');
@$core.Deprecated('Use dismissRoomResponseDescriptor instead')
const DismissRoomResponse$json = {
'1': 'DismissRoomResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `DismissRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List dismissRoomResponseDescriptor =
$convert.base64Decode(
'ChNEaXNtaXNzUm9vbVJlc3BvbnNlEhgKB3N1Y2Nlc3MYASABKAhSB3N1Y2Nlc3M=');
@$core.Deprecated('Use memberStatusDescriptor instead')
const MemberStatus$json = {
'1': 'MemberStatus',
'2': [
{'1': 'current_location', '3': 1, '4': 1, '5': 9, '10': 'currentLocation'},
{'1': 'kills', '3': 2, '4': 1, '5': 5, '10': 'kills'},
{'1': 'deaths', '3': 3, '4': 1, '5': 5, '10': 'deaths'},
{'1': 'play_time', '3': 4, '4': 1, '5': 3, '10': 'playTime'},
],
};
/// Descriptor for `MemberStatus`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List memberStatusDescriptor = $convert.base64Decode(
'CgxNZW1iZXJTdGF0dXMSKQoQY3VycmVudF9sb2NhdGlvbhgBIAEoCVIPY3VycmVudExvY2F0aW'
'9uEhQKBWtpbGxzGAIgASgFUgVraWxscxIWCgZkZWF0aHMYAyABKAVSBmRlYXRocxIbCglwbGF5'
'X3RpbWUYBCABKANSCHBsYXlUaW1l');
@$core.Deprecated('Use roomMemberDescriptor instead')
const RoomMember$json = {
'1': 'RoomMember',
'2': [
{'1': 'game_user_id', '3': 1, '4': 1, '5': 9, '10': 'gameUserId'},
{'1': 'handle_name', '3': 2, '4': 1, '5': 9, '10': 'handleName'},
{'1': 'avatar_url', '3': 3, '4': 1, '5': 9, '10': 'avatarUrl'},
{'1': 'joined_at', '3': 4, '4': 1, '5': 3, '10': 'joinedAt'},
{'1': 'last_active', '3': 5, '4': 1, '5': 3, '10': 'lastActive'},
{'1': 'is_owner', '3': 6, '4': 1, '5': 8, '10': 'isOwner'},
{
'1': 'status',
'3': 7,
'4': 1,
'5': 11,
'6': '.partroom.MemberStatus',
'10': 'status'
},
],
};
/// Descriptor for `RoomMember`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List roomMemberDescriptor = $convert.base64Decode(
'CgpSb29tTWVtYmVyEiAKDGdhbWVfdXNlcl9pZBgBIAEoCVIKZ2FtZVVzZXJJZBIfCgtoYW5kbG'
'VfbmFtZRgCIAEoCVIKaGFuZGxlTmFtZRIdCgphdmF0YXJfdXJsGAMgASgJUglhdmF0YXJVcmwS'
'GwoJam9pbmVkX2F0GAQgASgDUghqb2luZWRBdBIfCgtsYXN0X2FjdGl2ZRgFIAEoA1IKbGFzdE'
'FjdGl2ZRIZCghpc19vd25lchgGIAEoCFIHaXNPd25lchIuCgZzdGF0dXMYByABKAsyFi5wYXJ0'
'cm9vbS5NZW1iZXJTdGF0dXNSBnN0YXR1cw==');
@$core.Deprecated('Use roomInfoDescriptor instead')
const RoomInfo$json = {
'1': 'RoomInfo',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'owner_game_id', '3': 2, '4': 1, '5': 9, '10': 'ownerGameId'},
{'1': 'main_tag_id', '3': 3, '4': 1, '5': 9, '10': 'mainTagId'},
{'1': 'sub_tag_id', '3': 4, '4': 1, '5': 9, '10': 'subTagId'},
{'1': 'target_members', '3': 5, '4': 1, '5': 5, '10': 'targetMembers'},
{'1': 'has_password', '3': 6, '4': 1, '5': 8, '10': 'hasPassword'},
{'1': 'created_at', '3': 7, '4': 1, '5': 3, '10': 'createdAt'},
{'1': 'current_members', '3': 8, '4': 1, '5': 5, '10': 'currentMembers'},
{'1': 'social_links', '3': 9, '4': 3, '5': 9, '10': 'socialLinks'},
],
};
/// Descriptor for `RoomInfo`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List roomInfoDescriptor = $convert.base64Decode(
'CghSb29tSW5mbxIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEiIKDW93bmVyX2dhbWVfaW'
'QYAiABKAlSC293bmVyR2FtZUlkEh4KC21haW5fdGFnX2lkGAMgASgJUgltYWluVGFnSWQSHAoK'
'c3ViX3RhZ19pZBgEIAEoCVIIc3ViVGFnSWQSJQoOdGFyZ2V0X21lbWJlcnMYBSABKAVSDXRhcm'
'dldE1lbWJlcnMSIQoMaGFzX3Bhc3N3b3JkGAYgASgIUgtoYXNQYXNzd29yZBIdCgpjcmVhdGVk'
'X2F0GAcgASgDUgljcmVhdGVkQXQSJwoPY3VycmVudF9tZW1iZXJzGAggASgFUg5jdXJyZW50TW'
'VtYmVycxIhCgxzb2NpYWxfbGlua3MYCSADKAlSC3NvY2lhbExpbmtz');
@$core.Deprecated('Use getRoomInfoRequestDescriptor instead')
const GetRoomInfoRequest$json = {
'1': 'GetRoomInfoRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
],
};
/// Descriptor for `GetRoomInfoRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getRoomInfoRequestDescriptor =
$convert.base64Decode(
'ChJHZXRSb29tSW5mb1JlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZA==');
@$core.Deprecated('Use getRoomInfoResponseDescriptor instead')
const GetRoomInfoResponse$json = {
'1': 'GetRoomInfoResponse',
'2': [
{
'1': 'room',
'3': 1,
'4': 1,
'5': 11,
'6': '.partroom.RoomInfo',
'10': 'room'
},
],
};
/// Descriptor for `GetRoomInfoResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getRoomInfoResponseDescriptor = $convert.base64Decode(
'ChNHZXRSb29tSW5mb1Jlc3BvbnNlEiYKBHJvb20YASABKAsyEi5wYXJ0cm9vbS5Sb29tSW5mb1'
'IEcm9vbQ==');
@$core.Deprecated('Use getRoomMembersRequestDescriptor instead')
const GetRoomMembersRequest$json = {
'1': 'GetRoomMembersRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'page', '3': 2, '4': 1, '5': 5, '10': 'page'},
{'1': 'page_size', '3': 3, '4': 1, '5': 5, '10': 'pageSize'},
],
};
/// Descriptor for `GetRoomMembersRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getRoomMembersRequestDescriptor = $convert.base64Decode(
'ChVHZXRSb29tTWVtYmVyc1JlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZBISCg'
'RwYWdlGAIgASgFUgRwYWdlEhsKCXBhZ2Vfc2l6ZRgDIAEoBVIIcGFnZVNpemU=');
@$core.Deprecated('Use getRoomMembersResponseDescriptor instead')
const GetRoomMembersResponse$json = {
'1': 'GetRoomMembersResponse',
'2': [
{
'1': 'members',
'3': 1,
'4': 3,
'5': 11,
'6': '.partroom.RoomMember',
'10': 'members'
},
{'1': 'total', '3': 2, '4': 1, '5': 5, '10': 'total'},
],
};
/// Descriptor for `GetRoomMembersResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getRoomMembersResponseDescriptor =
$convert.base64Decode(
'ChZHZXRSb29tTWVtYmVyc1Jlc3BvbnNlEi4KB21lbWJlcnMYASADKAsyFC5wYXJ0cm9vbS5Sb2'
'9tTWVtYmVyUgdtZW1iZXJzEhQKBXRvdGFsGAIgASgFUgV0b3RhbA==');
@$core.Deprecated('Use heartbeatRequestDescriptor instead')
const HeartbeatRequest$json = {
'1': 'HeartbeatRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
],
};
/// Descriptor for `HeartbeatRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List heartbeatRequestDescriptor = $convert.base64Decode(
'ChBIZWFydGJlYXRSZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aWQ=');
@$core.Deprecated('Use heartbeatResponseDescriptor instead')
const HeartbeatResponse$json = {
'1': 'HeartbeatResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `HeartbeatResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List heartbeatResponseDescriptor = $convert.base64Decode(
'ChFIZWFydGJlYXRSZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');
@$core.Deprecated('Use getMyRoomRequestDescriptor instead')
const GetMyRoomRequest$json = {
'1': 'GetMyRoomRequest',
};
/// Descriptor for `GetMyRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getMyRoomRequestDescriptor =
$convert.base64Decode('ChBHZXRNeVJvb21SZXF1ZXN0');
@$core.Deprecated('Use getMyRoomResponseDescriptor instead')
const GetMyRoomResponse$json = {
'1': 'GetMyRoomResponse',
'2': [
{
'1': 'room',
'3': 1,
'4': 1,
'5': 11,
'6': '.partroom.RoomInfo',
'10': 'room'
},
{'1': 'has_room', '3': 2, '4': 1, '5': 8, '10': 'hasRoom'},
],
};
/// Descriptor for `GetMyRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getMyRoomResponseDescriptor = $convert.base64Decode(
'ChFHZXRNeVJvb21SZXNwb25zZRImCgRyb29tGAEgASgLMhIucGFydHJvb20uUm9vbUluZm9SBH'
'Jvb20SGQoIaGFzX3Jvb20YAiABKAhSB2hhc1Jvb20=');
@$core.Deprecated('Use updateRoomRequestDescriptor instead')
const UpdateRoomRequest$json = {
'1': 'UpdateRoomRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'target_members', '3': 2, '4': 1, '5': 5, '10': 'targetMembers'},
{'1': 'password', '3': 3, '4': 1, '5': 9, '10': 'password'},
{'1': 'main_tag_id', '3': 4, '4': 1, '5': 9, '10': 'mainTagId'},
{'1': 'sub_tag_id', '3': 5, '4': 1, '5': 9, '10': 'subTagId'},
{'1': 'social_links', '3': 6, '4': 3, '5': 9, '10': 'socialLinks'},
],
};
/// Descriptor for `UpdateRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List updateRoomRequestDescriptor = $convert.base64Decode(
'ChFVcGRhdGVSb29tUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEiUKDnRhcm'
'dldF9tZW1iZXJzGAIgASgFUg10YXJnZXRNZW1iZXJzEhoKCHBhc3N3b3JkGAMgASgJUghwYXNz'
'd29yZBIeCgttYWluX3RhZ19pZBgEIAEoCVIJbWFpblRhZ0lkEhwKCnN1Yl90YWdfaWQYBSABKA'
'lSCHN1YlRhZ0lkEiEKDHNvY2lhbF9saW5rcxgGIAMoCVILc29jaWFsTGlua3M=');
@$core.Deprecated('Use updateRoomResponseDescriptor instead')
const UpdateRoomResponse$json = {
'1': 'UpdateRoomResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `UpdateRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List updateRoomResponseDescriptor =
$convert.base64Decode(
'ChJVcGRhdGVSb29tUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');
@$core.Deprecated('Use kickMemberRequestDescriptor instead')
const KickMemberRequest$json = {
'1': 'KickMemberRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{
'1': 'target_game_user_id',
'3': 2,
'4': 1,
'5': 9,
'10': 'targetGameUserId'
},
],
};
/// Descriptor for `KickMemberRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List kickMemberRequestDescriptor = $convert.base64Decode(
'ChFLaWNrTWVtYmVyUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEi0KE3Rhcm'
'dldF9nYW1lX3VzZXJfaWQYAiABKAlSEHRhcmdldEdhbWVVc2VySWQ=');
@$core.Deprecated('Use kickMemberResponseDescriptor instead')
const KickMemberResponse$json = {
'1': 'KickMemberResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `KickMemberResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List kickMemberResponseDescriptor =
$convert.base64Decode(
'ChJLaWNrTWVtYmVyUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');
@$core.Deprecated('Use setStatusRequestDescriptor instead')
const SetStatusRequest$json = {
'1': 'SetStatusRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{
'1': 'status',
'3': 2,
'4': 1,
'5': 11,
'6': '.partroom.MemberStatus',
'10': 'status'
},
],
};
/// Descriptor for `SetStatusRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List setStatusRequestDescriptor = $convert.base64Decode(
'ChBTZXRTdGF0dXNSZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aWQSLgoGc3RhdH'
'VzGAIgASgLMhYucGFydHJvb20uTWVtYmVyU3RhdHVzUgZzdGF0dXM=');
@$core.Deprecated('Use setStatusResponseDescriptor instead')
const SetStatusResponse$json = {
'1': 'SetStatusResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `SetStatusResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List setStatusResponseDescriptor = $convert.base64Decode(
'ChFTZXRTdGF0dXNSZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');
@$core.Deprecated('Use sendSignalRequestDescriptor instead')
const SendSignalRequest$json = {
'1': 'SendSignalRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'signal_id', '3': 2, '4': 1, '5': 9, '10': 'signalId'},
{
'1': 'params',
'3': 3,
'4': 3,
'5': 11,
'6': '.partroom.SendSignalRequest.ParamsEntry',
'10': 'params'
},
],
'3': [SendSignalRequest_ParamsEntry$json],
};
@$core.Deprecated('Use sendSignalRequestDescriptor instead')
const SendSignalRequest_ParamsEntry$json = {
'1': 'ParamsEntry',
'2': [
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
],
'7': {'7': true},
};
/// Descriptor for `SendSignalRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List sendSignalRequestDescriptor = $convert.base64Decode(
'ChFTZW5kU2lnbmFsUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEhsKCXNpZ2'
'5hbF9pZBgCIAEoCVIIc2lnbmFsSWQSPwoGcGFyYW1zGAMgAygLMicucGFydHJvb20uU2VuZFNp'
'Z25hbFJlcXVlc3QuUGFyYW1zRW50cnlSBnBhcmFtcxo5CgtQYXJhbXNFbnRyeRIQCgNrZXkYAS'
'ABKAlSA2tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB');
@$core.Deprecated('Use sendSignalResponseDescriptor instead')
const SendSignalResponse$json = {
'1': 'SendSignalResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `SendSignalResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List sendSignalResponseDescriptor =
$convert.base64Decode(
'ChJTZW5kU2lnbmFsUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');
@$core.Deprecated('Use roomEventDescriptor instead')
const RoomEvent$json = {
'1': 'RoomEvent',
'2': [
{
'1': 'type',
'3': 1,
'4': 1,
'5': 14,
'6': '.partroom.RoomEventType',
'10': 'type'
},
{'1': 'room_uuid', '3': 2, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'timestamp', '3': 3, '4': 1, '5': 3, '10': 'timestamp'},
{
'1': 'member',
'3': 4,
'4': 1,
'5': 11,
'6': '.partroom.RoomMember',
'10': 'member'
},
{'1': 'signal_id', '3': 5, '4': 1, '5': 9, '10': 'signalId'},
{'1': 'signal_sender', '3': 6, '4': 1, '5': 9, '10': 'signalSender'},
{
'1': 'signal_params',
'3': 7,
'4': 3,
'5': 11,
'6': '.partroom.RoomEvent.SignalParamsEntry',
'10': 'signalParams'
},
{
'1': 'room_info',
'3': 8,
'4': 1,
'5': 11,
'6': '.partroom.RoomInfo',
'10': 'roomInfo'
},
],
'3': [RoomEvent_SignalParamsEntry$json],
};
@$core.Deprecated('Use roomEventDescriptor instead')
const RoomEvent_SignalParamsEntry$json = {
'1': 'SignalParamsEntry',
'2': [
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
],
'7': {'7': true},
};
/// Descriptor for `RoomEvent`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List roomEventDescriptor = $convert.base64Decode(
'CglSb29tRXZlbnQSKwoEdHlwZRgBIAEoDjIXLnBhcnRyb29tLlJvb21FdmVudFR5cGVSBHR5cG'
'USGwoJcm9vbV91dWlkGAIgASgJUghyb29tVXVpZBIcCgl0aW1lc3RhbXAYAyABKANSCXRpbWVz'
'dGFtcBIsCgZtZW1iZXIYBCABKAsyFC5wYXJ0cm9vbS5Sb29tTWVtYmVyUgZtZW1iZXISGwoJc2'
'lnbmFsX2lkGAUgASgJUghzaWduYWxJZBIjCg1zaWduYWxfc2VuZGVyGAYgASgJUgxzaWduYWxT'
'ZW5kZXISSgoNc2lnbmFsX3BhcmFtcxgHIAMoCzIlLnBhcnRyb29tLlJvb21FdmVudC5TaWduYW'
'xQYXJhbXNFbnRyeVIMc2lnbmFsUGFyYW1zEi8KCXJvb21faW5mbxgIIAEoCzISLnBhcnRyb29t'
'LlJvb21JbmZvUghyb29tSW5mbxo/ChFTaWduYWxQYXJhbXNFbnRyeRIQCgNrZXkYASABKAlSA2'
'tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB');
@$core.Deprecated('Use listenRoomEventsRequestDescriptor instead')
const ListenRoomEventsRequest$json = {
'1': 'ListenRoomEventsRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
],
};
/// Descriptor for `ListenRoomEventsRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List listenRoomEventsRequestDescriptor =
$convert.base64Decode(
'ChdMaXN0ZW5Sb29tRXZlbnRzUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlk');
@$core.Deprecated('Use transferOwnershipRequestDescriptor instead')
const TransferOwnershipRequest$json = {
'1': 'TransferOwnershipRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{
'1': 'target_game_user_id',
'3': 2,
'4': 1,
'5': 9,
'10': 'targetGameUserId'
},
],
};
/// Descriptor for `TransferOwnershipRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List transferOwnershipRequestDescriptor =
$convert.base64Decode(
'ChhUcmFuc2Zlck93bmVyc2hpcFJlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZB'
'ItChN0YXJnZXRfZ2FtZV91c2VyX2lkGAIgASgJUhB0YXJnZXRHYW1lVXNlcklk');
@$core.Deprecated('Use transferOwnershipResponseDescriptor instead')
const TransferOwnershipResponse$json = {
'1': 'TransferOwnershipResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `TransferOwnershipResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List transferOwnershipResponseDescriptor =
$convert.base64Decode(
'ChlUcmFuc2Zlck93bmVyc2hpcFJlc3BvbnNlEhgKB3N1Y2Nlc3MYASABKAhSB3N1Y2Nlc3M=');
@$core.Deprecated('Use kickedMemberDescriptor instead')
const KickedMember$json = {
'1': 'KickedMember',
'2': [
{'1': 'game_user_id', '3': 1, '4': 1, '5': 9, '10': 'gameUserId'},
{'1': 'handle_name', '3': 2, '4': 1, '5': 9, '10': 'handleName'},
{'1': 'avatar_url', '3': 3, '4': 1, '5': 9, '10': 'avatarUrl'},
{'1': 'joined_at', '3': 4, '4': 1, '5': 3, '10': 'joinedAt'},
{'1': 'kicked_at', '3': 5, '4': 1, '5': 3, '10': 'kickedAt'},
],
};
/// Descriptor for `KickedMember`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List kickedMemberDescriptor = $convert.base64Decode(
'CgxLaWNrZWRNZW1iZXISIAoMZ2FtZV91c2VyX2lkGAEgASgJUgpnYW1lVXNlcklkEh8KC2hhbm'
'RsZV9uYW1lGAIgASgJUgpoYW5kbGVOYW1lEh0KCmF2YXRhcl91cmwYAyABKAlSCWF2YXRhclVy'
'bBIbCglqb2luZWRfYXQYBCABKANSCGpvaW5lZEF0EhsKCWtpY2tlZF9hdBgFIAEoA1IIa2lja2'
'VkQXQ=');
@$core.Deprecated('Use getKickedMembersRequestDescriptor instead')
const GetKickedMembersRequest$json = {
'1': 'GetKickedMembersRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'page', '3': 2, '4': 1, '5': 5, '10': 'page'},
{'1': 'page_size', '3': 3, '4': 1, '5': 5, '10': 'pageSize'},
],
};
/// Descriptor for `GetKickedMembersRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getKickedMembersRequestDescriptor =
$convert.base64Decode(
'ChdHZXRLaWNrZWRNZW1iZXJzUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEh'
'IKBHBhZ2UYAiABKAVSBHBhZ2USGwoJcGFnZV9zaXplGAMgASgFUghwYWdlU2l6ZQ==');
@$core.Deprecated('Use getKickedMembersResponseDescriptor instead')
const GetKickedMembersResponse$json = {
'1': 'GetKickedMembersResponse',
'2': [
{
'1': 'members',
'3': 1,
'4': 3,
'5': 11,
'6': '.partroom.KickedMember',
'10': 'members'
},
{'1': 'total', '3': 2, '4': 1, '5': 5, '10': 'total'},
],
};
/// Descriptor for `GetKickedMembersResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getKickedMembersResponseDescriptor =
$convert.base64Decode(
'ChhHZXRLaWNrZWRNZW1iZXJzUmVzcG9uc2USMAoHbWVtYmVycxgBIAMoCzIWLnBhcnRyb29tLk'
'tpY2tlZE1lbWJlclIHbWVtYmVycxIUCgV0b3RhbBgCIAEoBVIFdG90YWw=');
@$core.Deprecated('Use removeKickedMemberRequestDescriptor instead')
const RemoveKickedMemberRequest$json = {
'1': 'RemoveKickedMemberRequest',
'2': [
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
{'1': 'game_user_id', '3': 2, '4': 1, '5': 9, '10': 'gameUserId'},
],
};
/// Descriptor for `RemoveKickedMemberRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List removeKickedMemberRequestDescriptor =
$convert.base64Decode(
'ChlSZW1vdmVLaWNrZWRNZW1iZXJSZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aW'
'QSIAoMZ2FtZV91c2VyX2lkGAIgASgJUgpnYW1lVXNlcklk');
@$core.Deprecated('Use removeKickedMemberResponseDescriptor instead')
const RemoveKickedMemberResponse$json = {
'1': 'RemoveKickedMemberResponse',
'2': [
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
],
};
/// Descriptor for `RemoveKickedMemberResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List removeKickedMemberResponseDescriptor =
$convert.base64Decode(
'ChpSZW1vdmVLaWNrZWRNZW1iZXJSZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');

View File

@ -0,0 +1,889 @@
import 'dart:async';
import 'package:fixnum/fixnum.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:grpc/grpc.dart';
import 'package:hive_ce/hive.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
import 'package:starcitizen_doctor/common/utils/provider.dart';
import 'package:starcitizen_doctor/common/utils/log.dart';
import 'package:starcitizen_doctor/generated/proto/auth/auth.pbgrpc.dart' as auth;
import 'package:starcitizen_doctor/generated/proto/partroom/partroom.pbgrpc.dart' as partroom;
import 'package:starcitizen_doctor/generated/proto/common/common.pbgrpc.dart' as common;
part 'party_room.freezed.dart';
part 'party_room.g.dart';
/// PartyRoom
@freezed
sealed class PartyRoomAuthState with _$PartyRoomAuthState {
const factory PartyRoomAuthState({
@Default('') String uuid,
@Default('') String secretKey,
@Default(false) bool isLoggedIn,
auth.GameUserInfo? userInfo,
DateTime? lastLoginTime,
}) = _PartyRoomAuthState;
}
/// PartyRoom
@freezed
sealed class PartyRoomState with _$PartyRoomState {
const factory PartyRoomState({
partroom.RoomInfo? currentRoom,
@Default([]) List<partroom.RoomMember> members,
@Default([]) List<common.Tag> tags,
@Default([]) List<common.SignalType> signalTypes,
@Default(false) bool isInRoom,
@Default(false) bool isOwner,
String? roomUuid,
@Default([]) List<partroom.RoomEvent> recentEvents,
}) = _PartyRoomState;
}
/// PartyRoom gRPC
@freezed
sealed class PartyRoomClientState with _$PartyRoomClientState {
const factory PartyRoomClientState({
ClientChannel? channel,
auth.AuthServiceClient? authClient,
partroom.PartRoomServiceClient? roomClient,
common.CommonServiceClient? commonClient,
@Default(false) bool isConnected,
@Default('') String serverAddress,
@Default(0) int serverPort,
}) = _PartyRoomClientState;
}
/// PartyRoom
@freezed
sealed class PartyRoomFullState with _$PartyRoomFullState {
const factory PartyRoomFullState({
required PartyRoomAuthState auth,
required PartyRoomState room,
required PartyRoomClientState client,
}) = _PartyRoomFullState;
}
/// PartyRoom Provider
@riverpod
class PartyRoom extends _$PartyRoom {
static const String _boxName = 'party_room_conf';
static const String _secretKeyKey = 'party_room_secret_key';
Box? _confBox;
StreamSubscription<partroom.RoomEvent>? _eventStreamSubscription;
Timer? _heartbeatTimer;
bool _disposed = false;
@override
PartyRoomFullState build() {
ref.onDispose(() {
_disposed = true;
_cleanup();
});
state = const PartyRoomFullState(
auth: PartyRoomAuthState(),
room: PartyRoomState(),
client: PartyRoomClientState(),
);
//
_initialize();
ref.keepAlive();
return state;
}
///
Future<void> _initialize() async {
try {
_confBox = await Hive.openBox(_boxName);
//
final uuid = appGlobalState.deviceUUID;
if (uuid?.isEmpty ?? true) {
throw Exception('Device UUID is not available');
}
final secretKey = _confBox?.get(_secretKeyKey, defaultValue: '');
state = state.copyWith(
auth: state.auth.copyWith(uuid: uuid!, secretKey: secretKey),
);
dPrint('[PartyRoom] Initialized with UUID: ${state.auth.uuid}');
} catch (e) {
dPrint('[PartyRoom] Initialize error: $e');
}
}
///
Future<void> connect() async {
try {
//
await disconnect();
final serverAddress = URLConf.partyRoomServerAddress;
final serverPort = URLConf.partyRoomServerPort;
final channel = ClientChannel(
serverAddress,
port: serverPort,
options: const ChannelOptions(credentials: ChannelCredentials.insecure()),
);
final authClient = auth.AuthServiceClient(channel);
final roomClient = partroom.PartRoomServiceClient(channel);
final commonClient = common.CommonServiceClient(channel);
//
await authClient.status(auth.StatusRequest());
state = state.copyWith(
client: state.client.copyWith(
channel: channel,
authClient: authClient,
roomClient: roomClient,
commonClient: commonClient,
isConnected: true,
serverAddress: serverAddress,
serverPort: serverPort,
),
);
dPrint('[PartyRoom] Connected to $serverAddress:$serverPort');
} catch (e) {
dPrint('[PartyRoom] Connect error: $e');
rethrow;
}
}
///
Future<void> disconnect() async {
await _stopHeartbeat();
await _stopEventStream();
await state.client.channel?.shutdown();
state = state.copyWith(client: const PartyRoomClientState());
dPrint('[PartyRoom] Disconnected');
}
/// CallOptions
CallOptions _getAuthCallOptions() {
return CallOptions(metadata: {'uuid': state.auth.uuid, 'secret-key': state.auth.secretKey});
}
// ========== ==========
///
Future<void> login() async {
try {
final client = state.client.authClient;
if (client == null) throw Exception('Not connected to server');
final response = await client.login(auth.LoginRequest(), options: _getAuthCallOptions());
state = state.copyWith(
auth: state.auth.copyWith(
isLoggedIn: true,
userInfo: response.userInfo,
lastLoginTime: DateTime.fromMillisecondsSinceEpoch(response.lastLoginTime.toInt()),
),
);
dPrint('[PartyRoom] Logged in as ${response.userInfo.gameUserId}');
//
await _checkMyRoom();
} catch (e) {
dPrint('[PartyRoom] Login error: $e');
rethrow;
}
}
///
Future<auth.PreRegisterResponse> preRegister(String gameUserId) async {
try {
final client = state.client.authClient;
if (client == null) throw Exception('Not connected to server');
final response = await client.preRegister(auth.PreRegisterRequest(uuid: state.auth.uuid, gameUserId: gameUserId));
dPrint('[PartyRoom] PreRegister verification code: ${response.verificationCode}');
return response;
} catch (e) {
dPrint('[PartyRoom] PreRegister error: $e');
rethrow;
}
}
///
Future<void> register(String gameUserId) async {
try {
final client = state.client.authClient;
if (client == null) throw Exception('Not connected to server');
final response = await client.register(auth.RegisterRequest(uuid: state.auth.uuid, gameUserId: gameUserId));
// secretKey
await _confBox?.put(_secretKeyKey, response.partyRoomSecretKey);
state = state.copyWith(
auth: state.auth.copyWith(secretKey: response.partyRoomSecretKey, userInfo: response.userInfo),
);
dPrint('[PartyRoom] Registered successfully');
} catch (e) {
dPrint('[PartyRoom] Register error: $e');
rethrow;
}
}
///
Future<void> unregister() async {
try {
final client = state.client.authClient;
if (client == null) throw Exception('Not connected to server');
await client.unregister(auth.UnregisterRequest(), options: _getAuthCallOptions());
//
await _confBox?.delete(_secretKeyKey);
state = state.copyWith(
auth: state.auth.copyWith(secretKey: '', isLoggedIn: false, userInfo: null),
room: const PartyRoomState(),
);
dPrint('[PartyRoom] Unregistered successfully');
} catch (e) {
dPrint('[PartyRoom] Unregister error: $e');
rethrow;
}
}
// ========== ==========
///
Future<void> loadTags() async {
try {
final roomClient = state.client.roomClient;
final commonClient = state.client.commonClient;
if (roomClient == null || commonClient == null) throw Exception('Not connected to server');
final response = await commonClient.getTags(common.GetTagsRequest());
final signalTypesResponse = await commonClient.getSignalTypes(common.GetSignalTypesRequest());
state = state.copyWith(
room: state.room.copyWith(tags: response.tags, signalTypes: signalTypesResponse.signals),
);
dPrint(
'[PartyRoom] Tags and SignalTypes loaded: ${response.tags.length} tags, ${signalTypesResponse.signals.length} signal types',
);
} catch (e) {
dPrint('[PartyRoom] LoadTags error: $e');
rethrow;
}
}
///
Future<partroom.GetRoomListResponse> getRoomList({
String? mainTagId,
String? subTagId,
String? searchOwnerName,
int page = 1,
int pageSize = 20,
}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final response = await client.getRoomList(
partroom.GetRoomListRequest(
mainTagId: mainTagId ?? '',
subTagId: subTagId ?? '',
searchOwnerName: searchOwnerName ?? '',
page: page,
pageSize: pageSize,
),
);
return response;
} catch (e) {
dPrint('[PartyRoom] GetRoomList error: $e');
rethrow;
}
}
///
Future<void> createRoom({
required String mainTagId,
String? subTagId,
required int targetMembers,
bool hasPassword = false,
String? password,
List<String>? socialLinks,
}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final response = await client.createRoom(
partroom.CreateRoomRequest(
mainTagId: mainTagId,
subTagId: subTagId ?? '',
targetMembers: targetMembers,
hasPassword: hasPassword,
password_5: password ?? '',
socialLinks: socialLinks ?? [],
),
options: _getAuthCallOptions(),
);
state = state.copyWith(room: state.room.copyWith(roomUuid: response.roomUuid, isInRoom: true, isOwner: true));
dPrint('[PartyRoom] Room created: ${response.roomUuid}');
//
await getRoomInfo(response.roomUuid);
//
await _startHeartbeat(response.roomUuid);
await _startEventStream(response.roomUuid);
} catch (e) {
dPrint('[PartyRoom] CreateRoom error: $e');
rethrow;
}
}
///
Future<void> joinRoom(String roomUuid, {String? password}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
await client.joinRoom(
partroom.JoinRoomRequest(roomUuid: roomUuid, password: password ?? ''),
options: _getAuthCallOptions(),
);
state = state.copyWith(room: state.room.copyWith(roomUuid: roomUuid, isInRoom: true, isOwner: false));
dPrint('[PartyRoom] Joined room: $roomUuid');
//
await getRoomInfo(roomUuid);
//
await _startHeartbeat(roomUuid);
await _startEventStream(roomUuid);
} catch (e) {
dPrint('[PartyRoom] JoinRoom error: $e');
rethrow;
}
}
///
Future<void> leaveRoom() async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
await client.leaveRoom(partroom.LeaveRoomRequest(roomUuid: roomUuid), options: _getAuthCallOptions());
await _stopHeartbeat();
await _stopEventStream();
state = state.copyWith(room: const PartyRoomState());
dPrint('[PartyRoom] Left room: $roomUuid');
} catch (e) {
dPrint('[PartyRoom] LeaveRoom error: $e');
rethrow;
}
}
///
Future<void> dismissRoom() async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
await client.dismissRoom(partroom.DismissRoomRequest(roomUuid: roomUuid), options: _getAuthCallOptions());
await _stopHeartbeat();
await _stopEventStream();
state = state.copyWith(room: const PartyRoomState());
dPrint('[PartyRoom] Dismissed room: $roomUuid');
} catch (e) {
dPrint('[PartyRoom] DismissRoom error: $e');
rethrow;
}
}
///
Future<void> getRoomInfo(String roomUuid) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final response = await client.getRoomInfo(
partroom.GetRoomInfoRequest(roomUuid: roomUuid),
options: _getAuthCallOptions(),
);
//
final isOwner = response.room.ownerGameId == state.auth.userInfo?.gameUserId;
state = state.copyWith(
room: state.room.copyWith(currentRoom: response.room, isOwner: isOwner),
);
//
await getRoomMembers(roomUuid);
dPrint('[PartyRoom] Room info loaded');
} catch (e) {
dPrint('[PartyRoom] GetRoomInfo error: $e');
rethrow;
}
}
///
Future<void> getRoomMembers(String roomUuid, {int page = 1, int pageSize = 100}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final response = await client.getRoomMembers(
partroom.GetRoomMembersRequest(roomUuid: roomUuid, page: page, pageSize: pageSize),
options: _getAuthCallOptions(),
);
state = state.copyWith(room: state.room.copyWith(members: response.members));
dPrint('[PartyRoom] Loaded ${response.members.length} members');
} catch (e) {
dPrint('[PartyRoom] GetRoomMembers error: $e');
rethrow;
}
}
///
Future<void> _checkMyRoom() async {
try {
final client = state.client.roomClient;
if (client == null) return;
final response = await client.getMyRoom(partroom.GetMyRoomRequest(), options: _getAuthCallOptions());
if (response.hasRoom() && response.room.roomUuid.isNotEmpty) {
final isOwner = response.room.ownerGameId == state.auth.userInfo?.gameUserId;
state = state.copyWith(
room: state.room.copyWith(
currentRoom: response.room,
roomUuid: response.room.roomUuid,
isInRoom: true,
isOwner: isOwner,
),
);
dPrint('[PartyRoom] Rejoined room: ${response.room.roomUuid}');
//
await _startHeartbeat(response.room.roomUuid);
await _startEventStream(response.room.roomUuid);
await getRoomMembers(response.room.roomUuid);
}
} catch (e) {
dPrint('[PartyRoom] CheckMyRoom error: $e');
}
}
///
Future<void> updateRoom({
int? targetMembers,
String? password,
String? mainTagId,
String? subTagId,
List<String>? socialLinks,
}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
final request = partroom.UpdateRoomRequest(
roomUuid: roomUuid,
targetMembers: targetMembers ?? state.room.currentRoom?.targetMembers ?? 0,
mainTagId: mainTagId ?? state.room.currentRoom?.mainTagId ?? '',
subTagId: subTagId ?? state.room.currentRoom?.subTagId ?? '',
);
if (password != null) {
request.password = password;
}
if (socialLinks != null) {
request.socialLinks.addAll(socialLinks);
} else if (state.room.currentRoom?.socialLinks != null) {
request.socialLinks.addAll(state.room.currentRoom!.socialLinks);
}
await client.updateRoom(request, options: _getAuthCallOptions());
//
await getRoomInfo(roomUuid);
dPrint('[PartyRoom] Room updated');
} catch (e) {
dPrint('[PartyRoom] UpdateRoom error: $e');
rethrow;
}
}
///
Future<void> kickMember(String targetGameUserId) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
await client.kickMember(
partroom.KickMemberRequest(roomUuid: roomUuid, targetGameUserId: targetGameUserId),
options: _getAuthCallOptions(),
);
dPrint('[PartyRoom] Member kicked: $targetGameUserId');
//
await getRoomMembers(roomUuid);
} catch (e) {
dPrint('[PartyRoom] KickMember error: $e');
rethrow;
}
}
///
Future<void> setStatus({String? currentLocation, int? kills, int? deaths, int? playTime}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
await client.setStatus(
partroom.SetStatusRequest(
roomUuid: roomUuid,
status: partroom.MemberStatus(
currentLocation: currentLocation ?? '',
kills: kills ?? 0,
deaths: deaths ?? 0,
playTime: Int64(playTime ?? 0),
),
),
options: _getAuthCallOptions(),
);
dPrint('[PartyRoom] Status updated');
} catch (e) {
dPrint('[PartyRoom] SetStatus error: $e');
rethrow;
}
}
///
Future<void> sendSignal(String signalId, {Map<String, String>? params}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
//
final validSignalIds = state.room.signalTypes.map((s) => s.id).toList();
if (validSignalIds.isNotEmpty && !validSignalIds.contains(signalId)) {
throw Exception('Invalid signal ID: $signalId. Valid IDs: ${validSignalIds.join(", ")}');
}
final request = partroom.SendSignalRequest(roomUuid: roomUuid, signalId: signalId);
if (params != null) {
request.params.addAll(params);
}
await client.sendSignal(request, options: _getAuthCallOptions());
dPrint('[PartyRoom] Signal sent: $signalId');
} catch (e) {
dPrint('[PartyRoom] SendSignal error: $e');
rethrow;
}
}
///
Future<void> transferOwnership(String targetGameUserId) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
await client.transferOwnership(
partroom.TransferOwnershipRequest(roomUuid: roomUuid, targetGameUserId: targetGameUserId),
options: _getAuthCallOptions(),
);
//
state = state.copyWith(room: state.room.copyWith(isOwner: false));
dPrint('[PartyRoom] Ownership transferred to: $targetGameUserId');
//
await getRoomInfo(roomUuid);
} catch (e) {
dPrint('[PartyRoom] TransferOwnership error: $e');
rethrow;
}
}
///
Future<partroom.GetKickedMembersResponse> getKickedMembers({int page = 1, int pageSize = 20}) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) throw Exception('Not in a room');
final response = await client.getKickedMembers(
partroom.GetKickedMembersRequest(roomUuid: roomUuid, page: page, pageSize: pageSize),
options: _getAuthCallOptions(),
);
return response;
} catch (e) {
dPrint('[PartyRoom] GetKickedMembers error: $e');
rethrow;
}
}
///
Future<void> removeKickedMember(String gameUserId) async {
try {
final client = state.client.roomClient;
if (client == null) throw Exception('Not connected to server');
final roomUuid = state.room.roomUuid;
if (roomUuid == null) return;
await client.removeKickedMember(
partroom.RemoveKickedMemberRequest(roomUuid: roomUuid, gameUserId: gameUserId),
options: _getAuthCallOptions(),
);
dPrint('[PartyRoom] Kicked member removed: $gameUserId');
} catch (e) {
dPrint('[PartyRoom] RemoveKickedMember error: $e');
rethrow;
}
}
// ========== ==========
///
Future<void> _startHeartbeat(String roomUuid) async {
await _stopHeartbeat();
_heartbeatTimer = Timer.periodic(const Duration(seconds: 30), (timer) async {
if (_disposed || state.room.roomUuid == null) {
timer.cancel();
return;
}
try {
final client = state.client.roomClient;
if (client == null) return;
await client.heartbeat(partroom.HeartbeatRequest(roomUuid: roomUuid), options: _getAuthCallOptions());
dPrint('[PartyRoom] Heartbeat sent');
} catch (e) {
dPrint('[PartyRoom] Heartbeat error: $e');
}
});
dPrint('[PartyRoom] Heartbeat started');
}
///
Future<void> _stopHeartbeat() async {
_heartbeatTimer?.cancel();
_heartbeatTimer = null;
dPrint('[PartyRoom] Heartbeat stopped');
}
///
Future<void> _startEventStream(String roomUuid) async {
await _stopEventStream();
try {
final client = state.client.roomClient;
if (client == null) return;
final stream = client.listenRoomEvents(
partroom.ListenRoomEventsRequest(roomUuid: roomUuid),
options: _getAuthCallOptions(),
);
_eventStreamSubscription = stream.listen(
(event) {
_handleRoomEvent(event);
},
onError: (error) {
dPrint('[PartyRoom] Event stream error: $error');
},
onDone: () {
dPrint('[PartyRoom] Event stream closed');
},
);
dPrint('[PartyRoom] Event stream started');
} catch (e) {
dPrint('[PartyRoom] StartEventStream error: $e');
}
}
///
Future<void> _stopEventStream() async {
await _eventStreamSubscription?.cancel();
_eventStreamSubscription = null;
dPrint('[PartyRoom] Event stream stopped');
}
///
void _handleRoomEvent(partroom.RoomEvent event) {
dPrint('[PartyRoom] Event received: ${event.type}');
// 50
final recentEvents = [...state.room.recentEvents, event];
if (recentEvents.length > 50) {
recentEvents.removeAt(0);
}
state = state.copyWith(room: state.room.copyWith(recentEvents: recentEvents));
//
switch (event.type) {
case partroom.RoomEventType.MEMBER_JOINED:
case partroom.RoomEventType.MEMBER_LEFT:
case partroom.RoomEventType.MEMBER_KICKED:
case partroom.RoomEventType.MEMBER_STATUS_UPDATED:
//
if (state.room.roomUuid != null) {
getRoomMembers(state.room.roomUuid!);
}
break;
case partroom.RoomEventType.OWNER_CHANGED:
//
final isOwner = event.member.gameUserId == state.auth.userInfo?.gameUserId;
state = state.copyWith(room: state.room.copyWith(isOwner: isOwner));
//
if (state.room.roomUuid != null) {
getRoomInfo(state.room.roomUuid!);
}
break;
case partroom.RoomEventType.ROOM_UPDATED:
//
if (state.room.roomUuid != null) {
getRoomInfo(state.room.roomUuid!);
}
break;
case partroom.RoomEventType.ROOM_DISMISSED:
//
_stopHeartbeat();
_stopEventStream();
state = state.copyWith(room: const PartyRoomState());
break;
case partroom.RoomEventType.SIGNAL_BROADCAST:
// 广UI state.room.recentEvents
break;
default:
break;
}
}
// ========== ==========
///
Future<common.GetServerTimeResponse> getServerTime() async {
try {
final client = state.client.commonClient;
if (client == null) throw Exception('Not connected to server');
return await client.getServerTime(common.GetServerTimeRequest());
} catch (e) {
dPrint('[PartyRoom] GetServerTime error: $e');
rethrow;
}
}
///
Future<common.GetVersionResponse> getVersion() async {
try {
final client = state.client.commonClient;
if (client == null) throw Exception('Not connected to server');
return await client.getVersion(common.GetVersionRequest());
} catch (e) {
dPrint('[PartyRoom] GetVersion error: $e');
rethrow;
}
}
///
Future<common.GetSignalTypesResponse> getSignalTypes() async {
try {
final client = state.client.commonClient;
if (client == null) throw Exception('Not connected to server');
return await client.getSignalTypes(common.GetSignalTypesRequest());
} catch (e) {
dPrint('[PartyRoom] GetSignalTypes error: $e');
rethrow;
}
}
// ========== ==========
void _cleanup() {
_stopHeartbeat();
_stopEventStream();
_confBox?.close();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,68 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'party_room.dart';
// **************************************************************************
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// PartyRoom Provider
@ProviderFor(PartyRoom)
const partyRoomProvider = PartyRoomProvider._();
/// PartyRoom Provider
final class PartyRoomProvider
extends $NotifierProvider<PartyRoom, PartyRoomFullState> {
/// PartyRoom Provider
const PartyRoomProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'partyRoomProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$partyRoomHash();
@$internal
@override
PartyRoom create() => PartyRoom();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(PartyRoomFullState value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<PartyRoomFullState>(value),
);
}
}
String _$partyRoomHash() => r'2c521709721292458d5459359cac376f123ec226';
/// PartyRoom Provider
abstract class _$PartyRoom extends $Notifier<PartyRoomFullState> {
PartyRoomFullState build();
@$mustCallSuper
@override
void runBuild() {
final created = build();
final ref = this.ref as $Ref<PartyRoomFullState, PartyRoomFullState>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<PartyRoomFullState, PartyRoomFullState>,
PartyRoomFullState,
Object?,
Object?
>;
element.handleValue(ref, created);
}
}

View File

@ -43,7 +43,7 @@ final class InputMethodDialogUIModelProvider
}
String _$inputMethodDialogUIModelHash() =>
r'f216c1a5b6d68b3924af7b351314c618dcac80b5';
r'51f1708f22a90f7c2f879ad3d2a87a8e2f81b9e9';
abstract class _$InputMethodDialogUIModel
extends $Notifier<InputMethodDialogUIState> {

View File

@ -63,10 +63,13 @@ class LocalizationUIModel extends _$LocalizationUIModel {
String get _scInstallPath => ref.read(homeUIModelProvider).scInstalledPath!;
bool _isDisposed = false;
@override
LocalizationUIState build() {
state = LocalizationUIState(selectedLanguage: languageSupport.keys.first);
ref.onDispose(() {
_isDisposed = true;
_customizeDirListenSub?.cancel();
_customizeDirListenSub = null;
});
@ -83,6 +86,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
state = state.copyWith(selectedLanguage: lang);
// fix for ui performance
await Future.delayed(Duration(milliseconds: 250));
if (_isDisposed) return;
await _loadData();
}
@ -113,6 +117,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
for (var lang in languageSupport.keys) {
final l = await Api.getScLocalizationData(lang).unwrap();
if (l != null) {
if (_isDisposed) return;
if (lang == state.selectedLanguage) {
final apiLocalizationData = <String, ScLocalizationData>{};
for (var element in l) {
@ -123,6 +128,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
apiLocalizationData[element.versionName ?? ""] = element;
}
}
if (_isDisposed) return;
state = state.copyWith(apiLocalizationData: apiLocalizationData);
}
final map = <String, ScLocalizationData>{};
@ -464,7 +470,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
dPrint(
"_updateStatus updateStatus: $patchStatus , isInstalledAdvanced: $isInstalledAdvanced ,installedCommunityInputMethodSupportVersion: $installedCommunityInputMethodSupportVersion");
if (_isDisposed) return;
state = state.copyWith(
patchStatus: patchStatus,
isInstalledAdvanced: isInstalledAdvanced,

View File

@ -42,7 +42,7 @@ final class LocalizationUIModelProvider
}
String _$localizationUIModelHash() =>
r'3d3f0ed7fa3631eca4e10d456c437f6fca8eedff';
r'122f9f85da6e112165f4ff88667b45cf3cf3f43e';
abstract class _$LocalizationUIModel extends $Notifier<LocalizationUIState> {
LocalizationUIState build();

View File

@ -6,6 +6,7 @@ import 'package:starcitizen_doctor/app.dart';
import 'package:starcitizen_doctor/common/conf/conf.dart';
import 'package:starcitizen_doctor/provider/aria2c.dart';
import 'package:starcitizen_doctor/ui/home/home_ui_model.dart';
import 'package:starcitizen_doctor/ui/party_room/party_room_ui.dart';
import 'package:starcitizen_doctor/ui/settings/settings_ui_model.dart';
import 'package:starcitizen_doctor/widgets/widgets.dart';
import 'package:window_manager/window_manager.dart';
@ -13,6 +14,7 @@ import 'package:window_manager/window_manager.dart';
import 'about/about_ui.dart';
import 'home/home_ui.dart';
import 'nav/nav_ui.dart';
import 'party_room/party_room_ui_model.dart';
import 'settings/settings_ui.dart';
import 'tools/tools_ui.dart';
@ -21,58 +23,52 @@ class IndexUI extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
ref.watch(appGlobalModelProvider);
// pre init child
ref.watch(homeUIModelProvider.select((value) => null));
ref.watch(settingsUIModelProvider.select((value) => null));
ref.watch(appGlobalModelProvider);
ref.watch(partyRoomUIModelProvider.select((value) => null));
final curIndex = useState(0);
return NavigationView(
appBar: NavigationAppBar(
automaticallyImplyLeading: false,
title: () {
return DragToMoveArea(
child: Align(
alignment: AlignmentDirectional.centerStart,
child: Row(
children: [
Image.asset(
"assets/app_logo_mini.png",
width: 20,
height: 20,
fit: BoxFit.cover,
),
const SizedBox(width: 12),
Text(S.current.app_index_version_info(ConstConf.appVersion, ConstConf.isMSE ? "" : " Dev")),
],
),
automaticallyImplyLeading: false,
title: () {
return DragToMoveArea(
child: Align(
alignment: AlignmentDirectional.centerStart,
child: Row(
children: [
Image.asset("assets/app_logo_mini.png", width: 20, height: 20, fit: BoxFit.cover),
const SizedBox(width: 12),
Text(S.current.app_index_version_info(ConstConf.appVersion, ConstConf.isMSE ? "" : " Dev")),
],
),
);
}(),
actions: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
icon: Stack(
children: [
Padding(
padding: const EdgeInsets.all(6),
child: Icon(
FluentIcons.installation,
size: 22,
color: Colors.white.withValues(alpha: .6),
),
),
_makeAria2TaskNumWidget()
],
),
onPressed: () => _goDownloader(context),
// onPressed: model.goDownloader
),
);
}(),
actions: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
icon: Stack(
children: [
Padding(
padding: const EdgeInsets.all(6),
child: Icon(FluentIcons.installation, size: 22, color: Colors.white.withValues(alpha: .6)),
),
_makeAria2TaskNumWidget(),
],
),
const SizedBox(width: 24),
const WindowButtons()
],
)),
onPressed: () => _goDownloader(context),
// onPressed: model.goDownloader
),
const SizedBox(width: 24),
const WindowButtons(),
],
),
),
pane: NavigationPane(
key: Key("NavigationPane_${S.current.app_language_code}"),
selected: curIndex.value,
@ -86,21 +82,13 @@ class IndexUI extends HookConsumerWidget {
}
Map<IconData, (String, Widget)> get pageMenus => {
FluentIcons.home: (
S.current.app_index_menu_home,
const HomeUI(),
),
FluentIcons.toolbox: (
S.current.app_index_menu_tools,
const ToolsUI(),
),
FluentIcons.power_apps: ((S.current.nav_title), const NavUI()),
FluentIcons.settings: (S.current.app_index_menu_settings, const SettingsUI()),
FluentIcons.info: (
S.current.app_index_menu_about,
const AboutUI(),
),
};
FluentIcons.home: (S.current.app_index_menu_home, const HomeUI()),
FluentIcons.game: (S.current.app_index_menu_lobby, const PartyRoomUI()),
FluentIcons.toolbox: (S.current.app_index_menu_tools, const ToolsUI()),
FluentIcons.power_apps: ((S.current.nav_title), const NavUI()),
FluentIcons.settings: (S.current.app_index_menu_settings, const SettingsUI()),
FluentIcons.info: (S.current.app_index_menu_about, const AboutUI()),
};
List<NavigationPaneItem> getNavigationPaneItems(ValueNotifier<int> curIndexState) {
// width = 64
@ -116,10 +104,7 @@ class IndexUI extends HookConsumerWidget {
children: [
Icon(kv.key, size: 18),
const SizedBox(height: 3),
Text(
kv.value.$1,
style: const TextStyle(fontSize: 11),
)
Text(kv.value.$1, style: const TextStyle(fontSize: 11)),
],
),
),
@ -144,22 +129,14 @@ class IndexUI extends HookConsumerWidget {
return const SizedBox();
}
return Positioned(
bottom: 0,
right: 0,
child: Container(
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.only(left: 6, right: 6, bottom: 1.5, top: 1.5),
child: Text(
"${aria2cState.aria2TotalTaskNum}",
style: const TextStyle(
fontSize: 8,
color: Colors.white,
),
),
));
bottom: 0,
right: 0,
child: Container(
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(12)),
padding: const EdgeInsets.only(left: 6, right: 6, bottom: 1.5, top: 1.5),
child: Text("${aria2cState.aria2TotalTaskNum}", style: const TextStyle(fontSize: 8, color: Colors.white)),
),
);
},
);
}

View File

@ -33,8 +33,10 @@ class Nav extends _$Nav {
if (!_mounted) return;
try {
final r = await UDBNavApi.getNavItems(pageNo: pageNo);
if (!_mounted) return;
state = state.copyWith(items: r.docs, errorInfo: "");
} catch (e) {
if (!_mounted) return;
state = state.copyWith(errorInfo: e.toString());
}
}

View File

@ -40,7 +40,7 @@ final class NavProvider extends $NotifierProvider<Nav, NavState> {
}
}
String _$navHash() => r'00c4da8fdd37214cda179a81ece3676add7aab53';
String _$navHash() => r'bd3773505d6ae53f577ac6f3bfe711b320faa524';
abstract class _$Nav extends $Notifier<NavState> {
NavState build();

View File

@ -1,41 +1,32 @@
import 'package:flutter/material.dart';
import 'package:fluent_ui/fluent_ui.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:starcitizen_doctor/generated/l10n.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:starcitizen_doctor/provider/party_room.dart';
import 'package:starcitizen_doctor/ui/party_room/party_room_ui_model.dart';
import 'package:starcitizen_doctor/ui/party_room/widgets/party_room_connect_page.dart';
import 'package:starcitizen_doctor/ui/party_room/widgets/party_room_list_page.dart';
import 'package:starcitizen_doctor/ui/party_room/widgets/party_room_detail_page.dart';
import 'package:starcitizen_doctor/ui/party_room/widgets/party_room_register_page.dart';
class PartyRoomUI extends HookConsumerWidget {
const PartyRoomUI({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
S.current.lobby_online_lobby_coming_soon,
style: const TextStyle(fontSize: 20),
),
const SizedBox(height: 12),
GestureDetector(
onTap: () {
launchUrlString("https://wj.qq.com/s2/14112124/f4c8/");
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(S.current.lobby_invitation_to_participate),
Text(
S.current.lobby_survey,
style: const TextStyle(
color: Colors.blue,
),
)
],
),
),
],
),
);
final partyRoomState = ref.watch(partyRoomProvider);
ref.watch(partyRoomUIModelProvider.select((_) => null));
//
if (!partyRoomState.client.isConnected) {
return const PartyRoomConnectPage();
}
if (!partyRoomState.auth.isLoggedIn) {
return const PartyRoomRegisterPage();
}
if (partyRoomState.room.isInRoom) {
return const PartyRoomDetailPage();
}
return const PartyRoomListPage();
}
}

View File

@ -0,0 +1,262 @@
import 'dart:async';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:starcitizen_doctor/common/utils/log.dart';
import 'package:starcitizen_doctor/generated/proto/partroom/partroom.pb.dart';
import 'package:starcitizen_doctor/provider/party_room.dart';
part 'party_room_ui_model.freezed.dart';
part 'party_room_ui_model.g.dart';
@freezed
sealed class PartyRoomUIState with _$PartyRoomUIState {
const factory PartyRoomUIState({
@Default(false) bool isConnecting,
@Default(false) bool showRoomList,
@Default([]) List<RoomListItem> roomListItems,
@Default(1) int currentPage,
@Default(20) int pageSize,
@Default(0) int totalRooms,
String? selectedMainTagId,
String? selectedSubTagId,
@Default('') String searchOwnerName,
@Default(false) bool isLoading,
String? errorMessage,
@Default('') String preRegisterCode,
@Default('') String registerGameUserId,
@Default(false) bool isReconnecting,
@Default(0) int reconnectAttempts,
}) = _PartyRoomUIState;
}
@riverpod
class PartyRoomUIModel extends _$PartyRoomUIModel {
Timer? _reconnectTimer;
@override
PartyRoomUIState build() {
state = const PartyRoomUIState();
ref.listen(partyRoomProvider, (previous, next) {
_handleConnectionStateChange(previous, next);
});
connectToServer();
// dispose
ref.onDispose(() {
_reconnectTimer?.cancel();
});
return state;
}
///
void _handleConnectionStateChange(PartyRoomFullState? previous, PartyRoomFullState next) {
// 线
if (previous != null && previous.client.isConnected && !next.client.isConnected && !state.isReconnecting) {
dPrint('[PartyRoomUI] Connection lost, starting reconnection...');
_startReconnection();
}
}
/// 线
Future<void> _startReconnection() async {
if (state.isReconnecting) return;
state = state.copyWith(isReconnecting: true, reconnectAttempts: 0);
try {
//
await _attemptReconnect();
} catch (e) {
dPrint('[PartyRoomUI] Reconnection failed: $e');
state = state.copyWith(isReconnecting: false, errorMessage: '重连失败: $e');
}
}
///
Future<void> _attemptReconnect() async {
const maxAttempts = 5;
const baseDelay = Duration(seconds: 2);
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
state = state.copyWith(reconnectAttempts: attempt);
dPrint('[PartyRoomUI] Reconnection attempt $attempt/$maxAttempts');
try {
final partyRoom = ref.read(partyRoomProvider.notifier);
//
await partyRoom.connect();
//
await partyRoom.login();
//
await partyRoom.loadTags();
if (state.showRoomList) {
await loadRoomList();
}
//
state = state.copyWith(isReconnecting: false, reconnectAttempts: 0, errorMessage: null);
dPrint('[PartyRoomUI] Reconnection successful');
return;
} catch (e) {
dPrint('[PartyRoomUI] Reconnection attempt $attempt failed: $e');
if (attempt < maxAttempts) {
// 使退
final delay = baseDelay * (1 << (attempt - 1));
dPrint('[PartyRoomUI] Waiting ${delay.inSeconds}s before next attempt...');
await Future.delayed(delay);
}
}
}
//
state = state.copyWith(isReconnecting: false, errorMessage: '重连失败,已尝试 $maxAttempts');
throw Exception('Max reconnection attempts reached');
}
///
Future<void> connectToServer() async {
state = state.copyWith(isConnecting: true, errorMessage: null);
await Future.delayed(Duration(seconds: 1));
try {
final partyRoom = ref.read(partyRoomProvider.notifier);
await partyRoom.connect();
//
try {
await partyRoom.login();
//
await partyRoom.loadTags();
await loadRoomList();
state = state.copyWith(showRoomList: true);
} catch (e) {
//
dPrint('[PartyRoomUI] Login failed, need register: $e');
}
state = state.copyWith(isConnecting: false);
} catch (e) {
state = state.copyWith(isConnecting: false, errorMessage: '连接失败: $e');
rethrow;
}
}
///
Future<void> requestPreRegister(String gameUserId) async {
state = state.copyWith(isLoading: true, errorMessage: null, registerGameUserId: gameUserId);
try {
final partyRoom = ref.read(partyRoomProvider.notifier);
final response = await partyRoom.preRegister(gameUserId);
state = state.copyWith(isLoading: false, preRegisterCode: response.verificationCode);
} catch (e) {
state = state.copyWith(isLoading: false, errorMessage: '获取验证码失败: $e');
rethrow;
}
}
///
Future<void> completeRegister() async {
if (state.registerGameUserId.isEmpty) {
throw Exception('游戏ID不能为空');
}
state = state.copyWith(isLoading: true, errorMessage: null);
try {
final partyRoom = ref.read(partyRoomProvider.notifier);
await partyRoom.register(state.registerGameUserId);
//
await partyRoom.login();
await partyRoom.loadTags();
await loadRoomList();
state = state.copyWith(isLoading: false, showRoomList: true, preRegisterCode: '', registerGameUserId: '');
} catch (e) {
state = state.copyWith(isLoading: false, errorMessage: '注册失败: $e');
rethrow;
}
}
///
Future<void> loadRoomList({
String? mainTagId,
String? subTagId,
String? searchName,
int? page,
bool append = false,
}) async {
try {
state = state.copyWith(isLoading: true);
//
if (mainTagId != null) state = state.copyWith(selectedMainTagId: mainTagId);
if (subTagId != null) state = state.copyWith(selectedSubTagId: subTagId);
if (searchName != null) state = state.copyWith(searchOwnerName: searchName);
if (page != null) state = state.copyWith(currentPage: page);
final partyRoom = ref.read(partyRoomProvider.notifier);
final response = await partyRoom.getRoomList(
mainTagId: state.selectedMainTagId,
subTagId: state.selectedSubTagId,
searchOwnerName: state.searchOwnerName,
page: state.currentPage,
pageSize: state.pageSize,
);
//
final newRooms = append ? [...state.roomListItems, ...response.rooms] : response.rooms;
state = state.copyWith(isLoading: false, roomListItems: newRooms, totalRooms: response.total, errorMessage: null);
} catch (e) {
state = state.copyWith(isLoading: false, errorMessage: '加载房间列表失败: $e');
}
}
///
Future<void> loadMoreRooms() async {
final totalPages = (state.totalRooms / state.pageSize).ceil();
if (state.currentPage >= totalPages || state.isLoading) return;
await loadRoomList(page: state.currentPage + 1, append: true);
}
///
Future<void> refreshRoomList() async {
state = state.copyWith(currentPage: 1, roomListItems: []);
await loadRoomList(page: 1);
}
///
void clearError() {
state = state.copyWith(errorMessage: null);
}
///
Future<void> disconnect() async {
final partyRoom = ref.read(partyRoomProvider.notifier);
await partyRoom.disconnect();
state = const PartyRoomUIState();
}
void setSelectedMainTagId(String? value) {
state = state.copyWith(selectedMainTagId: value);
refreshRoomList();
}
void dismissRoom() {
ref.read(partyRoomProvider.notifier).dismissRoom();
ref.read(partyRoomProvider.notifier).loadTags();
}
}

View File

@ -0,0 +1,313 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'party_room_ui_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$PartyRoomUIState {
bool get isConnecting; bool get showRoomList; List<RoomListItem> get roomListItems; int get currentPage; int get pageSize; int get totalRooms; String? get selectedMainTagId; String? get selectedSubTagId; String get searchOwnerName; bool get isLoading; String? get errorMessage; String get preRegisterCode; String get registerGameUserId; bool get isReconnecting; int get reconnectAttempts;
/// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$PartyRoomUIStateCopyWith<PartyRoomUIState> get copyWith => _$PartyRoomUIStateCopyWithImpl<PartyRoomUIState>(this as PartyRoomUIState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is PartyRoomUIState&&(identical(other.isConnecting, isConnecting) || other.isConnecting == isConnecting)&&(identical(other.showRoomList, showRoomList) || other.showRoomList == showRoomList)&&const DeepCollectionEquality().equals(other.roomListItems, roomListItems)&&(identical(other.currentPage, currentPage) || other.currentPage == currentPage)&&(identical(other.pageSize, pageSize) || other.pageSize == pageSize)&&(identical(other.totalRooms, totalRooms) || other.totalRooms == totalRooms)&&(identical(other.selectedMainTagId, selectedMainTagId) || other.selectedMainTagId == selectedMainTagId)&&(identical(other.selectedSubTagId, selectedSubTagId) || other.selectedSubTagId == selectedSubTagId)&&(identical(other.searchOwnerName, searchOwnerName) || other.searchOwnerName == searchOwnerName)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.preRegisterCode, preRegisterCode) || other.preRegisterCode == preRegisterCode)&&(identical(other.registerGameUserId, registerGameUserId) || other.registerGameUserId == registerGameUserId)&&(identical(other.isReconnecting, isReconnecting) || other.isReconnecting == isReconnecting)&&(identical(other.reconnectAttempts, reconnectAttempts) || other.reconnectAttempts == reconnectAttempts));
}
@override
int get hashCode => Object.hash(runtimeType,isConnecting,showRoomList,const DeepCollectionEquality().hash(roomListItems),currentPage,pageSize,totalRooms,selectedMainTagId,selectedSubTagId,searchOwnerName,isLoading,errorMessage,preRegisterCode,registerGameUserId,isReconnecting,reconnectAttempts);
@override
String toString() {
return 'PartyRoomUIState(isConnecting: $isConnecting, showRoomList: $showRoomList, roomListItems: $roomListItems, currentPage: $currentPage, pageSize: $pageSize, totalRooms: $totalRooms, selectedMainTagId: $selectedMainTagId, selectedSubTagId: $selectedSubTagId, searchOwnerName: $searchOwnerName, isLoading: $isLoading, errorMessage: $errorMessage, preRegisterCode: $preRegisterCode, registerGameUserId: $registerGameUserId, isReconnecting: $isReconnecting, reconnectAttempts: $reconnectAttempts)';
}
}
/// @nodoc
abstract mixin class $PartyRoomUIStateCopyWith<$Res> {
factory $PartyRoomUIStateCopyWith(PartyRoomUIState value, $Res Function(PartyRoomUIState) _then) = _$PartyRoomUIStateCopyWithImpl;
@useResult
$Res call({
bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts
});
}
/// @nodoc
class _$PartyRoomUIStateCopyWithImpl<$Res>
implements $PartyRoomUIStateCopyWith<$Res> {
_$PartyRoomUIStateCopyWithImpl(this._self, this._then);
final PartyRoomUIState _self;
final $Res Function(PartyRoomUIState) _then;
/// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? isConnecting = null,Object? showRoomList = null,Object? roomListItems = null,Object? currentPage = null,Object? pageSize = null,Object? totalRooms = null,Object? selectedMainTagId = freezed,Object? selectedSubTagId = freezed,Object? searchOwnerName = null,Object? isLoading = null,Object? errorMessage = freezed,Object? preRegisterCode = null,Object? registerGameUserId = null,Object? isReconnecting = null,Object? reconnectAttempts = null,}) {
return _then(_self.copyWith(
isConnecting: null == isConnecting ? _self.isConnecting : isConnecting // ignore: cast_nullable_to_non_nullable
as bool,showRoomList: null == showRoomList ? _self.showRoomList : showRoomList // ignore: cast_nullable_to_non_nullable
as bool,roomListItems: null == roomListItems ? _self.roomListItems : roomListItems // ignore: cast_nullable_to_non_nullable
as List<RoomListItem>,currentPage: null == currentPage ? _self.currentPage : currentPage // ignore: cast_nullable_to_non_nullable
as int,pageSize: null == pageSize ? _self.pageSize : pageSize // ignore: cast_nullable_to_non_nullable
as int,totalRooms: null == totalRooms ? _self.totalRooms : totalRooms // ignore: cast_nullable_to_non_nullable
as int,selectedMainTagId: freezed == selectedMainTagId ? _self.selectedMainTagId : selectedMainTagId // ignore: cast_nullable_to_non_nullable
as String?,selectedSubTagId: freezed == selectedSubTagId ? _self.selectedSubTagId : selectedSubTagId // ignore: cast_nullable_to_non_nullable
as String?,searchOwnerName: null == searchOwnerName ? _self.searchOwnerName : searchOwnerName // ignore: cast_nullable_to_non_nullable
as String,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
as String?,preRegisterCode: null == preRegisterCode ? _self.preRegisterCode : preRegisterCode // ignore: cast_nullable_to_non_nullable
as String,registerGameUserId: null == registerGameUserId ? _self.registerGameUserId : registerGameUserId // ignore: cast_nullable_to_non_nullable
as String,isReconnecting: null == isReconnecting ? _self.isReconnecting : isReconnecting // ignore: cast_nullable_to_non_nullable
as bool,reconnectAttempts: null == reconnectAttempts ? _self.reconnectAttempts : reconnectAttempts // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// Adds pattern-matching-related methods to [PartyRoomUIState].
extension PartyRoomUIStatePatterns on PartyRoomUIState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _PartyRoomUIState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _PartyRoomUIState() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _PartyRoomUIState value) $default,){
final _that = this;
switch (_that) {
case _PartyRoomUIState():
return $default(_that);}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _PartyRoomUIState value)? $default,){
final _that = this;
switch (_that) {
case _PartyRoomUIState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _PartyRoomUIState() when $default != null:
return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts) $default,) {final _that = this;
switch (_that) {
case _PartyRoomUIState():
return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts);}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts)? $default,) {final _that = this;
switch (_that) {
case _PartyRoomUIState() when $default != null:
return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts);case _:
return null;
}
}
}
/// @nodoc
class _PartyRoomUIState implements PartyRoomUIState {
const _PartyRoomUIState({this.isConnecting = false, this.showRoomList = false, final List<RoomListItem> roomListItems = const [], this.currentPage = 1, this.pageSize = 20, this.totalRooms = 0, this.selectedMainTagId, this.selectedSubTagId, this.searchOwnerName = '', this.isLoading = false, this.errorMessage, this.preRegisterCode = '', this.registerGameUserId = '', this.isReconnecting = false, this.reconnectAttempts = 0}): _roomListItems = roomListItems;
@override@JsonKey() final bool isConnecting;
@override@JsonKey() final bool showRoomList;
final List<RoomListItem> _roomListItems;
@override@JsonKey() List<RoomListItem> get roomListItems {
if (_roomListItems is EqualUnmodifiableListView) return _roomListItems;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_roomListItems);
}
@override@JsonKey() final int currentPage;
@override@JsonKey() final int pageSize;
@override@JsonKey() final int totalRooms;
@override final String? selectedMainTagId;
@override final String? selectedSubTagId;
@override@JsonKey() final String searchOwnerName;
@override@JsonKey() final bool isLoading;
@override final String? errorMessage;
@override@JsonKey() final String preRegisterCode;
@override@JsonKey() final String registerGameUserId;
@override@JsonKey() final bool isReconnecting;
@override@JsonKey() final int reconnectAttempts;
/// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$PartyRoomUIStateCopyWith<_PartyRoomUIState> get copyWith => __$PartyRoomUIStateCopyWithImpl<_PartyRoomUIState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _PartyRoomUIState&&(identical(other.isConnecting, isConnecting) || other.isConnecting == isConnecting)&&(identical(other.showRoomList, showRoomList) || other.showRoomList == showRoomList)&&const DeepCollectionEquality().equals(other._roomListItems, _roomListItems)&&(identical(other.currentPage, currentPage) || other.currentPage == currentPage)&&(identical(other.pageSize, pageSize) || other.pageSize == pageSize)&&(identical(other.totalRooms, totalRooms) || other.totalRooms == totalRooms)&&(identical(other.selectedMainTagId, selectedMainTagId) || other.selectedMainTagId == selectedMainTagId)&&(identical(other.selectedSubTagId, selectedSubTagId) || other.selectedSubTagId == selectedSubTagId)&&(identical(other.searchOwnerName, searchOwnerName) || other.searchOwnerName == searchOwnerName)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.preRegisterCode, preRegisterCode) || other.preRegisterCode == preRegisterCode)&&(identical(other.registerGameUserId, registerGameUserId) || other.registerGameUserId == registerGameUserId)&&(identical(other.isReconnecting, isReconnecting) || other.isReconnecting == isReconnecting)&&(identical(other.reconnectAttempts, reconnectAttempts) || other.reconnectAttempts == reconnectAttempts));
}
@override
int get hashCode => Object.hash(runtimeType,isConnecting,showRoomList,const DeepCollectionEquality().hash(_roomListItems),currentPage,pageSize,totalRooms,selectedMainTagId,selectedSubTagId,searchOwnerName,isLoading,errorMessage,preRegisterCode,registerGameUserId,isReconnecting,reconnectAttempts);
@override
String toString() {
return 'PartyRoomUIState(isConnecting: $isConnecting, showRoomList: $showRoomList, roomListItems: $roomListItems, currentPage: $currentPage, pageSize: $pageSize, totalRooms: $totalRooms, selectedMainTagId: $selectedMainTagId, selectedSubTagId: $selectedSubTagId, searchOwnerName: $searchOwnerName, isLoading: $isLoading, errorMessage: $errorMessage, preRegisterCode: $preRegisterCode, registerGameUserId: $registerGameUserId, isReconnecting: $isReconnecting, reconnectAttempts: $reconnectAttempts)';
}
}
/// @nodoc
abstract mixin class _$PartyRoomUIStateCopyWith<$Res> implements $PartyRoomUIStateCopyWith<$Res> {
factory _$PartyRoomUIStateCopyWith(_PartyRoomUIState value, $Res Function(_PartyRoomUIState) _then) = __$PartyRoomUIStateCopyWithImpl;
@override @useResult
$Res call({
bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts
});
}
/// @nodoc
class __$PartyRoomUIStateCopyWithImpl<$Res>
implements _$PartyRoomUIStateCopyWith<$Res> {
__$PartyRoomUIStateCopyWithImpl(this._self, this._then);
final _PartyRoomUIState _self;
final $Res Function(_PartyRoomUIState) _then;
/// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? isConnecting = null,Object? showRoomList = null,Object? roomListItems = null,Object? currentPage = null,Object? pageSize = null,Object? totalRooms = null,Object? selectedMainTagId = freezed,Object? selectedSubTagId = freezed,Object? searchOwnerName = null,Object? isLoading = null,Object? errorMessage = freezed,Object? preRegisterCode = null,Object? registerGameUserId = null,Object? isReconnecting = null,Object? reconnectAttempts = null,}) {
return _then(_PartyRoomUIState(
isConnecting: null == isConnecting ? _self.isConnecting : isConnecting // ignore: cast_nullable_to_non_nullable
as bool,showRoomList: null == showRoomList ? _self.showRoomList : showRoomList // ignore: cast_nullable_to_non_nullable
as bool,roomListItems: null == roomListItems ? _self._roomListItems : roomListItems // ignore: cast_nullable_to_non_nullable
as List<RoomListItem>,currentPage: null == currentPage ? _self.currentPage : currentPage // ignore: cast_nullable_to_non_nullable
as int,pageSize: null == pageSize ? _self.pageSize : pageSize // ignore: cast_nullable_to_non_nullable
as int,totalRooms: null == totalRooms ? _self.totalRooms : totalRooms // ignore: cast_nullable_to_non_nullable
as int,selectedMainTagId: freezed == selectedMainTagId ? _self.selectedMainTagId : selectedMainTagId // ignore: cast_nullable_to_non_nullable
as String?,selectedSubTagId: freezed == selectedSubTagId ? _self.selectedSubTagId : selectedSubTagId // ignore: cast_nullable_to_non_nullable
as String?,searchOwnerName: null == searchOwnerName ? _self.searchOwnerName : searchOwnerName // ignore: cast_nullable_to_non_nullable
as String,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
as String?,preRegisterCode: null == preRegisterCode ? _self.preRegisterCode : preRegisterCode // ignore: cast_nullable_to_non_nullable
as String,registerGameUserId: null == registerGameUserId ? _self.registerGameUserId : registerGameUserId // ignore: cast_nullable_to_non_nullable
as String,isReconnecting: null == isReconnecting ? _self.isReconnecting : isReconnecting // ignore: cast_nullable_to_non_nullable
as bool,reconnectAttempts: null == reconnectAttempts ? _self.reconnectAttempts : reconnectAttempts // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
// dart format on

View File

@ -0,0 +1,63 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'party_room_ui_model.dart';
// **************************************************************************
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(PartyRoomUIModel)
const partyRoomUIModelProvider = PartyRoomUIModelProvider._();
final class PartyRoomUIModelProvider
extends $NotifierProvider<PartyRoomUIModel, PartyRoomUIState> {
const PartyRoomUIModelProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'partyRoomUIModelProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$partyRoomUIModelHash();
@$internal
@override
PartyRoomUIModel create() => PartyRoomUIModel();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(PartyRoomUIState value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<PartyRoomUIState>(value),
);
}
}
String _$partyRoomUIModelHash() => r'262069d02bbc7d76fe6797c6c744bdf848122492';
abstract class _$PartyRoomUIModel extends $Notifier<PartyRoomUIState> {
PartyRoomUIState build();
@$mustCallSuper
@override
void runBuild() {
final created = build();
final ref = this.ref as $Ref<PartyRoomUIState, PartyRoomUIState>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<PartyRoomUIState, PartyRoomUIState>,
PartyRoomUIState,
Object?,
Object?
>;
element.handleValue(ref, created);
}
}

View File

@ -0,0 +1,190 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:starcitizen_doctor/provider/party_room.dart';
///
class CreateRoomDialog extends HookConsumerWidget {
const CreateRoomDialog({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final partyRoomState = ref.watch(partyRoomProvider);
final partyRoom = ref.read(partyRoomProvider.notifier);
final selectedMainTag = useState<String?>(null);
final selectedSubTag = useState<String?>(null);
final targetMembersController = useTextEditingController(text: '6');
final hasPassword = useState(false);
final passwordController = useTextEditingController();
final socialLinksController = useTextEditingController();
final isCreating = useState(false);
return ContentDialog(
constraints: const BoxConstraints(maxWidth: 500),
title: const Text('创建房间'),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InfoLabel(
label: '房间类型',
child: ComboBox<String>(
placeholder: const Text('选择主标签'),
value: selectedMainTag.value,
items: partyRoomState.room.tags.map((tag) {
return ComboBoxItem(value: tag.id, child: Text(tag.name));
}).toList(),
onChanged: (value) {
selectedMainTag.value = value;
selectedSubTag.value = null;
},
),
),
const SizedBox(height: 12),
if (selectedMainTag.value != null) ...[
InfoLabel(
label: '子标签 (可选)',
child: ComboBox<String>(
placeholder: const Text('选择子标签'),
value: selectedSubTag.value,
items: [
const ComboBoxItem(value: null, child: Text('')),
...partyRoomState.room.tags.firstWhere((tag) => tag.id == selectedMainTag.value).subTags.map((
subTag,
) {
return ComboBoxItem(value: subTag.id, child: Text(subTag.name));
}),
],
onChanged: (value) {
selectedSubTag.value = value;
},
),
),
const SizedBox(height: 12),
],
InfoLabel(
label: '目标人数 (2-600)',
child: TextBox(
controller: targetMembersController,
placeholder: '输入目标人数',
keyboardType: TextInputType.number,
),
),
const SizedBox(height: 12),
Row(
children: [
Checkbox(
checked: hasPassword.value,
onChanged: (value) {
hasPassword.value = value ?? false;
},
content: const Text('设置密码'),
),
],
),
if (hasPassword.value) ...[
const SizedBox(height: 8),
InfoLabel(
label: '房间密码',
child: TextBox(controller: passwordController, placeholder: '输入密码', obscureText: true),
),
],
const SizedBox(height: 12),
InfoLabel(
label: '社交链接 (可选)',
child: TextBox(controller: socialLinksController, placeholder: 'https://discord.gg/xxxxx', maxLines: 1),
),
],
),
),
actions: [
FilledButton(
onPressed: isCreating.value
? null
: () async {
final mainTagId = selectedMainTag.value;
if (mainTagId == null || mainTagId.isEmpty) {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: const Text('提示'),
content: const Text('请选择房间类型'),
actions: [FilledButton(child: const Text('确定'), onPressed: () => Navigator.pop(context))],
),
);
return;
}
final targetMembers = int.tryParse(targetMembersController.text);
if (targetMembers == null || targetMembers < 2 || targetMembers > 600) {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: const Text('提示'),
content: const Text('目标人数必须在 2-600 之间'),
actions: [FilledButton(child: const Text('确定'), onPressed: () => Navigator.pop(context))],
),
);
return;
}
if (hasPassword.value && passwordController.text.trim().isEmpty) {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: const Text('提示'),
content: const Text('请输入密码'),
actions: [FilledButton(child: const Text('确定'), onPressed: () => Navigator.pop(context))],
),
);
return;
}
final socialLinks = socialLinksController.text
.split('\n')
.where((link) => link.trim().isNotEmpty && link.trim().startsWith('http'))
.toList();
isCreating.value = true;
try {
await partyRoom.createRoom(
mainTagId: mainTagId,
subTagId: selectedSubTag.value,
targetMembers: targetMembers,
hasPassword: hasPassword.value,
password: hasPassword.value ? passwordController.text : null,
socialLinks: socialLinks.isEmpty ? null : socialLinks,
);
if (context.mounted) {
Navigator.pop(context);
}
} catch (e) {
isCreating.value = false;
if (context.mounted) {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: const Text('创建失败'),
content: Text(e.toString()),
actions: [FilledButton(child: const Text('确定'), onPressed: () => Navigator.pop(context))],
),
);
}
}
},
child: isCreating.value
? const SizedBox(width: 16, height: 16, child: ProgressRing(strokeWidth: 2))
: const Text('创建'),
),
Button(onPressed: isCreating.value ? null : () => Navigator.pop(context), child: const Text('取消')),
],
);
}
}

View File

@ -0,0 +1,98 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:starcitizen_doctor/ui/party_room/party_room_ui_model.dart';
///
class PartyRoomConnectPage extends HookConsumerWidget {
const PartyRoomConnectPage({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final uiModel = ref.read(partyRoomUIModelProvider.notifier);
final uiState = ref.watch(partyRoomUIModelProvider);
return ScaffoldPage(
padding: EdgeInsets.zero,
content: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.black.withValues(alpha: 0.3), Colors.black.withValues(alpha: 0.6)],
),
),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// Logo
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: const Color(0xFF1E3A5F).withValues(alpha: 0.6),
shape: BoxShape.circle,
boxShadow: [
BoxShadow(color: const Color(0xFF4A9EFF).withValues(alpha: 0.3), blurRadius: 30, spreadRadius: 5),
],
),
child: const Icon(FluentIcons.group, size: 64, color: Color(0xFF4A9EFF)),
),
const SizedBox(height: 32),
//
const Text(
'组队大厅',
style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0), letterSpacing: 2),
),
const SizedBox(height: 12),
//
Text('正在连接服务器...', style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: 0.7))),
const SizedBox(height: 32),
//
const SizedBox(width: 40, height: 40, child: ProgressRing(strokeWidth: 3)),
const SizedBox(height: 32),
if (uiState.errorMessage != null) ...[
Container(
constraints: const BoxConstraints(maxWidth: 400),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xFF3D1E1E).withValues(alpha: 0.8),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: const Color(0xFFFF6B6B), width: 1),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Row(
children: [
Icon(FluentIcons.error_badge, color: Color(0xFFFF6B6B), size: 16),
SizedBox(width: 8),
Text(
'连接失败',
style: TextStyle(color: Color(0xFFFF6B6B), fontWeight: FontWeight.bold),
),
],
),
const SizedBox(height: 8),
Text(uiState.errorMessage!, style: const TextStyle(color: Color(0xFFE0E0E0))),
const SizedBox(height: 12),
FilledButton(
onPressed: () async {
await uiModel.connectToServer();
},
child: const Text('重试'),
),
],
),
),
],
],
),
),
),
);
}
}

View File

@ -0,0 +1,689 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
import 'package:starcitizen_doctor/generated/proto/partroom/partroom.pb.dart' as partroom;
import 'package:starcitizen_doctor/generated/proto/partroom/partroom.pb.dart';
import 'package:starcitizen_doctor/provider/party_room.dart';
import 'package:starcitizen_doctor/ui/party_room/party_room_ui_model.dart';
import 'package:starcitizen_doctor/widgets/src/cache_image.dart';
import 'package:url_launcher/url_launcher_string.dart';
/// (Discord )
class PartyRoomDetailPage extends ConsumerStatefulWidget {
const PartyRoomDetailPage({super.key});
@override
ConsumerState<PartyRoomDetailPage> createState() => _PartyRoomDetailPageState();
}
class _PartyRoomDetailPageState extends ConsumerState<PartyRoomDetailPage> {
final ScrollController _scrollController = ScrollController();
int _lastEventCount = 0;
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
void _scrollToBottom() {
if (_scrollController.hasClients) {
Future.delayed(const Duration(milliseconds: 100), () {
if (_scrollController.hasClients) {
_scrollController.animateTo(
_scrollController.position.maxScrollExtent,
duration: const Duration(milliseconds: 300),
curve: Curves.easeOut,
);
}
});
}
}
@override
Widget build(BuildContext context) {
final partyRoomState = ref.watch(partyRoomProvider);
final partyRoom = ref.read(partyRoomProvider.notifier);
final room = partyRoomState.room.currentRoom;
final members = partyRoomState.room.members;
final isOwner = partyRoomState.room.isOwner;
final events = partyRoomState.room.recentEvents;
//
if (events.length != _lastEventCount) {
_lastEventCount = events.length;
if (events.isNotEmpty) {
_scrollToBottom();
}
}
return ScaffoldPage(
padding: EdgeInsets.zero,
content: Row(
children: [
// ( Discord )
Container(
width: 240,
decoration: BoxDecoration(
color: Color(0xFF232428).withValues(alpha: .3),
border: Border(right: BorderSide(color: Colors.black.withValues(alpha: 0.3), width: 1)),
),
child: Column(
children: [
//
_buildRoomHeader(context, room, members, isOwner, partyRoom),
const Divider(
style: DividerThemeData(thickness: 1, decoration: BoxDecoration(color: Color(0xFF1E1F22))),
),
//
Expanded(child: _buildMembersSidebar(context, ref, members, isOwner, partyRoom)),
],
),
),
//
Expanded(
child: Column(
children: [
//
Expanded(child: _buildMessageList(context, events, _scrollController, ref)),
//
_buildSignalSender(context, ref, partyRoom, room),
],
),
),
],
),
);
}
//
Widget _buildRoomHeader(BuildContext context, dynamic room, List members, bool isOwner, PartyRoom partyRoom) {
return Container(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const Icon(FluentIcons.room, size: 16, color: Color(0xFFB5BAC1)),
const SizedBox(width: 8),
Expanded(
child: Text(
room?.ownerGameId ?? '房间',
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: Colors.white),
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(FluentIcons.group, size: 12, color: Color(0xFF80848E)),
const SizedBox(width: 4),
Text(
'${members.length}/${room?.targetMembers ?? 0} 成员',
style: const TextStyle(fontSize: 11, color: Color(0xFF80848E)),
),
],
),
if (isOwner) ...[
const SizedBox(height: 8),
SizedBox(
width: double.infinity,
child: Button(
onPressed: () async {
final confirmed = await showDialog<bool>(
context: context,
builder: (context) => ContentDialog(
title: const Text('确认解散'),
content: const Text('确定要解散房间吗?所有成员将被移出。'),
actions: [
Button(child: const Text('取消'), onPressed: () => Navigator.pop(context, false)),
FilledButton(
style: ButtonStyle(backgroundColor: WidgetStateProperty.all(const Color(0xFFDA373C))),
child: const Text('解散', style: TextStyle(color: Colors.white)),
onPressed: () => Navigator.pop(context, true),
),
],
),
);
if (confirmed == true) {
ref.read(partyRoomUIModelProvider.notifier).dismissRoom();
}
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.resolveWith((state) {
if (state.isHovered || state.isPressed) {
return const Color(0xFFB3261E);
}
return const Color(0xFFDA373C);
}),
),
child: const Text('解散房间', style: TextStyle(color: Colors.white)),
),
),
] else ...[
const SizedBox(height: 8),
SizedBox(
width: double.infinity,
child: Button(
onPressed: () async {
await partyRoom.leaveRoom();
},
style: ButtonStyle(backgroundColor: WidgetStateProperty.all(const Color(0xFF404249))),
child: const Text('离开房间', style: TextStyle(color: Color(0xFFB5BAC1))),
),
),
],
],
),
);
}
IconData _getSocialIcon(String link) {
if (link.contains('qq.com')) return FontAwesomeIcons.qq;
if (link.contains('discord')) return FontAwesomeIcons.discord;
if (link.contains('kook')) return FluentIcons.chat;
return FluentIcons.link;
}
String _getSocialName(String link) {
if (link.contains('discord')) return 'Discord';
if (link.contains('kook')) return 'KOOK';
if (link.contains('qq')) return 'QQ';
return '链接';
}
//
Widget _buildMembersSidebar(BuildContext context, WidgetRef ref, List members, bool isOwner, PartyRoom partyRoom) {
if (members.isEmpty) {
return Center(
child: Text('暂无成员', style: TextStyle(color: Colors.white.withValues(alpha: 0.5), fontSize: 12)),
);
}
return ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8),
itemCount: members.length,
itemBuilder: (context, index) {
final member = members[index];
return _buildMemberItem(context, ref, member, isOwner, partyRoom);
},
);
}
Widget _buildMemberItem(BuildContext context, WidgetRef ref, RoomMember member, bool isOwner, PartyRoom partyRoom) {
final avatarUrl = member.avatarUrl.isNotEmpty ? '${URLConf.rsiAvatarBaseUrl}${member.avatarUrl}' : null;
return Container(
margin: const EdgeInsets.symmetric(horizontal: 8, vertical: 1),
child: HoverButton(
onPressed: isOwner && !member.isOwner ? () => _showMemberContextMenu(context, member, partyRoom) : null,
builder: (context, states) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: states.isHovered ? const Color(0xFF404249) : Colors.transparent,
borderRadius: BorderRadius.circular(4),
),
child: Row(
children: [
//
makeUserAvatar(member.handleName, avatarUrl: avatarUrl, size: 32),
const SizedBox(width: 8),
//
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Flexible(
child: Text(
member.handleName.isNotEmpty ? member.handleName : member.gameUserId,
style: TextStyle(
fontSize: 13,
color: member.isOwner ? const Color(0xFFFAA81A) : const Color(0xFFDBDEE1),
fontWeight: member.isOwner ? FontWeight.bold : FontWeight.normal,
),
overflow: TextOverflow.ellipsis,
),
),
if (member.isOwner) ...[
const SizedBox(width: 4),
const Icon(FluentIcons.crown, size: 10, color: Color(0xFFFAA81A)),
],
],
),
if (member.status.currentLocation.isNotEmpty)
Text(
member.status.currentLocation,
style: const TextStyle(fontSize: 10, color: Color(0xFF80848E)),
overflow: TextOverflow.ellipsis,
),
],
),
),
//
Container(
width: 8,
height: 8,
decoration: const BoxDecoration(
color: Color(0xFF23A559), // 线绿
shape: BoxShape.circle,
),
),
],
),
);
},
),
);
}
Widget makeUserAvatar(String memberName, {String? avatarUrl, double size = 32}) {
return SizedBox(
width: size,
height: size,
child: avatarUrl == null
? CircleAvatar(
radius: 16,
backgroundColor: const Color(0xFF5865F2),
child: Text(
memberName.toUpperCase(),
style: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.bold),
),
)
: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: CacheNetImage(url: avatarUrl),
),
);
}
void _showMemberContextMenu(BuildContext context, dynamic member, PartyRoom partyRoom) async {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: Text(member.handleName.isNotEmpty ? member.handleName : member.gameUserId),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
FilledButton(
onPressed: () async {
Navigator.pop(context);
final confirmed = await showDialog<bool>(
context: context,
builder: (context) => ContentDialog(
title: const Text('转移房主'),
content: Text(
'确定要将房主转移给 ${member.handleName.isNotEmpty ? member.handleName : member.gameUserId} 吗?',
),
actions: [
Button(child: const Text('取消'), onPressed: () => Navigator.pop(context, false)),
FilledButton(child: const Text('转移'), onPressed: () => Navigator.pop(context, true)),
],
),
);
if (confirmed == true) {
await partyRoom.transferOwnership(member.gameUserId);
}
},
child: const Text('转移房主'),
),
const SizedBox(height: 8),
Button(
onPressed: () async {
Navigator.pop(context);
final confirmed = await showDialog<bool>(
context: context,
builder: (context) => ContentDialog(
title: const Text('踢出成员'),
content: Text('确定要踢出 ${member.handleName.isNotEmpty ? member.handleName : member.gameUserId} 吗?'),
actions: [
Button(child: const Text('取消'), onPressed: () => Navigator.pop(context, false)),
FilledButton(
style: ButtonStyle(backgroundColor: WidgetStateProperty.all(const Color(0xFFDA373C))),
child: const Text('踢出'),
onPressed: () => Navigator.pop(context, true),
),
],
),
);
if (confirmed == true) {
await partyRoom.kickMember(member.gameUserId);
}
},
style: ButtonStyle(backgroundColor: WidgetStateProperty.all(const Color(0xFFDA373C))),
child: const Text('踢出成员', style: TextStyle(color: Colors.white)),
),
],
),
actions: [Button(child: const Text('关闭'), onPressed: () => Navigator.pop(context))],
),
);
}
//
Widget _buildMessageList(BuildContext context, List events, ScrollController scrollController, WidgetRef ref) {
final partyRoomState = ref.watch(partyRoomProvider);
final room = partyRoomState.room.currentRoom;
final hasSocialLinks = room != null && room.socialLinks.isNotEmpty;
// +
final totalItems = (hasSocialLinks ? 1 : 0) + events.length;
if (totalItems == 0) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(FluentIcons.chat, size: 64, color: Color(0xFF404249)),
const SizedBox(height: 16),
Text('暂无消息', style: TextStyle(color: Colors.white.withValues(alpha: 0.5), fontSize: 14)),
const SizedBox(height: 4),
Text('发送一条信号开始对话吧!', style: TextStyle(color: Colors.white.withValues(alpha: 0.3), fontSize: 12)),
],
),
);
}
return ListView.builder(
controller: scrollController,
padding: const EdgeInsets.all(16),
itemCount: totalItems,
itemBuilder: (context, index) {
//
if (hasSocialLinks && index == 0) {
return _buildSocialLinksMessage(room);
}
//
final eventIndex = hasSocialLinks ? index - 1 : index;
final event = events[eventIndex];
return _buildMessageItem(event, ref);
},
);
}
//
Widget _buildSocialLinksMessage(dynamic room) {
return Container(
margin: const EdgeInsets.only(bottom: 16),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: const Color(0xFF2B2D31),
border: Border.all(color: const Color(0xFF5865F2).withValues(alpha: 0.3)),
borderRadius: BorderRadius.circular(8),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
padding: const EdgeInsets.all(6),
decoration: const BoxDecoration(color: Color(0xFF5865F2), shape: BoxShape.circle),
child: const Icon(FluentIcons.info, size: 14, color: Colors.white),
),
const SizedBox(width: 12),
const Expanded(
child: Text(
'该房间包含第三方社交连接,点击加入一起开黑吧~',
style: TextStyle(fontSize: 14, color: Color(0xFFDBDEE1), fontWeight: FontWeight.w500),
),
),
],
),
const SizedBox(height: 12),
Wrap(
spacing: 8,
runSpacing: 8,
children: room.socialLinks.map<Widget>((link) {
return HyperlinkButton(
onPressed: () => launchUrlString(link),
style: ButtonStyle(
padding: WidgetStateProperty.all(const EdgeInsets.symmetric(horizontal: 12, vertical: 8)),
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.isHovered) return const Color(0xFF4752C4);
return const Color(0xFF5865F2);
}),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(_getSocialIcon(link), size: 16, color: Colors.white),
const SizedBox(width: 8),
Text(
_getSocialName(link),
style: const TextStyle(fontSize: 13, color: Colors.white, fontWeight: FontWeight.w500),
),
],
),
);
}).toList(),
),
],
),
);
}
Widget _buildMessageItem(dynamic event, WidgetRef ref) {
final roomEvent = event as partroom.RoomEvent;
final isSignal = roomEvent.type == partroom.RoomEventType.SIGNAL_BROADCAST;
final userName = _getEventUserName(roomEvent);
final avatarUrl = _getEventAvatarUrl(roomEvent);
return Container(
margin: const EdgeInsets.only(bottom: 16),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
makeUserAvatar(userName, avatarUrl: avatarUrl, size: 28),
const SizedBox(width: 12),
//
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
userName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: isSignal ? Colors.white : const Color(0xFF80848E),
),
),
const SizedBox(width: 8),
Text(
_formatTime(roomEvent.timestamp),
style: const TextStyle(fontSize: 11, color: Color(0xFF80848E)),
),
],
),
const SizedBox(height: 4),
Text(
_getEventText(roomEvent, ref),
style: TextStyle(
fontSize: 14,
color: isSignal ? const Color(0xFFDBDEE1) : const Color(0xFF949BA4),
fontStyle: isSignal ? FontStyle.normal : FontStyle.italic,
),
),
],
),
),
],
),
);
}
String _getEventUserName(partroom.RoomEvent event) {
switch (event.type) {
case partroom.RoomEventType.SIGNAL_BROADCAST:
return event.signalSender.isNotEmpty ? event.signalSender : '未知用户';
case partroom.RoomEventType.MEMBER_JOINED:
case partroom.RoomEventType.MEMBER_LEFT:
case partroom.RoomEventType.MEMBER_KICKED:
return event.hasMember() && event.member.handleName.isNotEmpty
? event.member.handleName
: event.hasMember()
? event.member.gameUserId
: '未知用户';
case partroom.RoomEventType.OWNER_CHANGED:
return event.hasMember() && event.member.handleName.isNotEmpty ? event.member.handleName : '新房主';
default:
return '系统';
}
}
String? _getEventAvatarUrl(partroom.RoomEvent event) {
if (event.type == partroom.RoomEventType.SIGNAL_BROADCAST ||
event.type == partroom.RoomEventType.MEMBER_JOINED ||
event.type == partroom.RoomEventType.MEMBER_LEFT ||
event.type == partroom.RoomEventType.MEMBER_KICKED ||
event.type == partroom.RoomEventType.OWNER_CHANGED) {
if (event.hasMember() && event.member.avatarUrl.isNotEmpty) {
return '${URLConf.rsiAvatarBaseUrl}${event.member.avatarUrl}';
}
}
return null;
}
//
Widget _buildSignalSender(BuildContext context, WidgetRef ref, PartyRoom partyRoom, dynamic room) {
final partyRoomState = ref.watch(partyRoomProvider);
final signalTypes = partyRoomState.room.signalTypes.where((s) => !s.isSpecial).toList();
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xFF2B2D31).withValues(alpha: .4),
border: Border(top: BorderSide(color: Colors.black.withValues(alpha: 0.3))),
),
child: Row(
children: [
const Spacer(),
DropDownButton(
leading: const Icon(FluentIcons.send, size: 16),
title: Text(signalTypes.isEmpty ? '加载中...' : '发送信号'),
disabled: signalTypes.isEmpty || room == null,
items: signalTypes.map((signal) {
return MenuFlyoutItem(
leading: const Icon(FluentIcons.radio_bullet, size: 16),
text: Text(signal.name.isNotEmpty ? signal.name : signal.id),
onPressed: () => _sendSignal(context, ref, partyRoom, room, signal),
);
}).toList(),
),
],
),
);
}
Future<void> _sendSignal(
BuildContext context,
WidgetRef ref,
PartyRoom partyRoom,
dynamic room,
dynamic signal,
) async {
if (room == null) return;
try {
await partyRoom.sendSignal(signal.id);
//
if (context.mounted) {
//
}
} catch (e) {
//
if (context.mounted) {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: const Text('发送失败'),
content: Text(e.toString()),
actions: [FilledButton(child: const Text('确定'), onPressed: () => Navigator.pop(context))],
),
);
}
}
}
String _getEventText(partroom.RoomEvent event, WidgetRef ref) {
final partyRoomState = ref.read(partyRoomProvider);
final signalTypes = partyRoomState.room.signalTypes;
switch (event.type) {
case partroom.RoomEventType.SIGNAL_BROADCAST:
// signalTypes
final signalType = signalTypes.where((s) => s.id == event.signalId).firstOrNull;
// ID和参数
if (event.signalId.isNotEmpty) {
if (event.signalParams.isNotEmpty) {
final params = event.signalParams;
return "signalId: ${event.signalId}params:$params";
}
}
return signalType?.name ?? event.signalId;
case partroom.RoomEventType.MEMBER_JOINED:
return '加入了房间';
case partroom.RoomEventType.MEMBER_LEFT:
return '离开了房间';
case partroom.RoomEventType.OWNER_CHANGED:
return '成为了新房主';
case partroom.RoomEventType.ROOM_UPDATED:
return '房间信息已更新';
case partroom.RoomEventType.MEMBER_STATUS_UPDATED:
if (event.hasMember()) {
final member = event.member;
final name = member.handleName.isNotEmpty ? member.handleName : member.gameUserId;
if (member.hasStatus() && member.status.currentLocation.isNotEmpty) {
return '$name 更新了状态: ${member.status.currentLocation}';
}
return '$name 更新了状态';
}
return '成员状态已更新';
case partroom.RoomEventType.ROOM_DISMISSED:
return '房间已解散';
case partroom.RoomEventType.MEMBER_KICKED:
return '被踢出房间';
default:
return '未知事件';
}
}
String _formatTime(dynamic timestamp) {
try {
final date = DateTime.fromMillisecondsSinceEpoch(timestamp.toInt() * 1000);
final now = DateTime.now();
final diff = now.difference(date);
if (diff.inMinutes < 1) {
return '刚刚';
} else if (diff.inMinutes < 60) {
return '${diff.inMinutes} 分钟前';
} else if (diff.inHours < 24) {
return '${diff.inHours} 小时前';
} else {
return '${diff.inDays} 天前';
}
} catch (e) {
return '';
}
}
}

View File

@ -0,0 +1,371 @@
import 'dart:ui';
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:flutter_tilt/flutter_tilt.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
import 'package:starcitizen_doctor/provider/party_room.dart';
import 'package:starcitizen_doctor/ui/party_room/party_room_ui_model.dart';
import 'package:starcitizen_doctor/ui/party_room/widgets/create_room_dialog.dart';
import 'package:starcitizen_doctor/widgets/widgets.dart';
///
class PartyRoomListPage extends HookConsumerWidget {
const PartyRoomListPage({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final uiModel = ref.read(partyRoomUIModelProvider.notifier);
final uiState = ref.watch(partyRoomUIModelProvider);
final partyRoomState = ref.watch(partyRoomProvider);
final partyRoom = ref.read(partyRoomProvider.notifier);
final searchController = useTextEditingController();
final scrollController = useScrollController();
useEffect(() {
//
Future.microtask(() => uiModel.loadRoomList());
return null;
}, []);
//
useEffect(() {
void onScroll() {
if (scrollController.position.pixels >= scrollController.position.maxScrollExtent - 200) {
// 200px时开始加载
final totalPages = (uiState.totalRooms / uiState.pageSize).ceil();
if (!uiState.isLoading && uiState.currentPage < totalPages && uiState.errorMessage == null) {
uiModel.loadMoreRooms();
}
}
}
scrollController.addListener(onScroll);
return () => scrollController.removeListener(onScroll);
}, [uiState.isLoading, uiState.currentPage, uiState.totalRooms]);
return ScaffoldPage(
padding: EdgeInsets.zero,
content: Column(
children: [
//
Container(
padding: const EdgeInsets.all(16),
child: Row(
children: [
Expanded(
child: TextBox(
controller: searchController,
placeholder: '搜索房主名称...',
prefix: const Padding(padding: EdgeInsets.only(left: 8), child: Icon(FluentIcons.search)),
onSubmitted: (value) {
uiModel.loadRoomList(searchName: value, page: 1);
},
),
),
const SizedBox(width: 12),
_buildTagFilter(context, ref, uiState, partyRoomState),
const SizedBox(width: 12),
IconButton(icon: const Icon(FluentIcons.refresh), onPressed: () => uiModel.refreshRoomList()),
const SizedBox(width: 12),
FilledButton(
onPressed: () => _showCreateRoomDialog(context, ref),
child: const Row(
mainAxisSize: MainAxisSize.min,
children: [Icon(FluentIcons.add, size: 16), SizedBox(width: 8), Text('创建房间')],
),
),
],
),
),
//
Expanded(child: _buildRoomList(context, ref, uiState, partyRoom, scrollController)),
],
),
);
}
Widget _buildTagFilter(
BuildContext context,
WidgetRef ref,
PartyRoomUIState uiState,
PartyRoomFullState partyRoomState,
) {
final tags = partyRoomState.room.tags;
return ComboBox<String>(
placeholder: const Text('选择标签'),
value: uiState.selectedMainTagId,
items: [
const ComboBoxItem(value: null, child: Text('全部标签')),
...tags.map((tag) => ComboBoxItem(value: tag.id, child: Text(tag.name))),
],
onChanged: (value) {
ref.read(partyRoomUIModelProvider.notifier).setSelectedMainTagId(value);
},
);
}
Widget _buildRoomList(
BuildContext context,
WidgetRef ref,
PartyRoomUIState uiState,
PartyRoom partyRoom,
ScrollController scrollController,
) {
if (uiState.isLoading && uiState.roomListItems.isEmpty) {
return const Center(child: ProgressRing());
}
if (uiState.errorMessage != null && uiState.roomListItems.isEmpty) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(FluentIcons.error, size: 48, color: Color(0xFFFF6B6B)),
const SizedBox(height: 16),
Text(uiState.errorMessage!, style: const TextStyle(color: Color(0xFFE0E0E0))),
const SizedBox(height: 16),
FilledButton(
onPressed: () {
ref.read(partyRoomUIModelProvider.notifier).refreshRoomList();
},
child: const Text('重试'),
),
],
),
);
}
if (uiState.roomListItems.isEmpty) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(FluentIcons.room, size: 48, color: Colors.grey.withValues(alpha: 0.6)),
const SizedBox(height: 16),
Text('暂无房间', style: TextStyle(color: Colors.white.withValues(alpha: 0.7))),
const SizedBox(height: 8),
Text('成为第一个创建房间的人吧!', style: TextStyle(fontSize: 12, color: Colors.white.withValues(alpha: 0.5))),
const SizedBox(height: 16),
FilledButton(onPressed: () => _showCreateRoomDialog(context, ref), child: const Text('创建房间')),
],
),
);
}
final totalPages = (uiState.totalRooms / uiState.pageSize).ceil();
final hasMore = uiState.currentPage < totalPages;
return MasonryGridView.count(
controller: scrollController,
crossAxisCount: 3,
mainAxisSpacing: 12,
crossAxisSpacing: 12,
itemCount: uiState.roomListItems.length + (hasMore || uiState.isLoading ? 1 : 0),
padding: const EdgeInsets.all(16),
itemBuilder: (context, index) {
//
if (index == uiState.roomListItems.length) {
return Container(
padding: const EdgeInsets.all(24),
child: Center(
child: uiState.isLoading
? const ProgressRing()
: Text('已加载全部房间', style: TextStyle(color: Colors.white.withValues(alpha: 0.5))),
),
);
}
final room = uiState.roomListItems[index];
return _buildRoomCard(context, ref, partyRoom, room, index);
},
);
}
Widget _buildRoomCard(BuildContext context, WidgetRef ref, PartyRoom partyRoom, dynamic room, int index) {
final avatarUrl = room.ownerAvatar.isNotEmpty ? '${URLConf.rsiAvatarBaseUrl}${room.ownerAvatar}' : '';
return GridItemAnimator(
index: index,
child: GestureDetector(
onTap: () => _joinRoom(context, ref, partyRoom, room),
child: Tilt(
shadowConfig: const ShadowConfig(maxIntensity: .3),
borderRadius: BorderRadius.circular(12),
clipBehavior: Clip.hardEdge,
child: Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)),
clipBehavior: Clip.hardEdge,
child: Stack(
children: [
//
if (avatarUrl.isNotEmpty)
Positioned.fill(
child: CacheNetImage(url: avatarUrl, fit: BoxFit.cover),
),
//
Positioned.fill(
child: Container(decoration: BoxDecoration(color: Colors.black.withValues(alpha: 0.6))),
),
//
Positioned.fill(
child: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 15.0, sigmaY: 15.0),
child: Container(color: Colors.transparent),
),
),
),
//
Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
//
Row(
children: [
CircleAvatar(
radius: 24,
backgroundColor: const Color(0xFF4A9EFF).withValues(alpha: 0.5),
backgroundImage: avatarUrl.isNotEmpty ? NetworkImage(avatarUrl) : null,
child: avatarUrl.isEmpty ? const Icon(FluentIcons.contact, color: Colors.white) : null,
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Flexible(
child: Text(
room.ownerHandleName.isNotEmpty ? room.ownerHandleName : room.ownerGameId,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
),
if (room.hasPassword) ...[
const SizedBox(width: 4),
Icon(FluentIcons.lock, size: 12, color: Colors.white.withValues(alpha: 0.7)),
],
],
),
const SizedBox(height: 2),
Row(
children: [
Icon(FluentIcons.group, size: 11, color: Colors.white.withValues(alpha: 0.6)),
const SizedBox(width: 4),
Text(
'${room.currentMembers}/${room.targetMembers}',
style: TextStyle(fontSize: 11, color: Colors.white.withValues(alpha: 0.7)),
),
],
),
],
),
),
],
),
const SizedBox(height: 12),
//
Wrap(
spacing: 6,
runSpacing: 6,
children: [
if (room.mainTagId.isNotEmpty)
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: const Color(0xFF4A9EFF).withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(4),
),
child: Text(
room.mainTagId,
style: const TextStyle(fontSize: 11, color: Color(0xFF4A9EFF)),
),
),
if (room.socialLinks.isNotEmpty)
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: Colors.green.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(4),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(FluentIcons.link, size: 10, color: Colors.green.withValues(alpha: 0.8)),
const SizedBox(width: 4),
Text(
'${room.socialLinks.length}',
style: TextStyle(fontSize: 11, color: Colors.green.withValues(alpha: 0.9)),
),
],
),
),
],
),
],
),
),
],
),
),
),
),
);
}
Future<void> _showCreateRoomDialog(BuildContext context, WidgetRef ref) async {
await showDialog(context: context, builder: (context) => const CreateRoomDialog());
}
Future<void> _joinRoom(BuildContext context, WidgetRef ref, PartyRoom partyRoom, dynamic room) async {
String? password;
if (room.hasPassword) {
password = await showDialog<String>(
context: context,
builder: (context) {
final passwordController = TextEditingController();
return ContentDialog(
title: const Text('输入房间密码'),
content: TextBox(controller: passwordController, placeholder: '请输入密码', obscureText: true),
actions: [
Button(child: const Text('取消'), onPressed: () => Navigator.pop(context)),
FilledButton(child: const Text('加入'), onPressed: () => Navigator.pop(context, passwordController.text)),
],
);
},
);
if (password == null) return;
}
try {
await partyRoom.joinRoom(room.roomUuid, password: password);
} catch (e) {
if (context.mounted) {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: const Text('加入失败'),
content: Text(e.toString()),
actions: [FilledButton(child: const Text('确定'), onPressed: () => Navigator.pop(context))],
),
);
}
}
}
}

View File

@ -0,0 +1,364 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:starcitizen_doctor/ui/party_room/party_room_ui_model.dart';
import 'package:url_launcher/url_launcher_string.dart';
///
class PartyRoomRegisterPage extends HookConsumerWidget {
const PartyRoomRegisterPage({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final uiModel = ref.read(partyRoomUIModelProvider.notifier);
final uiState = ref.watch(partyRoomUIModelProvider);
final gameIdController = useTextEditingController();
final currentStep = useState(0);
return ScaffoldPage(
padding: EdgeInsets.zero,
content: Center(
child: SizedBox(
width: MediaQuery.of(context).size.width * .6,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const Expanded(
child: Text(
'注册账号',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0)),
),
),
],
),
const SizedBox(height: 24),
if (uiState.errorMessage != null) ...[
InfoBar(
title: const Text('错误'),
content: Text(uiState.errorMessage!),
severity: InfoBarSeverity.error,
onClose: () => uiModel.clearError(),
),
const SizedBox(height: 16),
],
//
Row(
children: [
_buildStepIndicator(
context,
number: 1,
title: '输入游戏ID',
isActive: currentStep.value == 0,
isCompleted: currentStep.value > 0,
),
const Expanded(child: Divider()),
_buildStepIndicator(
context,
number: 2,
title: '验证RSI账号',
isActive: currentStep.value == 1,
isCompleted: currentStep.value > 1,
),
const Expanded(child: Divider()),
_buildStepIndicator(
context,
number: 3,
title: '完成注册',
isActive: currentStep.value == 2,
isCompleted: false,
),
],
),
const SizedBox(height: 24),
if (currentStep.value == 0) ..._buildStep1(context, uiModel, uiState, gameIdController, currentStep),
if (currentStep.value == 1) ..._buildStep2(context, uiModel, uiState, gameIdController, currentStep),
if (currentStep.value == 2) ..._buildStep3(context, uiModel, uiState, currentStep),
const SizedBox(height: 16),
const Divider(),
const SizedBox(height: 16),
InfoBar(
title: const Text('关于账号验证'),
content: const Text('接下来,您需要在 RSI 账号简介中添加验证码以证明账号所有权,验证通过后,您可以移除该验证码。'),
severity: InfoBarSeverity.info,
),
],
),
),
),
);
}
static Widget _buildStepIndicator(
BuildContext context, {
required int number,
required String title,
required bool isActive,
required bool isCompleted,
}) {
return Column(
children: [
Container(
width: 32,
height: 32,
decoration: BoxDecoration(
color: isCompleted
? const Color(0xFF4CAF50)
: isActive
? const Color(0xFF4A9EFF)
: Colors.grey.withValues(alpha: 0.3),
shape: BoxShape.circle,
),
child: Center(
child: isCompleted
? const Icon(FluentIcons.check_mark, size: 16, color: Colors.white)
: Text(
'$number',
style: TextStyle(
color: isActive ? Colors.white : Colors.grey.withValues(alpha: 0.7),
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 4),
Text(
title,
style: TextStyle(
fontSize: 11,
color: isActive ? const Color(0xFF4A9EFF) : Colors.grey.withValues(alpha: 0.7),
fontWeight: isActive ? FontWeight.bold : FontWeight.normal,
),
),
],
);
}
static List<Widget> _buildStep1(
BuildContext context,
PartyRoomUIModel uiModel,
PartyRoomUIState uiState,
TextEditingController gameIdController,
ValueNotifier<int> currentStep,
) {
return [
const Text(
'步骤 1: 输入您的游戏ID',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0)),
),
const SizedBox(height: 12),
Text(
'请输入您在星际公民中的游戏IDHandle'
'这是您在游戏中使用的唯一标识符。',
style: TextStyle(fontSize: 13, color: Colors.white.withValues(alpha: 0.6)),
),
const SizedBox(height: 16),
TextBox(
controller: gameIdController,
placeholder: '例如: Citizen123',
enabled: !uiState.isLoading,
onSubmitted: (value) async {
if (value.trim().isEmpty) return;
await _requestVerificationCode(uiModel, uiState, value.trim(), currentStep);
},
),
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Button(
onPressed: () {
launchUrlString('https://robertsspaceindustries.com/en/account/dashboard');
},
child: const Text('查看我的游戏ID'),
),
const SizedBox(width: 8),
FilledButton(
onPressed: uiState.isLoading
? null
: () async {
final gameId = gameIdController.text.trim();
if (gameId.isEmpty) {
await showDialog(
context: context,
builder: (context) => ContentDialog(
title: const Text('提示'),
content: const Text('请输入游戏ID'),
actions: [FilledButton(child: const Text('确定'), onPressed: () => Navigator.pop(context))],
),
);
return;
}
await _requestVerificationCode(uiModel, uiState, gameId, currentStep);
},
child: uiState.isLoading
? const SizedBox(width: 16, height: 16, child: ProgressRing(strokeWidth: 2))
: const Text('下一步'),
),
],
),
];
}
static Future<void> _requestVerificationCode(
PartyRoomUIModel uiModel,
PartyRoomUIState uiState,
String gameId,
ValueNotifier<int> currentStep,
) async {
try {
await uiModel.requestPreRegister(gameId);
currentStep.value = 1;
} catch (e) {
// state
}
}
static List<Widget> _buildStep2(
BuildContext context,
PartyRoomUIModel uiModel,
PartyRoomUIState uiState,
TextEditingController gameIdController,
ValueNotifier<int> currentStep,
) {
return [
const Text(
'步骤 2: 验证 RSI 账号',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0)),
),
const SizedBox(height: 12),
Text('请按照以下步骤完成账号验证:', style: TextStyle(fontSize: 13, color: Colors.white.withValues(alpha: 0.6))),
const SizedBox(height: 16),
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xFF1E3A5F).withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: const Color(0xFF4A9EFF).withValues(alpha: 0.3)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'1. 复制以下验证码:',
style: TextStyle(fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0)),
),
const SizedBox(height: 8),
Row(
children: [
SelectableText(
'SCB:${uiState.preRegisterCode}',
style: const TextStyle(
fontSize: 16,
fontFamily: 'monospace',
fontWeight: FontWeight.bold,
color: Color(0xFF4A9EFF),
),
),
SizedBox(width: 12),
Button(
child: Icon(FluentIcons.copy),
onPressed: () {
Clipboard.setData(ClipboardData(text: 'SCB:${uiState.preRegisterCode}'));
},
),
],
),
const SizedBox(height: 16),
const Text(
'2. 访问您的 RSI 账号资设置页',
style: TextStyle(fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0)),
),
const SizedBox(height: 8),
Button(
onPressed: () {
launchUrlString('https://robertsspaceindustries.com/en/account/profile');
},
child: const Text('打开资料页'),
),
const SizedBox(height: 16),
const Text(
'3. 编辑您的个人简介,将验证码添加到简介中',
style: TextStyle(fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0)),
),
const SizedBox(height: 8),
Text(
'在简介的任意位置添加验证码即可验证码30分钟内有效',
style: TextStyle(fontSize: 12, color: Colors.white.withValues(alpha: 0.5)),
),
],
),
),
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Button(
onPressed: () {
currentStep.value = 0;
},
child: const Text('上一步'),
),
FilledButton(
onPressed: uiState.isLoading
? null
: () async {
await _completeRegistration(uiModel, currentStep);
},
child: uiState.isLoading
? const SizedBox(width: 16, height: 16, child: ProgressRing(strokeWidth: 2))
: const Text('我已添加,验证并注册'),
),
],
),
];
}
static Future<void> _completeRegistration(PartyRoomUIModel uiModel, ValueNotifier<int> currentStep) async {
try {
await uiModel.completeRegister();
currentStep.value = 2;
} catch (e) {
// state
}
}
static List<Widget> _buildStep3(
BuildContext context,
PartyRoomUIModel uiModel,
PartyRoomUIState uiState,
ValueNotifier<int> currentStep,
) {
return [
Center(
child: Column(
children: [
const Icon(FluentIcons.completed_solid, size: 64, color: Color(0xFF4CAF50)),
const SizedBox(height: 16),
const Text(
'注册成功!',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: Color(0xFFE0E0E0)),
),
const SizedBox(height: 8),
Text('您已成功注册组队大厅,现在可以开始使用了', style: TextStyle(fontSize: 13, color: Colors.white.withValues(alpha: 0.6))),
],
),
),
];
}
}

View File

@ -78,10 +78,10 @@ packages:
dependency: transitive
description:
name: build
sha256: ce76b1d48875e3233fde17717c23d1f60a91cc631597e49a400c89b475395b1d
sha256: dfb67ccc9a78c642193e0c2d94cb9e48c2c818b3178a86097d644acdcde6a8d9
url: "https://pub.dev"
source: hosted
version: "3.1.0"
version: "4.0.2"
build_cli_annotations:
dependency: transitive
description:
@ -106,30 +106,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.0"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: d1d57f7807debd7349b4726a19fd32ec8bc177c71ad0febf91a20f84cd2d4b46
url: "https://pub.dev"
source: hosted
version: "3.0.3"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: b24597fceb695969d47025c958f3837f9f0122e237c6a22cb082a5ac66c3ca30
sha256: "7b5b569f3df370590a85029148d6fc66c7d0201fc6f1847c07dd85d365ae9fcd"
url: "https://pub.dev"
source: hosted
version: "2.7.1"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "066dda7f73d8eb48ba630a55acb50c4a84a2e6b453b1cb4567f581729e794f7b"
url: "https://pub.dev"
source: hosted
version: "9.3.1"
version: "2.10.3"
built_collection:
dependency: transitive
description:
@ -606,6 +590,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "17.0.0"
google_identity_services_web:
dependency: transitive
description:
name: google_identity_services_web
sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454"
url: "https://pub.dev"
source: hosted
version: "0.3.3+1"
googleapis_auth:
dependency: transitive
description:
name: googleapis_auth
sha256: b81fe352cc4a330b3710d2b7ad258d9bcef6f909bb759b306bf42973a7d046db
url: "https://pub.dev"
source: hosted
version: "2.0.0"
graphs:
dependency: transitive
description:
@ -614,6 +614,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.2"
grpc:
dependency: "direct main"
description:
name: grpc
sha256: d5711432e7fcb41d23f88461651d503db98661af73ac7df211ace9c92fd03753
url: "https://pub.dev"
source: hosted
version: "5.0.0"
hexcolor:
dependency: "direct main"
description:
@ -670,6 +678,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.6.0"
http2:
dependency: transitive
description:
name: http2
sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
http_client_helper:
dependency: transitive
description:
@ -1022,6 +1038,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.0.3"
protobuf:
dependency: "direct main"
description:
name: protobuf
sha256: "2fcc8a202ca7ec17dab7c97d6b6d91cf03aa07fe6f65f8afbb6dfa52cc5bd902"
url: "https://pub.dev"
source: hosted
version: "5.1.0"
pub_semver:
dependency: transitive
description:
@ -1385,14 +1409,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.12"
timing:
dependency: transitive
description:
name: timing
sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
translator:
dependency: transitive
description:

View File

@ -58,7 +58,7 @@ dependencies:
aria2:
git: https://github.com/xkeyC/dart_aria2_rpc.git
# path: ../../xkeyC/dart_aria2_rpc
intl: any
intl: ^0.20.2
synchronized: ^3.4.0
super_sliver_list: ^0.4.1
file: ^7.0.1
@ -71,6 +71,10 @@ dependencies:
path: ^1.9.1
crypto: ^3.0.7
xml: ^6.6.1
# gRPC and protobuf
grpc: ^5.0.0
protobuf: ^5.1.0
dependency_overrides:
http: ^1.6.0
intl: ^0.20.2
@ -80,7 +84,7 @@ dev_dependencies:
sdk: flutter
flutter_lints: ^6.0.0
msix: ^3.16.12
build_runner: 2.7.1
build_runner: 2.10.3
freezed: ^3.2.3
json_serializable: ^6.11.1
riverpod_generator: ^3.0.3

View File

@ -1 +0,0 @@
protoc --dart_out=grpc:lib/generated/grpc/party_room_server -I../party_room_server/protos/ ../party_room_server/protos/*.proto