fff
4 months ago
18 changed files with 1008 additions and 216 deletions
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
|
@ -0,0 +1,72 @@
|
||||
import 'dart:typed_data'; |
||||
|
||||
|
||||
|
||||
/** |
||||
* |
||||
* 需要按照格式严格封装 |
||||
* |
||||
* |
||||
* 4个字节 放全部信息长度 头+body |
||||
* 2字节 header长度 |
||||
* 2字节 默认填1 |
||||
* 4字节 登录1,消息5 |
||||
* 4字节 默认填1 |
||||
* 不限制长度body 但是不要超过2048-16 |
||||
* 需要严格控制每条消息发送不超过 2048 |
||||
*/ |
||||
|
||||
|
||||
class Proto { |
||||
static const int HEADER_LENGTH = 16; // 假设头部长度为16字节 |
||||
static const int VERSION = 1; |
||||
|
||||
int operation; |
||||
int seqId; |
||||
Uint8List body; |
||||
|
||||
Proto(this.operation, this.seqId, this.body); |
||||
|
||||
Uint8List toBytes() { |
||||
final buffer = BytesBuilder(); |
||||
buffer.add(_intToBytes(HEADER_LENGTH + body.length, 4)); |
||||
buffer.add(_shortToBytes(HEADER_LENGTH, 2)); |
||||
buffer.add(_shortToBytes(VERSION, 2)); |
||||
buffer.add(_intToBytes(operation, 4)); |
||||
buffer.add(_intToBytes(seqId, 4)); |
||||
buffer.add(body); |
||||
return buffer.toBytes(); |
||||
} |
||||
|
||||
|
||||
static Proto fromBytes(Uint8List data) { |
||||
final buffer = ByteData.sublistView(data); |
||||
int offset = 0; |
||||
|
||||
int packetLen = buffer.getInt32(offset, Endian.big); |
||||
offset += 4; |
||||
int headerLen = buffer.getInt16(offset, Endian.big); |
||||
offset += 2; |
||||
int version = buffer.getInt16(offset, Endian.big); |
||||
offset += 2; |
||||
int operation = buffer.getInt32(offset, Endian.big); |
||||
offset += 4; |
||||
int seqId = buffer.getInt32(offset, Endian.big); |
||||
offset += 4; |
||||
Uint8List body = data.sublist(offset); |
||||
|
||||
return Proto(operation, seqId, body); |
||||
} |
||||
|
||||
List<int> _intToBytes(int value, int length) { |
||||
final bytes = ByteData(length); |
||||
bytes.setInt32(0, value, Endian.big); |
||||
return bytes.buffer.asUint8List(); |
||||
} |
||||
|
||||
List<int> _shortToBytes(int value, int length) { |
||||
final bytes = ByteData(length); |
||||
bytes.setInt16(0, value, Endian.big); |
||||
return bytes.buffer.asUint8List(); |
||||
} |
||||
} |
@ -0,0 +1,60 @@
|
||||
|
||||
|
||||
|
||||
import 'dart:convert'; |
||||
import 'dart:io'; |
||||
|
||||
import 'package:flutter/foundation.dart'; |
||||
import 'package:huixiang/im/Proto.dart'; |
||||
import 'package:huixiang/im/out/auth.pb.dart'; |
||||
import 'package:huixiang/im/out/message.pb.dart'; |
||||
|
||||
class SocketClient { |
||||
|
||||
Socket _socket; |
||||
|
||||
connect() async { |
||||
_socket = await Socket.connect('192.168.10.129', 9090); |
||||
_socket.listen((data) { |
||||
print(data); |
||||
print("socket-listen"); |
||||
Proto proto = Proto.fromBytes(data); |
||||
print("socket-listen: $proto"); |
||||
MsgData data1 = MsgData.fromBuffer(proto.body); |
||||
print('收到来自:${data1.from},消息内容: ${utf8.decode(data1.data)} '); |
||||
|
||||
callbacks.forEach((callback) { |
||||
callback.call(data1); |
||||
}); |
||||
|
||||
}); |
||||
} |
||||
|
||||
List<Function> callbacks = []; |
||||
|
||||
addCallback(Function callback) { |
||||
callbacks.add(callback); |
||||
} |
||||
|
||||
removeCallback(Function callback) { |
||||
callbacks.remove(callback); |
||||
} |
||||
|
||||
authRequest(String token) { |
||||
final authReq = AuthReq() |
||||
..uid = 1 |
||||
..token = '123456'; |
||||
final authReqBytes = authReq.writeToBuffer(); |
||||
final proto = Proto(1, 1, authReqBytes); // 假设 operation 和 seqId 为 1 |
||||
final protoBytes = proto.toBytes(); |
||||
_socket.add(protoBytes); |
||||
} |
||||
|
||||
sendMessage(var to, String content) { |
||||
Uint8List data = utf8.encode(content); |
||||
MsgData msgData = MsgData(to: to,from: 2,type: MsgType.SINGLE_TEXT,data: data); |
||||
final proto2 = Proto(5,1,msgData.writeToBuffer()); |
||||
_socket.add(proto2.toBytes()); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,160 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:core' as $core; |
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb; |
||||
|
||||
class AuthReq extends $pb.GeneratedMessage { |
||||
factory AuthReq({ |
||||
$core.int? uid, |
||||
$core.String? token, |
||||
}) { |
||||
final $result = create(); |
||||
if (uid != null) { |
||||
$result.uid = uid; |
||||
} |
||||
if (token != null) { |
||||
$result.token = token; |
||||
} |
||||
return $result; |
||||
} |
||||
AuthReq._() : super(); |
||||
factory AuthReq.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory AuthReq.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AuthReq', createEmptyInstance: create) |
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'uid', $pb.PbFieldType.OU3) |
||||
..aOS(2, _omitFieldNames ? '' : 'token') |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthReq clone() => AuthReq()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthReq copyWith(void Function(AuthReq) updates) => super.copyWith((message) => updates(message as AuthReq)) as AuthReq; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthReq create() => AuthReq._(); |
||||
AuthReq createEmptyInstance() => create(); |
||||
static $pb.PbList<AuthReq> createRepeated() => $pb.PbList<AuthReq>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthReq getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<AuthReq>(create); |
||||
static AuthReq? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.int get uid => $_getIZ(0); |
||||
@$pb.TagNumber(1) |
||||
set uid($core.int v) { $_setUnsignedInt32(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasUid() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearUid() => clearField(1); |
||||
|
||||
@$pb.TagNumber(2) |
||||
$core.String get token => $_getSZ(1); |
||||
@$pb.TagNumber(2) |
||||
set token($core.String v) { $_setString(1, v); } |
||||
@$pb.TagNumber(2) |
||||
$core.bool hasToken() => $_has(1); |
||||
@$pb.TagNumber(2) |
||||
void clearToken() => clearField(2); |
||||
} |
||||
|
||||
class AuthResp extends $pb.GeneratedMessage { |
||||
factory AuthResp({ |
||||
$core.int? uid, |
||||
$core.int? code, |
||||
$core.String? message, |
||||
}) { |
||||
final $result = create(); |
||||
if (uid != null) { |
||||
$result.uid = uid; |
||||
} |
||||
if (code != null) { |
||||
$result.code = code; |
||||
} |
||||
if (message != null) { |
||||
$result.message = message; |
||||
} |
||||
return $result; |
||||
} |
||||
AuthResp._() : super(); |
||||
factory AuthResp.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory AuthResp.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AuthResp', createEmptyInstance: create) |
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'uid', $pb.PbFieldType.OU3) |
||||
..a<$core.int>(2, _omitFieldNames ? '' : 'code', $pb.PbFieldType.OU3) |
||||
..aOS(3, _omitFieldNames ? '' : 'message') |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthResp clone() => AuthResp()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthResp copyWith(void Function(AuthResp) updates) => super.copyWith((message) => updates(message as AuthResp)) as AuthResp; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthResp create() => AuthResp._(); |
||||
AuthResp createEmptyInstance() => create(); |
||||
static $pb.PbList<AuthResp> createRepeated() => $pb.PbList<AuthResp>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthResp getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<AuthResp>(create); |
||||
static AuthResp? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.int get uid => $_getIZ(0); |
||||
@$pb.TagNumber(1) |
||||
set uid($core.int v) { $_setUnsignedInt32(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasUid() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearUid() => clearField(1); |
||||
|
||||
@$pb.TagNumber(2) |
||||
$core.int get code => $_getIZ(1); |
||||
@$pb.TagNumber(2) |
||||
set code($core.int v) { $_setUnsignedInt32(1, v); } |
||||
@$pb.TagNumber(2) |
||||
$core.bool hasCode() => $_has(1); |
||||
@$pb.TagNumber(2) |
||||
void clearCode() => clearField(2); |
||||
|
||||
@$pb.TagNumber(3) |
||||
$core.String get message => $_getSZ(2); |
||||
@$pb.TagNumber(3) |
||||
set message($core.String v) { $_setString(2, v); } |
||||
@$pb.TagNumber(3) |
||||
$core.bool hasMessage() => $_has(2); |
||||
@$pb.TagNumber(3) |
||||
void clearMessage() => clearField(3); |
||||
} |
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); |
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); |
@ -0,0 +1,11 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
@ -0,0 +1,43 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:convert' as $convert; |
||||
import 'dart:core' as $core; |
||||
import 'dart:typed_data' as $typed_data; |
||||
|
||||
@$core.Deprecated('Use authReqDescriptor instead') |
||||
const AuthReq$json = { |
||||
'1': 'AuthReq', |
||||
'2': [ |
||||
{'1': 'uid', '3': 1, '4': 1, '5': 13, '10': 'uid'}, |
||||
{'1': 'token', '3': 2, '4': 1, '5': 9, '10': 'token'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `AuthReq`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List authReqDescriptor = $convert.base64Decode( |
||||
'CgdBdXRoUmVxEhAKA3VpZBgBIAEoDVIDdWlkEhQKBXRva2VuGAIgASgJUgV0b2tlbg=='); |
||||
|
||||
@$core.Deprecated('Use authRespDescriptor instead') |
||||
const AuthResp$json = { |
||||
'1': 'AuthResp', |
||||
'2': [ |
||||
{'1': 'uid', '3': 1, '4': 1, '5': 13, '10': 'uid'}, |
||||
{'1': 'code', '3': 2, '4': 1, '5': 13, '10': 'code'}, |
||||
{'1': 'message', '3': 3, '4': 1, '5': 9, '10': 'message'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `AuthResp`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List authRespDescriptor = $convert.base64Decode( |
||||
'CghBdXRoUmVzcBIQCgN1aWQYASABKA1SA3VpZBISCgRjb2RlGAIgASgNUgRjb2RlEhgKB21lc3' |
||||
'NhZ2UYAyABKAlSB21lc3NhZ2U='); |
||||
|
@ -0,0 +1,14 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names |
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
export 'auth.pb.dart'; |
||||
|
@ -0,0 +1,272 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:core' as $core; |
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb; |
||||
|
||||
import 'message.pbenum.dart'; |
||||
|
||||
export 'message.pbenum.dart'; |
||||
|
||||
class MsgData extends $pb.GeneratedMessage { |
||||
factory MsgData({ |
||||
$core.int? to, |
||||
$core.int? from, |
||||
$core.int? ctime, |
||||
MsgType? type, |
||||
$core.List<$core.int>? data, |
||||
}) { |
||||
final $result = create(); |
||||
if (to != null) { |
||||
$result.to = to; |
||||
} |
||||
if (from != null) { |
||||
$result.from = from; |
||||
} |
||||
if (ctime != null) { |
||||
$result.ctime = ctime; |
||||
} |
||||
if (type != null) { |
||||
$result.type = type; |
||||
} |
||||
if (data != null) { |
||||
$result.data = data; |
||||
} |
||||
return $result; |
||||
} |
||||
MsgData._() : super(); |
||||
factory MsgData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgData', createEmptyInstance: create) |
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'to', $pb.PbFieldType.OU3) |
||||
..a<$core.int>(2, _omitFieldNames ? '' : 'from', $pb.PbFieldType.OU3) |
||||
..a<$core.int>(3, _omitFieldNames ? '' : 'ctime', $pb.PbFieldType.OU3) |
||||
..e<MsgType>(4, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: MsgType.SINGLE_TEXT, valueOf: MsgType.valueOf, enumValues: MsgType.values) |
||||
..a<$core.List<$core.int>>(5, _omitFieldNames ? '' : 'data', $pb.PbFieldType.OY) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgData clone() => MsgData()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgData copyWith(void Function(MsgData) updates) => super.copyWith((message) => updates(message as MsgData)) as MsgData; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgData create() => MsgData._(); |
||||
MsgData createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgData> createRepeated() => $pb.PbList<MsgData>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgData>(create); |
||||
static MsgData? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.int get to => $_getIZ(0); |
||||
@$pb.TagNumber(1) |
||||
set to($core.int v) { $_setUnsignedInt32(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasTo() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearTo() => clearField(1); |
||||
|
||||
@$pb.TagNumber(2) |
||||
$core.int get from => $_getIZ(1); |
||||
@$pb.TagNumber(2) |
||||
set from($core.int v) { $_setUnsignedInt32(1, v); } |
||||
@$pb.TagNumber(2) |
||||
$core.bool hasFrom() => $_has(1); |
||||
@$pb.TagNumber(2) |
||||
void clearFrom() => clearField(2); |
||||
|
||||
@$pb.TagNumber(3) |
||||
$core.int get ctime => $_getIZ(2); |
||||
@$pb.TagNumber(3) |
||||
set ctime($core.int v) { $_setUnsignedInt32(2, v); } |
||||
@$pb.TagNumber(3) |
||||
$core.bool hasCtime() => $_has(2); |
||||
@$pb.TagNumber(3) |
||||
void clearCtime() => clearField(3); |
||||
|
||||
@$pb.TagNumber(4) |
||||
MsgType get type => $_getN(3); |
||||
@$pb.TagNumber(4) |
||||
set type(MsgType v) { setField(4, v); } |
||||
@$pb.TagNumber(4) |
||||
$core.bool hasType() => $_has(3); |
||||
@$pb.TagNumber(4) |
||||
void clearType() => clearField(4); |
||||
|
||||
@$pb.TagNumber(5) |
||||
$core.List<$core.int> get data => $_getN(4); |
||||
@$pb.TagNumber(5) |
||||
set data($core.List<$core.int> v) { $_setBytes(4, v); } |
||||
@$pb.TagNumber(5) |
||||
$core.bool hasData() => $_has(4); |
||||
@$pb.TagNumber(5) |
||||
void clearData() => clearField(5); |
||||
} |
||||
|
||||
class MsgNotify extends $pb.GeneratedMessage { |
||||
factory MsgNotify({ |
||||
$core.int? seq, |
||||
}) { |
||||
final $result = create(); |
||||
if (seq != null) { |
||||
$result.seq = seq; |
||||
} |
||||
return $result; |
||||
} |
||||
MsgNotify._() : super(); |
||||
factory MsgNotify.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgNotify.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgNotify', createEmptyInstance: create) |
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'seq', $pb.PbFieldType.OU3) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgNotify clone() => MsgNotify()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgNotify copyWith(void Function(MsgNotify) updates) => super.copyWith((message) => updates(message as MsgNotify)) as MsgNotify; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgNotify create() => MsgNotify._(); |
||||
MsgNotify createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgNotify> createRepeated() => $pb.PbList<MsgNotify>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgNotify getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgNotify>(create); |
||||
static MsgNotify? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.int get seq => $_getIZ(0); |
||||
@$pb.TagNumber(1) |
||||
set seq($core.int v) { $_setUnsignedInt32(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasSeq() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearSeq() => clearField(1); |
||||
} |
||||
|
||||
class MsgSync extends $pb.GeneratedMessage { |
||||
factory MsgSync({ |
||||
$core.int? seq, |
||||
}) { |
||||
final $result = create(); |
||||
if (seq != null) { |
||||
$result.seq = seq; |
||||
} |
||||
return $result; |
||||
} |
||||
MsgSync._() : super(); |
||||
factory MsgSync.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgSync.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgSync', createEmptyInstance: create) |
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'seq', $pb.PbFieldType.OU3) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSync clone() => MsgSync()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSync copyWith(void Function(MsgSync) updates) => super.copyWith((message) => updates(message as MsgSync)) as MsgSync; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSync create() => MsgSync._(); |
||||
MsgSync createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgSync> createRepeated() => $pb.PbList<MsgSync>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSync getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgSync>(create); |
||||
static MsgSync? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.int get seq => $_getIZ(0); |
||||
@$pb.TagNumber(1) |
||||
set seq($core.int v) { $_setUnsignedInt32(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasSeq() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearSeq() => clearField(1); |
||||
} |
||||
|
||||
class MsgSyncData extends $pb.GeneratedMessage { |
||||
factory MsgSyncData({ |
||||
$core.Iterable<MsgData>? messages, |
||||
}) { |
||||
final $result = create(); |
||||
if (messages != null) { |
||||
$result.messages.addAll(messages); |
||||
} |
||||
return $result; |
||||
} |
||||
MsgSyncData._() : super(); |
||||
factory MsgSyncData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgSyncData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgSyncData', createEmptyInstance: create) |
||||
..pc<MsgData>(1, _omitFieldNames ? '' : 'messages', $pb.PbFieldType.PM, subBuilder: MsgData.create) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSyncData clone() => MsgSyncData()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSyncData copyWith(void Function(MsgSyncData) updates) => super.copyWith((message) => updates(message as MsgSyncData)) as MsgSyncData; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSyncData create() => MsgSyncData._(); |
||||
MsgSyncData createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgSyncData> createRepeated() => $pb.PbList<MsgSyncData>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSyncData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgSyncData>(create); |
||||
static MsgSyncData? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.List<MsgData> get messages => $_getList(0); |
||||
} |
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); |
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); |
@ -0,0 +1,36 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:core' as $core; |
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb; |
||||
|
||||
class MsgType extends $pb.ProtobufEnum { |
||||
static const MsgType SINGLE_TEXT = MsgType._(0, _omitEnumNames ? '' : 'SINGLE_TEXT'); |
||||
static const MsgType SINGLE_AUDIO = MsgType._(1, _omitEnumNames ? '' : 'SINGLE_AUDIO'); |
||||
static const MsgType GROUP_TEXT = MsgType._(2, _omitEnumNames ? '' : 'GROUP_TEXT'); |
||||
static const MsgType GROUP_AUDIO = MsgType._(3, _omitEnumNames ? '' : 'GROUP_AUDIO'); |
||||
|
||||
static const $core.List<MsgType> values = <MsgType> [ |
||||
SINGLE_TEXT, |
||||
SINGLE_AUDIO, |
||||
GROUP_TEXT, |
||||
GROUP_AUDIO, |
||||
]; |
||||
|
||||
static final $core.Map<$core.int, MsgType> _byValue = $pb.ProtobufEnum.initByValue(values); |
||||
static MsgType? valueOf($core.int value) => _byValue[value]; |
||||
|
||||
const MsgType._($core.int v, $core.String n) : super(v, n); |
||||
} |
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); |
@ -0,0 +1,85 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:convert' as $convert; |
||||
import 'dart:core' as $core; |
||||
import 'dart:typed_data' as $typed_data; |
||||
|
||||
@$core.Deprecated('Use msgTypeDescriptor instead') |
||||
const MsgType$json = { |
||||
'1': 'MsgType', |
||||
'2': [ |
||||
{'1': 'SINGLE_TEXT', '2': 0}, |
||||
{'1': 'SINGLE_AUDIO', '2': 1}, |
||||
{'1': 'GROUP_TEXT', '2': 2}, |
||||
{'1': 'GROUP_AUDIO', '2': 3}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgType`. Decode as a `google.protobuf.EnumDescriptorProto`. |
||||
final $typed_data.Uint8List msgTypeDescriptor = $convert.base64Decode( |
||||
'CgdNc2dUeXBlEg8KC1NJTkdMRV9URVhUEAASEAoMU0lOR0xFX0FVRElPEAESDgoKR1JPVVBfVE' |
||||
'VYVBACEg8KC0dST1VQX0FVRElPEAM='); |
||||
|
||||
@$core.Deprecated('Use msgDataDescriptor instead') |
||||
const MsgData$json = { |
||||
'1': 'MsgData', |
||||
'2': [ |
||||
{'1': 'to', '3': 1, '4': 1, '5': 13, '10': 'to'}, |
||||
{'1': 'from', '3': 2, '4': 1, '5': 13, '10': 'from'}, |
||||
{'1': 'ctime', '3': 3, '4': 1, '5': 13, '10': 'ctime'}, |
||||
{'1': 'type', '3': 4, '4': 1, '5': 14, '6': '.MsgType', '10': 'type'}, |
||||
{'1': 'data', '3': 5, '4': 1, '5': 12, '10': 'data'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgData`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgDataDescriptor = $convert.base64Decode( |
||||
'CgdNc2dEYXRhEg4KAnRvGAEgASgNUgJ0bxISCgRmcm9tGAIgASgNUgRmcm9tEhQKBWN0aW1lGA' |
||||
'MgASgNUgVjdGltZRIcCgR0eXBlGAQgASgOMgguTXNnVHlwZVIEdHlwZRISCgRkYXRhGAUgASgM' |
||||
'UgRkYXRh'); |
||||
|
||||
@$core.Deprecated('Use msgNotifyDescriptor instead') |
||||
const MsgNotify$json = { |
||||
'1': 'MsgNotify', |
||||
'2': [ |
||||
{'1': 'seq', '3': 1, '4': 1, '5': 13, '10': 'seq'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgNotify`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgNotifyDescriptor = $convert.base64Decode( |
||||
'CglNc2dOb3RpZnkSEAoDc2VxGAEgASgNUgNzZXE='); |
||||
|
||||
@$core.Deprecated('Use msgSyncDescriptor instead') |
||||
const MsgSync$json = { |
||||
'1': 'MsgSync', |
||||
'2': [ |
||||
{'1': 'seq', '3': 1, '4': 1, '5': 13, '10': 'seq'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgSync`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgSyncDescriptor = $convert.base64Decode( |
||||
'CgdNc2dTeW5jEhAKA3NlcRgBIAEoDVIDc2Vx'); |
||||
|
||||
@$core.Deprecated('Use msgSyncDataDescriptor instead') |
||||
const MsgSyncData$json = { |
||||
'1': 'MsgSyncData', |
||||
'2': [ |
||||
{'1': 'messages', '3': 1, '4': 3, '5': 11, '6': '.MsgData', '10': 'messages'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgSyncData`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgSyncDataDescriptor = $convert.base64Decode( |
||||
'CgtNc2dTeW5jRGF0YRIkCghtZXNzYWdlcxgBIAMoCzIILk1zZ0RhdGFSCG1lc3NhZ2Vz'); |
||||
|
@ -0,0 +1,14 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names |
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
export 'message.pb.dart'; |
||||
|
Loading…
Reference in new issue