├── .gitignore
├── README.md
└── protoFile
├── CS
├── GetPersonalInfoMsg.cs
├── GetQuestionInfo.cs
├── GetUserInfoMsg.cs
├── GroupData.cs
├── KeepAliveMsg.cs
├── LoginMsg.cs
├── LogoutMsg.cs
├── OffLineMsg.cs
├── ProtoHead.cs
├── QuestionData.cs
├── RegisterMsg.cs
└── UserData.cs
├── ProtoToCs
├── GetPersonalInfoMsg.proto
├── GetQuestionInfo.proto
├── GetUserInfoMsg.proto
├── GroupData.proto
├── KeepAliveMsg.proto
├── Licence.txt
├── LoginMsg.proto
├── LogoutMsg.proto
├── OffLineMsg.proto
├── ProtoHead.proto
├── QuestionData.proto
├── RegisterMsg.proto
├── UnPackTool.cs
├── UserData.proto
├── common.xslt
├── csharp.xslt
├── gen.command
├── makefile
├── protoEnumParse.exe
├── protoToCs.bat
├── protobuf-net.dll
├── protobuf-net.xml
├── protoc-license.txt
├── protoc.exe
├── protogen.exe
├── protogen.exe.config
├── temp.txt
├── vb.xslt
└── xml.xslt
└── Unpacktool
└── Unpacktool.cs
/.gitignore:
--------------------------------------------------------------------------------
1 | /[Ll]ibrary/
2 | /[Tt]emp/
3 | /[Oo]bj/
4 | /[Bb]uild/
5 | /[Bb]uilds/
6 | /Assets/AssetStoreTools*
7 |
8 | # Visual Studio 2015 cache directory
9 | /.vs/
10 |
11 | # Autogenerated VS/MD/Consulo solution and project files
12 | ExportedObj/
13 | .consulo/
14 | *.csproj
15 | *.unityproj
16 | *.sln
17 | *.suo
18 | *.tmp
19 | *.user
20 | *.userprefs
21 | *.pidb
22 | *.booproj
23 | *.svd
24 | *.pdb
25 |
26 | # Unity3D generated meta files
27 | *.pidb.meta
28 |
29 | # Unity3D Generated File On Crash Reports
30 | sysinfo.txt
31 |
32 | # Builds
33 | *.apk
34 | *.unitypackage
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ProtobufTools
2 | protobuf tools C# for unity game or other item
3 |
--------------------------------------------------------------------------------
/protoFile/CS/GetPersonalInfoMsg.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: GetPersonalInfoMsg.proto
11 | // Note: requires additional types generated from: UserData.proto
12 | // Note: requires additional types generated from: GroupData.proto
13 | namespace protocol
14 | {
15 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetPersonalInfoReq")]
16 | public partial class GetPersonalInfoReq : global::ProtoBuf.IExtensible
17 | {
18 | public GetPersonalInfoReq() {}
19 |
20 | private bool _userInfo = (bool)false;
21 | [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"userInfo", DataFormat = global::ProtoBuf.DataFormat.Default)]
22 | [global::System.ComponentModel.DefaultValue((bool)false)]
23 | public bool userInfo
24 | {
25 | get { return _userInfo; }
26 | set { _userInfo = value; }
27 | }
28 | private bool _groupInfo = (bool)false;
29 | [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"groupInfo", DataFormat = global::ProtoBuf.DataFormat.Default)]
30 | [global::System.ComponentModel.DefaultValue((bool)false)]
31 | public bool groupInfo
32 | {
33 | get { return _groupInfo; }
34 | set { _groupInfo = value; }
35 | }
36 | private global::ProtoBuf.IExtension extensionObject;
37 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
38 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
39 | }
40 |
41 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetPersonalInfoRsp")]
42 | public partial class GetPersonalInfoRsp : global::ProtoBuf.IExtensible
43 | {
44 | public GetPersonalInfoRsp() {}
45 |
46 | private protocol.GetPersonalInfoRsp.ResultCode _resultCode;
47 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"resultCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
48 | public protocol.GetPersonalInfoRsp.ResultCode resultCode
49 | {
50 | get { return _resultCode; }
51 | set { _resultCode = value; }
52 | }
53 | private protocol.UserItem _userInfo = null;
54 | [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"userInfo", DataFormat = global::ProtoBuf.DataFormat.Default)]
55 | [global::System.ComponentModel.DefaultValue(null)]
56 | public protocol.UserItem userInfo
57 | {
58 | get { return _userInfo; }
59 | set { _userInfo = value; }
60 | }
61 | private readonly global::System.Collections.Generic.List _groups = new global::System.Collections.Generic.List();
62 | [global::ProtoBuf.ProtoMember(3, Name=@"groups", DataFormat = global::ProtoBuf.DataFormat.Default)]
63 | public global::System.Collections.Generic.List groups
64 | {
65 | get { return _groups; }
66 | }
67 |
68 | [global::ProtoBuf.ProtoContract(Name=@"ResultCode")]
69 | public enum ResultCode
70 | {
71 |
72 | [global::ProtoBuf.ProtoEnum(Name=@"SUCCESS", Value=0)]
73 | SUCCESS = 0,
74 |
75 | [global::ProtoBuf.ProtoEnum(Name=@"FAIL", Value=1)]
76 | FAIL = 1
77 | }
78 |
79 | private global::ProtoBuf.IExtension extensionObject;
80 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
81 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
82 | }
83 |
84 | }
--------------------------------------------------------------------------------
/protoFile/CS/GetQuestionInfo.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: GetQuestionInfo.proto
11 | // Note: requires additional types generated from: QuestionData.proto
12 | namespace protocol
13 | {
14 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetQuestionInfoReq")]
15 | public partial class GetQuestionInfoReq : global::ProtoBuf.IExtensible
16 | {
17 | public GetQuestionInfoReq() {}
18 |
19 | private global::ProtoBuf.IExtension extensionObject;
20 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
21 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
22 | }
23 |
24 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetQuestionInfoRsp")]
25 | public partial class GetQuestionInfoRsp : global::ProtoBuf.IExtensible
26 | {
27 | public GetQuestionInfoRsp() {}
28 |
29 | private protocol.GetQuestionInfoRsp.ResultCode _resultCode;
30 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"resultCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
31 | public protocol.GetQuestionInfoRsp.ResultCode resultCode
32 | {
33 | get { return _resultCode; }
34 | set { _resultCode = value; }
35 | }
36 | private readonly global::System.Collections.Generic.List _questionInfo = new global::System.Collections.Generic.List();
37 | [global::ProtoBuf.ProtoMember(2, Name=@"questionInfo", DataFormat = global::ProtoBuf.DataFormat.Default)]
38 | public global::System.Collections.Generic.List questionInfo
39 | {
40 | get { return _questionInfo; }
41 | }
42 |
43 | [global::ProtoBuf.ProtoContract(Name=@"ResultCode")]
44 | public enum ResultCode
45 | {
46 |
47 | [global::ProtoBuf.ProtoEnum(Name=@"SUCCESS", Value=0)]
48 | SUCCESS = 0,
49 |
50 | [global::ProtoBuf.ProtoEnum(Name=@"FAIL", Value=1)]
51 | FAIL = 1
52 | }
53 |
54 | private global::ProtoBuf.IExtension extensionObject;
55 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
56 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
57 | }
58 |
59 | }
--------------------------------------------------------------------------------
/protoFile/CS/GetUserInfoMsg.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: GetUserInfoMsg.proto
11 | // Note: requires additional types generated from: UserData.proto
12 | namespace protocol
13 | {
14 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetUserInfoReq")]
15 | public partial class GetUserInfoReq : global::ProtoBuf.IExtensible
16 | {
17 | public GetUserInfoReq() {}
18 |
19 | private readonly global::System.Collections.Generic.List _targetUserId = new global::System.Collections.Generic.List();
20 | [global::ProtoBuf.ProtoMember(1, Name=@"targetUserId", DataFormat = global::ProtoBuf.DataFormat.Default)]
21 | public global::System.Collections.Generic.List targetUserId
22 | {
23 | get { return _targetUserId; }
24 | }
25 |
26 | private global::ProtoBuf.IExtension extensionObject;
27 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
28 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
29 | }
30 |
31 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetUserInfoRsp")]
32 | public partial class GetUserInfoRsp : global::ProtoBuf.IExtensible
33 | {
34 | public GetUserInfoRsp() {}
35 |
36 | private protocol.GetUserInfoRsp.ResultCode _resultCode;
37 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"resultCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
38 | public protocol.GetUserInfoRsp.ResultCode resultCode
39 | {
40 | get { return _resultCode; }
41 | set { _resultCode = value; }
42 | }
43 | private readonly global::System.Collections.Generic.List _userItem = new global::System.Collections.Generic.List();
44 | [global::ProtoBuf.ProtoMember(2, Name=@"userItem", DataFormat = global::ProtoBuf.DataFormat.Default)]
45 | public global::System.Collections.Generic.List userItem
46 | {
47 | get { return _userItem; }
48 | }
49 |
50 | [global::ProtoBuf.ProtoContract(Name=@"ResultCode")]
51 | public enum ResultCode
52 | {
53 |
54 | [global::ProtoBuf.ProtoEnum(Name=@"SUCCESS", Value=0)]
55 | SUCCESS = 0,
56 |
57 | [global::ProtoBuf.ProtoEnum(Name=@"FAIL", Value=1)]
58 | FAIL = 1,
59 |
60 | [global::ProtoBuf.ProtoEnum(Name=@"USER_NOT_EXIST", Value=2)]
61 | USER_NOT_EXIST = 2
62 | }
63 |
64 | private global::ProtoBuf.IExtension extensionObject;
65 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
66 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
67 | }
68 |
69 | }
--------------------------------------------------------------------------------
/protoFile/CS/GroupData.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: GroupData.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GroupItem")]
14 | public partial class GroupItem : global::ProtoBuf.IExtensible
15 | {
16 | public GroupItem() {}
17 |
18 | private string _groupId;
19 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"groupId", DataFormat = global::ProtoBuf.DataFormat.Default)]
20 | public string groupId
21 | {
22 | get { return _groupId; }
23 | set { _groupId = value; }
24 | }
25 | private string _groupName;
26 | [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"groupName", DataFormat = global::ProtoBuf.DataFormat.Default)]
27 | public string groupName
28 | {
29 | get { return _groupName; }
30 | set { _groupName = value; }
31 | }
32 | private string _createrUserId;
33 | [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"createrUserId", DataFormat = global::ProtoBuf.DataFormat.Default)]
34 | public string createrUserId
35 | {
36 | get { return _createrUserId; }
37 | set { _createrUserId = value; }
38 | }
39 | private readonly global::System.Collections.Generic.List _memberUserId = new global::System.Collections.Generic.List();
40 | [global::ProtoBuf.ProtoMember(4, Name=@"memberUserId", DataFormat = global::ProtoBuf.DataFormat.Default)]
41 | public global::System.Collections.Generic.List memberUserId
42 | {
43 | get { return _memberUserId; }
44 | }
45 |
46 | private global::ProtoBuf.IExtension extensionObject;
47 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
48 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/protoFile/CS/KeepAliveMsg.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: KeepAliveMsg.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"KeepAliveSyncPacket")]
14 | public partial class KeepAliveSyncPacket : global::ProtoBuf.IExtensible
15 | {
16 | public KeepAliveSyncPacket() {}
17 |
18 | private int _a = default(int);
19 | [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"a", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
20 | [global::System.ComponentModel.DefaultValue(default(int))]
21 | public int a
22 | {
23 | get { return _a; }
24 | set { _a = value; }
25 | }
26 | private bool _b = default(bool);
27 | [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"b", DataFormat = global::ProtoBuf.DataFormat.Default)]
28 | [global::System.ComponentModel.DefaultValue(default(bool))]
29 | public bool b
30 | {
31 | get { return _b; }
32 | set { _b = value; }
33 | }
34 | private string _c = "";
35 | [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"c", DataFormat = global::ProtoBuf.DataFormat.Default)]
36 | [global::System.ComponentModel.DefaultValue("")]
37 | public string c
38 | {
39 | get { return _c; }
40 | set { _c = value; }
41 | }
42 | private global::ProtoBuf.IExtension extensionObject;
43 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
44 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/protoFile/CS/LoginMsg.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: LoginMsg.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"LoginReq")]
14 | public partial class LoginReq : global::ProtoBuf.IExtensible
15 | {
16 | public LoginReq() {}
17 |
18 | private string _userId;
19 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"userId", DataFormat = global::ProtoBuf.DataFormat.Default)]
20 | public string userId
21 | {
22 | get { return _userId; }
23 | set { _userId = value; }
24 | }
25 | private string _sessionId;
26 | [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"sessionId", DataFormat = global::ProtoBuf.DataFormat.Default)]
27 | public string sessionId
28 | {
29 | get { return _sessionId; }
30 | set { _sessionId = value; }
31 | }
32 | private global::ProtoBuf.IExtension extensionObject;
33 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
34 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
35 | }
36 |
37 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"LoginRsp")]
38 | public partial class LoginRsp : global::ProtoBuf.IExtensible
39 | {
40 | public LoginRsp() {}
41 |
42 | private protocol.LoginRsp.ResultCode _resultCode;
43 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"resultCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
44 | public protocol.LoginRsp.ResultCode resultCode
45 | {
46 | get { return _resultCode; }
47 | set { _resultCode = value; }
48 | }
49 | [global::ProtoBuf.ProtoContract(Name=@"ResultCode")]
50 | public enum ResultCode
51 | {
52 |
53 | [global::ProtoBuf.ProtoEnum(Name=@"SUCCESS", Value=0)]
54 | SUCCESS = 0,
55 |
56 | [global::ProtoBuf.ProtoEnum(Name=@"FAIL", Value=1)]
57 | FAIL = 1
58 | }
59 |
60 | private global::ProtoBuf.IExtension extensionObject;
61 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
62 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
63 | }
64 |
65 | }
--------------------------------------------------------------------------------
/protoFile/CS/LogoutMsg.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: LogoutMsg.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"LogoutReq")]
14 | public partial class LogoutReq : global::ProtoBuf.IExtensible
15 | {
16 | public LogoutReq() {}
17 |
18 | private global::ProtoBuf.IExtension extensionObject;
19 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
20 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
21 | }
22 |
23 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"LogoutRsp")]
24 | public partial class LogoutRsp : global::ProtoBuf.IExtensible
25 | {
26 | public LogoutRsp() {}
27 |
28 | private protocol.LogoutRsp.ResultCode _resultCode;
29 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"resultCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
30 | public protocol.LogoutRsp.ResultCode resultCode
31 | {
32 | get { return _resultCode; }
33 | set { _resultCode = value; }
34 | }
35 | [global::ProtoBuf.ProtoContract(Name=@"ResultCode")]
36 | public enum ResultCode
37 | {
38 |
39 | [global::ProtoBuf.ProtoEnum(Name=@"SUCCESS", Value=0)]
40 | SUCCESS = 0,
41 |
42 | [global::ProtoBuf.ProtoEnum(Name=@"FAIL", Value=1)]
43 | FAIL = 1
44 | }
45 |
46 | private global::ProtoBuf.IExtension extensionObject;
47 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
48 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/protoFile/CS/OffLineMsg.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: OffLineMsg.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"OffLineSync")]
14 | public partial class OffLineSync : global::ProtoBuf.IExtensible
15 | {
16 | public OffLineSync() {}
17 |
18 | private protocol.OffLineSync.CauseCode _causeCode;
19 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"causeCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
20 | public protocol.OffLineSync.CauseCode causeCode
21 | {
22 | get { return _causeCode; }
23 | set { _causeCode = value; }
24 | }
25 | [global::ProtoBuf.ProtoContract(Name=@"CauseCode")]
26 | public enum CauseCode
27 | {
28 |
29 | [global::ProtoBuf.ProtoEnum(Name=@"CHANGE_PASSWORD", Value=0)]
30 | CHANGE_PASSWORD = 0,
31 |
32 | [global::ProtoBuf.ProtoEnum(Name=@"ANOTHER_LOGIN", Value=1)]
33 | ANOTHER_LOGIN = 1,
34 |
35 | [global::ProtoBuf.ProtoEnum(Name=@"KEEP_ALIVE_FALSE", Value=2)]
36 | KEEP_ALIVE_FALSE = 2
37 | }
38 |
39 | private global::ProtoBuf.IExtension extensionObject;
40 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
41 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/protoFile/CS/ProtoHead.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: ProtoHead.proto
11 | namespace protocol
12 | {
13 | [global::ProtoBuf.ProtoContract(Name=@"ENetworkMessage")]
14 | public enum ENetworkMessage
15 | {
16 |
17 | [global::ProtoBuf.ProtoEnum(Name=@"KEEP_ALIVE_SYNC", Value=0)]
18 | KEEP_ALIVE_SYNC = 0,
19 |
20 | [global::ProtoBuf.ProtoEnum(Name=@"LOGIN_REQ", Value=1)]
21 | LOGIN_REQ = 1,
22 |
23 | [global::ProtoBuf.ProtoEnum(Name=@"LOGIN_RSP", Value=2)]
24 | LOGIN_RSP = 2,
25 |
26 | [global::ProtoBuf.ProtoEnum(Name=@"GET_USERINFO_REQ", Value=3)]
27 | GET_USERINFO_REQ = 3,
28 |
29 | [global::ProtoBuf.ProtoEnum(Name=@"GET_USERINFO_RSP", Value=4)]
30 | GET_USERINFO_RSP = 4,
31 |
32 | [global::ProtoBuf.ProtoEnum(Name=@"LOGOUT_REQ", Value=5)]
33 | LOGOUT_REQ = 5,
34 |
35 | [global::ProtoBuf.ProtoEnum(Name=@"LOGOUT_RSP", Value=6)]
36 | LOGOUT_RSP = 6,
37 |
38 | [global::ProtoBuf.ProtoEnum(Name=@"OFFLINE_SYNC", Value=7)]
39 | OFFLINE_SYNC = 7,
40 |
41 | [global::ProtoBuf.ProtoEnum(Name=@"GET_QUESTION_INFO_REQ", Value=8)]
42 | GET_QUESTION_INFO_REQ = 8,
43 |
44 | [global::ProtoBuf.ProtoEnum(Name=@"GET_QUESTION_INFO_RSP", Value=9)]
45 | GET_QUESTION_INFO_RSP = 9
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/protoFile/CS/QuestionData.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: QuestionData.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"QuestionItem")]
14 | public partial class QuestionItem : global::ProtoBuf.IExtensible
15 | {
16 | public QuestionItem() {}
17 |
18 | private string _id;
19 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.Default)]
20 | public string id
21 | {
22 | get { return _id; }
23 | set { _id = value; }
24 | }
25 | private string _desc;
26 | [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"desc", DataFormat = global::ProtoBuf.DataFormat.Default)]
27 | public string desc
28 | {
29 | get { return _desc; }
30 | set { _desc = value; }
31 | }
32 | private int _category;
33 | [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"category", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
34 | public int category
35 | {
36 | get { return _category; }
37 | set { _category = value; }
38 | }
39 | private int _type;
40 | [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
41 | public int type
42 | {
43 | get { return _type; }
44 | set { _type = value; }
45 | }
46 | private int _step;
47 | [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"step", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
48 | public int step
49 | {
50 | get { return _step; }
51 | set { _step = value; }
52 | }
53 | private protocol.OptionItem _qA;
54 | [global::ProtoBuf.ProtoMember(6, IsRequired = true, Name=@"qA", DataFormat = global::ProtoBuf.DataFormat.Default)]
55 | public protocol.OptionItem qA
56 | {
57 | get { return _qA; }
58 | set { _qA = value; }
59 | }
60 | private protocol.OptionItem _qB = null;
61 | [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"qB", DataFormat = global::ProtoBuf.DataFormat.Default)]
62 | [global::System.ComponentModel.DefaultValue(null)]
63 | public protocol.OptionItem qB
64 | {
65 | get { return _qB; }
66 | set { _qB = value; }
67 | }
68 | private protocol.OptionItem _qC = null;
69 | [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"qC", DataFormat = global::ProtoBuf.DataFormat.Default)]
70 | [global::System.ComponentModel.DefaultValue(null)]
71 | public protocol.OptionItem qC
72 | {
73 | get { return _qC; }
74 | set { _qC = value; }
75 | }
76 | private protocol.OptionItem _qD = null;
77 | [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"qD", DataFormat = global::ProtoBuf.DataFormat.Default)]
78 | [global::System.ComponentModel.DefaultValue(null)]
79 | public protocol.OptionItem qD
80 | {
81 | get { return _qD; }
82 | set { _qD = value; }
83 | }
84 | private string _answer;
85 | [global::ProtoBuf.ProtoMember(10, IsRequired = true, Name=@"answer", DataFormat = global::ProtoBuf.DataFormat.Default)]
86 | public string answer
87 | {
88 | get { return _answer; }
89 | set { _answer = value; }
90 | }
91 | private global::ProtoBuf.IExtension extensionObject;
92 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
93 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
94 | }
95 |
96 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"OptionItem")]
97 | public partial class OptionItem : global::ProtoBuf.IExtensible
98 | {
99 | public OptionItem() {}
100 |
101 | private string _id;
102 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.Default)]
103 | public string id
104 | {
105 | get { return _id; }
106 | set { _id = value; }
107 | }
108 | private string _desc;
109 | [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"desc", DataFormat = global::ProtoBuf.DataFormat.Default)]
110 | public string desc
111 | {
112 | get { return _desc; }
113 | set { _desc = value; }
114 | }
115 | private int _isPic;
116 | [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"isPic", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
117 | public int isPic
118 | {
119 | get { return _isPic; }
120 | set { _isPic = value; }
121 | }
122 | private global::ProtoBuf.IExtension extensionObject;
123 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
124 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
125 | }
126 |
127 | }
--------------------------------------------------------------------------------
/protoFile/CS/RegisterMsg.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: RegisterMsg.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RegisterReq")]
14 | public partial class RegisterReq : global::ProtoBuf.IExtensible
15 | {
16 | public RegisterReq() {}
17 |
18 | private string _userId;
19 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"userId", DataFormat = global::ProtoBuf.DataFormat.Default)]
20 | public string userId
21 | {
22 | get { return _userId; }
23 | set { _userId = value; }
24 | }
25 | private string _userName;
26 | [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"userName", DataFormat = global::ProtoBuf.DataFormat.Default)]
27 | public string userName
28 | {
29 | get { return _userName; }
30 | set { _userName = value; }
31 | }
32 | private string _userPassword;
33 | [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"userPassword", DataFormat = global::ProtoBuf.DataFormat.Default)]
34 | public string userPassword
35 | {
36 | get { return _userPassword; }
37 | set { _userPassword = value; }
38 | }
39 | private global::ProtoBuf.IExtension extensionObject;
40 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
41 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
42 | }
43 |
44 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RegisterRsp")]
45 | public partial class RegisterRsp : global::ProtoBuf.IExtensible
46 | {
47 | public RegisterRsp() {}
48 |
49 | private protocol.RegisterRsp.ResultCode _resultCode;
50 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"resultCode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
51 | public protocol.RegisterRsp.ResultCode resultCode
52 | {
53 | get { return _resultCode; }
54 | set { _resultCode = value; }
55 | }
56 | [global::ProtoBuf.ProtoContract(Name=@"ResultCode")]
57 | public enum ResultCode
58 | {
59 |
60 | [global::ProtoBuf.ProtoEnum(Name=@"SUCCESS", Value=0)]
61 | SUCCESS = 0,
62 |
63 | [global::ProtoBuf.ProtoEnum(Name=@"USER_EXIST", Value=1)]
64 | USER_EXIST = 1
65 | }
66 |
67 | private global::ProtoBuf.IExtension extensionObject;
68 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
69 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
70 | }
71 |
72 | }
--------------------------------------------------------------------------------
/protoFile/CS/UserData.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | // Generated from: UserData.proto
11 | namespace protocol
12 | {
13 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UserItem")]
14 | public partial class UserItem : global::ProtoBuf.IExtensible
15 | {
16 | public UserItem() {}
17 |
18 | private string _userId;
19 | [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"userId", DataFormat = global::ProtoBuf.DataFormat.Default)]
20 | public string userId
21 | {
22 | get { return _userId; }
23 | set { _userId = value; }
24 | }
25 | private string _userName;
26 | [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"userName", DataFormat = global::ProtoBuf.DataFormat.Default)]
27 | public string userName
28 | {
29 | get { return _userName; }
30 | set { _userName = value; }
31 | }
32 | private string _roleId;
33 | [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"roleId", DataFormat = global::ProtoBuf.DataFormat.Default)]
34 | public string roleId
35 | {
36 | get { return _roleId; }
37 | set { _roleId = value; }
38 | }
39 | private int _headIndex = default(int);
40 | [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"headIndex", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
41 | [global::System.ComponentModel.DefaultValue(default(int))]
42 | public int headIndex
43 | {
44 | get { return _headIndex; }
45 | set { _headIndex = value; }
46 | }
47 | private global::ProtoBuf.IExtension extensionObject;
48 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
49 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/GetPersonalInfoMsg.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 | import "UserData.proto";
5 | import "GroupData.proto";
6 |
7 | message GetPersonalInfoReq{
8 | optional bool userInfo = 1 [default = false];
9 | optional bool groupInfo = 2 [default =false];
10 | }
11 |
12 | message GetPersonalInfoRsp{
13 | enum ResultCode{
14 | SUCCESS = 0;//成功
15 | FAIL = 1;//失败
16 | }
17 |
18 | required ResultCode resultCode = 1;
19 | optional UserItem userInfo = 2;
20 | repeated GroupItem groups = 3;
21 | }
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/GetQuestionInfo.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 | import "QuestionData.proto";
5 |
6 | message GetQuestionInfoReq{
7 |
8 | }
9 |
10 | message GetQuestionInfoRsp{
11 | enum ResultCode{
12 | SUCCESS = 0;//成功
13 | FAIL = 1;//失败
14 | }
15 |
16 | required ResultCode resultCode = 1;
17 | repeated QuestionItem questionInfo = 2;
18 | }
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/GetUserInfoMsg.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 | import "UserData.proto";
5 |
6 | message GetUserInfoReq{
7 | repeated string targetUserId = 1 ;
8 | }
9 |
10 | message GetUserInfoRsp{
11 | enum ResultCode{
12 | SUCCESS = 0;//搜索到用户
13 | FAIL = 1;//未搜索到用户
14 | USER_NOT_EXIST = 2;//用户不存在
15 | }
16 | required ResultCode resultCode = 1;
17 | repeated UserItem userItem = 2;
18 | }
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/GroupData.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Data";
4 |
5 | message GroupItem{
6 | required string groupId = 1;
7 | required string groupName = 2;
8 | required string createrUserId = 3;
9 | repeated string memberUserId = 4;
10 | }
11 |
12 |
13 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/KeepAliveMsg.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 |
5 | message KeepAliveSyncPacket{
6 | optional int32 a=1;
7 | optional bool b=2;
8 | optional string c=3;
9 | }
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/Licence.txt:
--------------------------------------------------------------------------------
1 | The core Protocol Buffers technology is provided courtesy of Google.
2 | At the time of writing, this is released under the BSD license.
3 | Full details can be found here:
4 |
5 | http://code.google.com/p/protobuf/
6 |
7 |
8 | This .NET implementation is Copyright 2008 Marc Gravell
9 |
10 | Licensed under the Apache License, Version 2.0 (the "License");
11 | you may not use this file except in compliance with the License.
12 | You may obtain a copy of the License at
13 |
14 | http://www.apache.org/licenses/LICENSE-2.0
15 |
16 | Unless required by applicable law or agreed to in writing, software
17 | distributed under the License is distributed on an "AS IS" BASIS,
18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | See the License for the specific language governing permissions and
20 | limitations under the License.
21 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/LoginMsg.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 |
5 | message LoginReq{
6 | required string userId= 1;
7 | required string sessionId=2;
8 | }
9 | message LoginRsp{
10 | enum ResultCode{
11 | SUCCESS = 0;
12 | FAIL = 1;
13 | }
14 | required ResultCode resultCode = 1;
15 | }
16 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/LogoutMsg.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 |
5 | message LogoutReq{
6 |
7 | }
8 |
9 | message LogoutRsp{
10 | enum ResultCode{
11 | SUCCESS = 0;
12 | FAIL = 1;
13 | }
14 |
15 | required ResultCode resultCode = 1;
16 | }
17 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/OffLineMsg.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 |
5 | message OffLineSync{
6 | enum CauseCode{
7 | CHANGE_PASSWORD=0;
8 | ANOTHER_LOGIN=1;
9 | KEEP_ALIVE_FALSE=2;
10 | }
11 | required CauseCode causeCode =1;
12 |
13 | }
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/ProtoHead.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol";
4 |
5 | enum ENetworkMessage{
6 | KEEP_ALIVE_SYNC=0;
7 | LOGIN_REQ=1;
8 | LOGIN_RSP=2;
9 | GET_USERINFO_REQ=3;
10 | GET_USERINFO_RSP=4;
11 | LOGOUT_REQ=5;
12 | LOGOUT_RSP=6;
13 | OFFLINE_SYNC=7;
14 | GET_QUESTION_INFO_REQ=8;
15 | GET_QUESTION_INFO_RSP=9;
16 | }
17 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/QuestionData.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Data";
4 |
5 | message QuestionItem{
6 | required string id = 1; //题目id
7 | required string desc = 2;//题目描述
8 | required int32 category = 3;// 0-单选 1-多选 2-简答
9 | required int32 type = 4;// 1-桡骨 2-肱骨
10 | required int32 step = 5;// 步骤 1-接诊 2-诊断 3-治疗 4-功能锻炼 5-用药
11 | required OptionItem qA = 6;// 选项1
12 | optional OptionItem qB = 7;// 选项2
13 | optional OptionItem qC = 8;// 选项3
14 | optional OptionItem qD = 9;// 选项4
15 | required string answer = 10;//答案
16 |
17 | }
18 |
19 | message OptionItem{
20 | required string id = 1; //选项id
21 | required string desc = 2;//选项描述
22 | required int32 isPic = 3;//0-文字 1-图片
23 | }
24 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/RegisterMsg.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Msg";
4 |
5 | message RegisterReq{
6 | required string userId = 1;
7 | required string userName = 2;
8 | required string userPassword = 3;
9 | }
10 |
11 | message RegisterRsp {
12 |
13 | enum ResultCode{
14 | SUCCESS = 0; //表示注册成功
15 | USER_EXIST = 1; //表示用户名已存在
16 | }
17 |
18 | required ResultCode resultCode = 1;
19 | }
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/UnPackTool.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 | using System.Collections.Generic;
4 | using protocol;
5 | using ProtoBuf;
6 | using System.IO;
7 |
8 | namespace NetWorkFrame
9 | {
10 | public class UnPackTool
11 | {
12 | public static IExtensible UnPack(ENetworkMessage networkMessage, int startIndex, int length, byte[] buffer)
13 | {
14 | IExtensible packet = null;
15 |
16 | try
17 | {
18 | using (MemoryStream streamForProto = new MemoryStream(buffer, startIndex, length))
19 | {
20 | switch (networkMessage)
21 | {
22 | case ENetworkMessage.KEEP_ALIVE_SYNC:
23 | packet = Serializer.Deserialize(streamForProto);
24 | break;
25 | case ENetworkMessage.LOGIN_REQ:
26 | packet = Serializer.Deserialize(streamForProto);
27 | break;
28 | case ENetworkMessage.LOGIN_RSP:
29 | packet = Serializer.Deserialize(streamForProto);
30 | break;
31 | case ENetworkMessage.GET_USERINFO_REQ:
32 | packet = Serializer.Deserialize(streamForProto);
33 | break;
34 | case ENetworkMessage.GET_USERINFO_RSP:
35 | packet = Serializer.Deserialize(streamForProto);
36 | break;
37 | case ENetworkMessage.LOGOUT_REQ:
38 | packet = Serializer.Deserialize(streamForProto);
39 | break;
40 | case ENetworkMessage.LOGOUT_RSP:
41 | packet = Serializer.Deserialize(streamForProto);
42 | break;
43 | case ENetworkMessage.OFFLINE_SYNC:
44 | packet = Serializer.Deserialize(streamForProto);
45 | break;
46 | case ENetworkMessage.GET_QUESTION_INFO_REQ:
47 | packet = Serializer.Deserialize(streamForProto);
48 | break;
49 | case ENetworkMessage.GET_QUESTION_INFO_RSP:
50 | packet = Serializer.Deserialize(streamForProto);
51 | break;
52 | default:
53 | Log4U.LogInfo("No Such Packet, packet type is " + networkMessage);
54 | break;
55 | }
56 | }
57 | }
58 | catch (System.Exception ex)
59 | {
60 | Log4U.LogError(ex.Message + "\n " + ex.StackTrace + "\n" + ex.Source);
61 |
62 | }return packet;
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/UserData.proto:
--------------------------------------------------------------------------------
1 | package protocol;
2 |
3 | option java_package = "com.vr.protocol.Data";
4 |
5 | message UserItem{
6 | required string userId = 1;
7 | required string userName = 2;
8 | required string roleId = 3; //0-老师 1-学生
9 | optional int32 headIndex = 4;
10 | }
11 |
12 |
13 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/common.xslt:
--------------------------------------------------------------------------------
1 |
2 |
5 |
12 |
13 |
14 | Node not handled: /
15 |
16 | ;
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/csharp.xslt:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | //------------------------------------------------------------------------------
39 | // <auto-generated>
40 | // This code was generated by a tool.
41 | //
42 | // Changes to this file may cause incorrect behavior and will be lost if
43 | // the code is regenerated.
44 | // </auto-generated>
45 | //------------------------------------------------------------------------------
46 |
49 |
50 |
51 |
52 |
53 |
54 | using ;
56 |
57 |
58 |
59 |
60 | using ;
61 |
62 |
63 |
64 |
65 |
66 |
67 | CSharp template for protobuf-net.
68 | Options:
69 | General:
70 | "help" - this page
71 | Additional serializer support:
72 | "xml" - enable explicit xml support (XmlSerializer)
73 | "datacontract" - enable data-contract support (DataContractSerializer; requires .NET 3.0)
74 | "binary" - enable binary support (BinaryFormatter; not supported on Silverlight)
75 | Other:
76 | "protoRpc" - enable proto-rpc client
77 | "observable" - change notification (observer pattern) support
78 | "preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5)
79 | "partialMethods" - provide partial methods for changes (requires C# 3.0)
80 | "detectMissing" - provide *Specified properties to indicate whether fields are present
81 | "lightFramework" - omit additional attributes not included in CF/Silverlight
82 | "asynchronous" - emit asynchronous methods for use with WCF
83 | "clientProxy" - emit asynchronous client proxy class
84 | "import" - additional namespaces to import (semicolon delimited)
85 | "fixCase" - change type/member names (types/properties become PascalCase; fields become camelCase)
86 |
87 |
88 |
89 |
90 |
91 | Invalid options: xml and data-contract serialization are mutually exclusive.
92 |
93 |
94 |
95 | // Option: xml serialization ([XmlType]/[XmlElement]) enabled
96 |
97 | // Option: data-contract serialization ([DataContract]/[DataMember]) enabled
98 |
99 | // Option: binary serialization (ISerializable) enabled
100 |
101 | // Option: observable (OnPropertyChanged) enabled
102 |
103 | // Option: pre-observable (OnPropertyChanging) enabled
104 |
105 | // Option: partial methods (On*Changing/On*Changed) enabled
106 |
107 | // Option: missing-value detection (*Specified/ShouldSerialize*/Reset*) enabled
108 |
109 | // Option: light framework (CF/Silverlight) enabled
110 |
111 | // Option: proto-rpc enabled
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 | // Generated from:
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 | namespace
130 | {
131 |
132 |
133 | }
134 |
135 |
136 | // Note: requires additional types generated from:
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 | [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"")]
153 | [global::System.Runtime.Serialization.DataContract(Name=@"")]
154 | [global::System.Xml.Serialization.XmlType(TypeName=@"")]
155 | public partial class : global::ProtoBuf.IExtensible, global::System.Runtime.Serialization.ISerializable, global::System.ComponentModel.INotifyPropertyChanged, global::System.ComponentModel.INotifyPropertyChanging
160 | {
161 | public () {}
162 |
163 | protected (global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context)
164 | : this() { global::ProtoBuf.Serializer.Merge(info, this); }
165 | void global::System.Runtime.Serialization.ISerializable.GetObjectData(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context)
166 | { global::ProtoBuf.Serializer.Serialize(info, this); }
167 |
168 | public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
169 | protected virtual void OnPropertyChanged(string propertyName)
170 | { if(PropertyChanged != null) PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(propertyName)); }
171 |
172 | public event global::System.ComponentModel.PropertyChangingEventHandler PropertyChanging;
173 | protected virtual void OnPropertyChanging(string propertyName)
174 | { if(PropertyChanging != null) PropertyChanging(this, new global::System.ComponentModel.PropertyChangingEventArgs(propertyName)); }
175 |
176 | private global::ProtoBuf.IExtension extensionObject;
177 | global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
178 | { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
179 | }
180 |
181 |
182 |
183 |
184 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 | [global::ProtoBuf.ProtoContract(Name=@"")]
199 | [global::System.Runtime.Serialization.DataContract(Name=@"")]
200 |
201 | [global::System.Xml.Serialization.XmlType(TypeName=@"")]
202 | public enum
204 | {
205 |
206 | }
207 |
208 |
209 |
210 |
211 |
212 | 0
213 |
214 | [global::ProtoBuf.ProtoEnum(Name=@"", Value=)]
216 | [global::System.Runtime.Serialization.EnumMember(Value=@"")]
218 | [global::System.Xml.Serialization.XmlEnum(@"")]
220 | = ,
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 | @
243 |
244 | |abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|
245 |
246 |
247 |
248 | FixedSize
251 | Group
252 | TwosComplement
255 | ZigZag
256 | Default
257 |
258 |
259 |
260 |
261 | struct
262 | struct
263 | struct
264 | struct
265 | struct
266 | struct
267 | struct
268 | struct
269 | struct
270 | class
271 | class
272 | struct
273 | struct
274 | struct
275 | struct
276 | struct
277 | struct
278 | none
279 |
280 |
281 | Field type not implemented: (.)
282 |
283 |
284 |
285 |
286 |
287 |
288 | double
289 | double
290 | float
291 | long
292 | ulong
293 | int
294 | ulong
295 | uint
296 | bool
297 | string
298 | byte[]
299 | uint
300 | int
301 | long
302 | int
303 | long
304 |
305 |
306 |
307 |
308 |
309 | Field type not implemented: (.)
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 | @""
319 | .
320 |
321 |
322 | /*
323 |
324 | */ null
325 | ()
326 |
327 |
328 |
329 |
337 |
338 |
339 |
340 |
341 | .
342 | .
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 | ""
353 | null
354 | null
355 | .
356 | default()
357 |
358 |
359 |
360 | global::System.Obsolete,
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 | ?
371 | private = ;
372 | [global::ProtoBuf.ProtoMember(, IsRequired = false, Name=@"", DataFormat = global::ProtoBuf.DataFormat.)]
374 | [global::System.ComponentModel.DefaultValue()]
376 | [global::System.Xml.Serialization.XmlElement(@"", Order = )]
377 |
378 | [global::System.Runtime.Serialization.DataMember(Name=@"", Order = , IsRequired = false)]
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 | private ;
394 | [global::ProtoBuf.ProtoMember(, IsRequired = true, Name=@"", DataFormat = global::ProtoBuf.DataFormat.)]
396 | [global::System.Xml.Serialization.XmlElement(@"", Order = )]
397 |
398 | [global::System.Runtime.Serialization.DataMember(Name=@"", Order = , IsRequired = true)]
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 | public
427 | {
428 | get { return ?? ; }
429 | set { OnChanging(value); OnPropertyChanging(@""); = value; OnPropertyChanged(@""); OnChanged();}
430 | }
431 | partial void OnChanging( value);
432 | partial void OnChanged();
433 | [global::System.Xml.Serialization.XmlIgnore]
434 | [global::System.ComponentModel.Browsable(false)]
435 | public bool Specified
436 | {
437 | get { return this. != null; }
438 | set { if (value == (this.== null)) this. = value ? this. : ()null; }
439 | }
440 | private bool ShouldSerialize() { return Specified; }
441 | private void Reset() { Specified = false; }
442 |
443 |
444 |
445 |
446 |
447 |
448 | private readonly global::System.Collections.Generic.List<> = new global::System.Collections.Generic.List<>();
449 | [global::ProtoBuf.ProtoMember(, Name=@"", DataFormat = global::ProtoBuf.DataFormat., Options = global::ProtoBuf.MemberSerializationOptions.Packed)]
451 | [global::System.Runtime.Serialization.DataMember(Name=@"", Order = , IsRequired = false)]
452 |
453 | [global::System.Xml.Serialization.XmlElement(@"", Order = )]
454 |
455 | public global::System.Collections.Generic.List<>
456 | {
457 | get { return ; }
459 | set { = value; }
460 | }
461 |
462 |
463 |
464 |
465 | [global::System.ServiceModel.ServiceContract(Name = @"")]
466 | public interface I
467 | {
468 |
469 | }
470 |
471 |
472 | public class Client : global::ProtoBuf.ServiceModel.RpcClient
473 | {
474 | public Client() : base(typeof(I)) { }
475 |
476 | }
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 | [global::System.ServiceModel.OperationContract(Name = @"")]
485 | [global::ProtoBuf.ServiceModel.ProtoBehavior]
486 |
487 | ( request);
488 |
489 | [global::System.ServiceModel.OperationContract(AsyncPattern = true, Name = @"")]
490 | global::System.IAsyncResult Begin( request, global::System.AsyncCallback callback, object state);
491 | End(global::System.IAsyncResult ar);
492 |
493 |
494 |
495 |
496 | ( request)
497 | {
498 | return () Send(@"", request);
499 | }
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 | public partial class CompletedEventArgs : global::System.ComponentModel.AsyncCompletedEventArgs
509 | {
510 | private object[] results;
511 |
512 | public CompletedEventArgs(object[] results, global::System.Exception exception, bool cancelled, object userState)
513 | : base(exception, cancelled, userState)
514 | {
515 | this.results = results;
516 | }
517 |
518 | public Result
519 | {
520 | get {
521 | base.RaiseExceptionIfNecessary();
522 | return ()(this.results[0]);
523 | }
524 | }
525 | }
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 | [global::System.Diagnostics.DebuggerStepThroughAttribute()]
534 | public partial class Client : global::System.ServiceModel.ClientBase<I>, I
535 | {
536 |
537 | public Client()
538 | {}
539 | public Client(string endpointConfigurationName)
540 | : base(endpointConfigurationName)
541 | {}
542 | public Client(string endpointConfigurationName, string remoteAddress)
543 | : base(endpointConfigurationName, remoteAddress)
544 | {}
545 | public Client(string endpointConfigurationName, global::System.ServiceModel.EndpointAddress remoteAddress)
546 | : base(endpointConfigurationName, remoteAddress)
547 | {}
548 | public Client(global::System.ServiceModel.Channels.Binding binding, global::System.ServiceModel.EndpointAddress remoteAddress)
549 | : base(binding, remoteAddress)
550 | {}
551 |
552 |
553 | }
554 |
555 |
556 |
557 |
558 |
559 | private BeginOperationDelegate onBeginDelegate;
560 | private EndOperationDelegate onEndDelegate;
561 | private global::System.Threading.SendOrPostCallback onCompletedDelegate;
562 |
563 | public event global::System.EventHandler<CompletedEventArgs> Completed;
564 |
565 | public ( request)
566 | {
567 | return base.Channel.(request);
568 | }
569 |
570 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
571 | public global::System.IAsyncResult Begin( request, global::System.AsyncCallback callback, object asyncState)
572 | {
573 | return base.Channel.Begin(request, callback, asyncState);
574 | }
575 |
576 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
577 | public End(global::System.IAsyncResult result)
578 | {
579 | return base.Channel.End(result);
580 | }
581 |
582 | private global::System.IAsyncResult OnBegin(object[] inValues, global::System.AsyncCallback callback, object asyncState)
583 | {
584 | request = (()(inValues[0]));
585 | return this.Begin(request, callback, asyncState);
586 | }
587 |
588 | private object[] OnEnd(global::System.IAsyncResult result)
589 | {
590 | retVal = this.End(result);
591 | return new object[] {
592 | retVal};
593 | }
594 |
595 | private void OnCompleted(object state)
596 | {
597 | if ((this.Completed != null))
598 | {
599 | InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
600 | this.Completed(this, new CompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
601 | }
602 | }
603 |
604 | public void Async( request)
605 | {
606 | this.Async(request, null);
607 | }
608 |
609 | public void Async( request, object userState)
610 | {
611 | if ((this.onBeginDelegate == null))
612 | {
613 | this.onBeginDelegate = new BeginOperationDelegate(this.OnBegin);
614 | }
615 | if ((this.onEndDelegate == null))
616 | {
617 | this.onEndDelegate = new EndOperationDelegate(this.OnEnd);
618 | }
619 | if ((this.onCompletedDelegate == null))
620 | {
621 | this.onCompletedDelegate = new global::System.Threading.SendOrPostCallback(this.OnCompleted);
622 | }
623 | base.InvokeAsync(this.onBeginDelegate, new object[] {
624 | request}, this.onEndDelegate, this.onCompletedDelegate, userState);
625 | }
626 |
627 |
628 |
629 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/gen.command:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | BASEDIR=$(dirname $0)
4 | cd $BASEDIR
5 | echo
6 | ls
7 | echo $BASEDIR
8 | for name in `ls`
9 | do
10 | if [ -d "$name" ]
11 | then :
12 | else
13 | case "$name" in
14 | *.proto)
15 | echo -e "$1$name"
16 | protoc --java_out=../java/ "$1$name"
17 | ;;
18 | *)
19 | #echo -e "$1$name"
20 | ;;
21 | esac
22 | fi
23 | done
24 |
25 | #/usr/bin/open ~/Release/
26 |
27 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/makefile:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------#
2 | # This makefile was generated by 'cbp2make' tool rev.147 #
3 | #------------------------------------------------------------------------------#
4 |
5 |
6 | WORKDIR = `pwd`
7 |
8 | CC = gcc
9 | CXX = g++
10 | AR = ar
11 | LD = g++
12 | WINDRES = windres
13 |
14 | INC =
15 | CFLAGS =
16 | RESINC =
17 | LIBDIR =
18 | LIB =
19 | LDFLAGS =
20 | SolutionDir = ../../
21 |
22 |
23 | INC_DEBUG_X64 = $(INC) -I$(SolutionDir) -I$(SolutionDir)/Dependencies/ -I$(SolutionDir)/Dependencies/protobuf/src
24 | CFLAGS_DEBUG_X64 = $(CFLAGS) -std=c++11 -g -fPIC -D_DEBUG
25 | RESINC_DEBUG_X64 = $(RESINC)
26 | RCFLAGS_DEBUG_X64 = $(RCFLAGS)
27 | LIBDIR_DEBUG_X64 = $(LIBDIR)
28 | LIB_DEBUG_X64 = $(LIB)
29 | LDFLAGS_DEBUG_X64 = $(LDFLAGS)
30 | OBJDIR_DEBUG_X64 = .objs/Debug
31 | DEP_DEBUG_X64 =
32 | OUT_DEBUG_X64 = $(SolutionDir)/_Out/Comm/Debug/NFMessageDefine_d.a
33 |
34 | INC_RELEASE_X64 = $(INC) -I$(SolutionDir) -I$(SolutionDir)/Dependencies/ -I$(SolutionDir)/Dependencies/protobuf/src
35 | CFLAGS_RELEASE_X64 = $(CFLAGS) -std=c++11 -fPIC -DNDEBUG
36 | RESINC_RELEASE_X64 = $(RESINC)
37 | RCFLAGS_RELEASE_X64 = $(RCFLAGS)
38 | LIBDIR_RELEASE_X64 = $(LIBDIR)
39 | LIB_RELEASE_X64 = $(LIB)
40 | LDFLAGS_RELEASE_X64 = $(LDFLAGS)
41 | OBJDIR_RELEASE_X64 = .objs/Release
42 | DEP_RELEASE_X64 =
43 | OUT_RELEASE_X64 = $(SolutionDir)/_Out/Comm/Release/NFMessageDefine.a
44 |
45 | OBJ_DEBUG_X64 = $(OBJDIR_DEBUG_X64)/NFSLGDefine.pb.o $(OBJDIR_DEBUG_X64)/NFMsgShare.pb.o $(OBJDIR_DEBUG_X64)/NFMsgPreGame.pb.o $(OBJDIR_DEBUG_X64)/NFMsgDefine.o $(OBJDIR_DEBUG_X64)/NFDefine.pb.o $(OBJDIR_DEBUG_X64)/NFMsgBaseEx.pb.o $(OBJDIR_DEBUG_X64)/NFMsgBase.pb.o $(OBJDIR_DEBUG_X64)/NFFleetingDefine.pb.o
46 |
47 | OBJ_RELEASE_X64 = $(OBJDIR_RELEASE_X64)/NFSLGDefine.pb.o $(OBJDIR_RELEASE_X64)/NFMsgShare.pb.o $(OBJDIR_RELEASE_X64)/NFMsgPreGame.pb.o $(OBJDIR_RELEASE_X64)/NFMsgDefine.o $(OBJDIR_RELEASE_X64)/NFDefine.pb.o $(OBJDIR_RELEASE_X64)/NFMsgBaseEx.pb.o $(OBJDIR_RELEASE_X64)/NFMsgBase.pb.o $(OBJDIR_RELEASE_X64)/NFFleetingDefine.pb.o
48 |
49 | all: debug_x64 release_x64
50 |
51 | clean: clean_debug_x64 clean_release_x64
52 |
53 | before_debug_x64:
54 | test -d $(SolutionDir)/_Out/Comm/Debug || mkdir -p $(SolutionDir)/_Out/Comm/Debug
55 | test -d $(OBJDIR_DEBUG_X64) || mkdir -p $(OBJDIR_DEBUG_X64)
56 |
57 | after_debug_x64:
58 |
59 | debug_x64: before_debug_x64 out_debug_x64 after_debug_x64
60 |
61 | out_debug_x64: before_debug_x64 $(OBJ_DEBUG_X64) $(DEP_DEBUG_X64)
62 | $(AR) rcs $(OUT_DEBUG_X64) $(OBJ_DEBUG_X64)
63 |
64 | $(OBJDIR_DEBUG_X64)/NFSLGDefine.pb.o: NFSLGDefine.pb.cc
65 | $(CC) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFSLGDefine.pb.cc -o $(OBJDIR_DEBUG_X64)/NFSLGDefine.pb.o
66 |
67 | $(OBJDIR_DEBUG_X64)/NFMsgShare.pb.o: NFMsgShare.pb.cc
68 | $(CC) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFMsgShare.pb.cc -o $(OBJDIR_DEBUG_X64)/NFMsgShare.pb.o
69 |
70 | $(OBJDIR_DEBUG_X64)/NFMsgPreGame.pb.o: NFMsgPreGame.pb.cc
71 | $(CC) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFMsgPreGame.pb.cc -o $(OBJDIR_DEBUG_X64)/NFMsgPreGame.pb.o
72 |
73 | $(OBJDIR_DEBUG_X64)/NFMsgDefine.o: NFMsgDefine.cpp
74 | $(CXX) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFMsgDefine.cpp -o $(OBJDIR_DEBUG_X64)/NFMsgDefine.o
75 |
76 | $(OBJDIR_DEBUG_X64)/NFDefine.pb.o: NFDefine.pb.cc
77 | $(CC) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFDefine.pb.cc -o $(OBJDIR_DEBUG_X64)/NFDefine.pb.o
78 |
79 | $(OBJDIR_DEBUG_X64)/NFMsgBaseEx.pb.o: NFMsgBaseEx.pb.cc
80 | $(CC) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFMsgBaseEx.pb.cc -o $(OBJDIR_DEBUG_X64)/NFMsgBaseEx.pb.o
81 |
82 | $(OBJDIR_DEBUG_X64)/NFMsgBase.pb.o: NFMsgBase.pb.cc
83 | $(CC) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFMsgBase.pb.cc -o $(OBJDIR_DEBUG_X64)/NFMsgBase.pb.o
84 |
85 | $(OBJDIR_DEBUG_X64)/NFFleetingDefine.pb.o: NFFleetingDefine.pb.cc
86 | $(CC) $(CFLAGS_DEBUG_X64) $(INC_DEBUG_X64) -c NFFleetingDefine.pb.cc -o $(OBJDIR_DEBUG_X64)/NFFleetingDefine.pb.o
87 |
88 | clean_debug_x64:
89 | rm -f $(OBJ_DEBUG_X64) $(OUT_DEBUG_X64)
90 | rm -rf $(SolutionDir)/_Out/Comm/Debug
91 | rm -rf $(OBJDIR_DEBUG_X64)
92 |
93 | before_release_x64:
94 | test -d $(SolutionDir)/_Out/Comm/Release || mkdir -p $(SolutionDir)/_Out/Comm/Release
95 | test -d $(OBJDIR_RELEASE_X64) || mkdir -p $(OBJDIR_RELEASE_X64)
96 |
97 | after_release_x64:
98 |
99 | release_x64: before_release_x64 out_release_x64 after_release_x64
100 |
101 | out_release_x64: before_release_x64 $(OBJ_RELEASE_X64) $(DEP_RELEASE_X64)
102 | $(AR) rcs $(OUT_RELEASE_X64) $(OBJ_RELEASE_X64)
103 |
104 | $(OBJDIR_RELEASE_X64)/NFSLGDefine.pb.o: NFSLGDefine.pb.cc
105 | $(CC) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFSLGDefine.pb.cc -o $(OBJDIR_RELEASE_X64)/NFSLGDefine.pb.o
106 |
107 | $(OBJDIR_RELEASE_X64)/NFMsgShare.pb.o: NFMsgShare.pb.cc
108 | $(CC) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFMsgShare.pb.cc -o $(OBJDIR_RELEASE_X64)/NFMsgShare.pb.o
109 |
110 | $(OBJDIR_RELEASE_X64)/NFMsgPreGame.pb.o: NFMsgPreGame.pb.cc
111 | $(CC) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFMsgPreGame.pb.cc -o $(OBJDIR_RELEASE_X64)/NFMsgPreGame.pb.o
112 |
113 | $(OBJDIR_RELEASE_X64)/NFMsgDefine.o: NFMsgDefine.cpp
114 | $(CXX) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFMsgDefine.cpp -o $(OBJDIR_RELEASE_X64)/NFMsgDefine.o
115 |
116 | $(OBJDIR_RELEASE_X64)/NFDefine.pb.o: NFDefine.pb.cc
117 | $(CC) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFDefine.pb.cc -o $(OBJDIR_RELEASE_X64)/NFDefine.pb.o
118 |
119 | $(OBJDIR_RELEASE_X64)/NFMsgBaseEx.pb.o: NFMsgBaseEx.pb.cc
120 | $(CC) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFMsgBaseEx.pb.cc -o $(OBJDIR_RELEASE_X64)/NFMsgBaseEx.pb.o
121 |
122 | $(OBJDIR_RELEASE_X64)/NFMsgBase.pb.o: NFMsgBase.pb.cc
123 | $(CC) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFMsgBase.pb.cc -o $(OBJDIR_RELEASE_X64)/NFMsgBase.pb.o
124 |
125 | $(OBJDIR_RELEASE_X64)/NFFleetingDefine.pb.o: NFFleetingDefine.pb.cc
126 | $(CC) $(CFLAGS_RELEASE_X64) $(INC_RELEASE_X64) -c NFFleetingDefine.pb.cc -o $(OBJDIR_RELEASE_X64)/NFFleetingDefine.pb.o
127 |
128 | clean_release_x64:
129 | rm -f $(OBJ_RELEASE_X64) $(OUT_RELEASE_X64)
130 | rm -rf $(SolutionDir)/_Out/Comm/Release
131 | rm -rf $(OBJDIR_RELEASE_X64)
132 |
133 | .PHONY: before_debug_x64 after_debug_x64 clean_debug_x64 before_release_x64 after_release_x64 clean_release_x64
134 |
135 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/protoEnumParse.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MetaXR/ProtobufTools/bc6f0525b21d96aa4dae66ae9010fdc65bc59181/protoFile/ProtoToCs/protoEnumParse.exe
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/protoToCs.bat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MetaXR/ProtobufTools/bc6f0525b21d96aa4dae66ae9010fdc65bc59181/protoFile/ProtoToCs/protoToCs.bat
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/protobuf-net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MetaXR/ProtobufTools/bc6f0525b21d96aa4dae66ae9010fdc65bc59181/protoFile/ProtoToCs/protobuf-net.dll
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/protoc-license.txt:
--------------------------------------------------------------------------------
1 | Protocol Buffers - Google's data interchange format
2 | Copyright 2008 Google Inc.
3 | http://code.google.com/p/protobuf/
4 |
5 | This package contains a precompiled Win32 binary version of the protocol buffer
6 | compiler (protoc). This binary is intended for Windows users who want to
7 | use Protocol Buffers in Java or Python but do not want to compile protoc
8 | themselves. To install, simply place this binary somewhere in your PATH.
9 |
10 | This binary was built using MinGW, but the output is the same regardless of
11 | the C++ compiler used.
12 |
13 | You will still need to download the source code package in order to obtain the
14 | Java or Python runtime libraries. Get it from:
15 | http://code.google.com/p/protobuf/downloads/
16 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/protoc.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MetaXR/ProtobufTools/bc6f0525b21d96aa4dae66ae9010fdc65bc59181/protoFile/ProtoToCs/protoc.exe
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/protogen.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MetaXR/ProtobufTools/bc6f0525b21d96aa4dae66ae9010fdc65bc59181/protoFile/ProtoToCs/protogen.exe
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/protogen.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/temp.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MetaXR/ProtobufTools/bc6f0525b21d96aa4dae66ae9010fdc65bc59181/protoFile/ProtoToCs/temp.txt
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/vb.xslt:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | VisualBasic template for protobuf-net.
43 | Options:
44 | General:
45 | "help" - this page
46 | Additional serializer support:
47 | "xml" - enable explicit xml support (XmlSerializer)
48 | "datacontract" - enable data-contract support (DataContractSerializer; requires .NET 3.0)
49 | "binary" - enable binary support (BinaryFormatter; not supported on Silverlight)
50 | Other:
51 | "protoRpc" - enable proto-rpc client
52 | "observable" - change notification (observer pattern) support
53 | "preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5)
54 | "partialMethods" - provide partial methods for changes (requires C# 3.0)
55 | "detectMissing" - provide *Specified properties to indicate whether fields are present
56 | "lightFramework" - omit additional attributes not included in CF/Silverlight
57 | "asynchronous" - emit asynchronous methods for use with WCF
58 | "clientProxy" - emit asynchronous client proxy class
59 |
60 |
61 |
62 |
63 |
64 | Invalid options: xml and data-contract serialization are mutually exclusive.
65 |
66 |
67 | ' Generated from
68 |
69 | ' Option: xml serialization ([XmlType]/[XmlElement]) enabled
70 |
71 | ' Option: data-contract serialization ([DataContract]/[DataMember]) enabled
72 |
73 | ' Option: binary serialization (ISerializable) enabled
74 |
75 | ' Option: observable (OnPropertyChanged) enabled
76 |
77 | ' Option: pre-observable (OnPropertyChanging) enabled
78 |
79 | ' Option: partial methods (On*Changing/On*Changed) enabled
80 |
81 | ' Option: missing-value detection (*Specified/ShouldSerialize*/Reset*) enabled
82 |
83 | ' Option: light framework (CF/Silverlight) enabled
84 |
85 | ' Option: proto-rpc enabled
86 |
87 |
88 |
89 |
90 |
91 | ' Generated from:
92 |
93 |
94 |
95 |
96 |
97 |
98 | Namespace
99 |
100 |
101 |
102 | End Namespace
103 |
104 |
105 | ' Note: requires additional types generated from:
106 |
107 |
108 |
109 |
110 | <Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="")> _
111 | <Global.System.Runtime.Serialization.DataContract(Name:="")> _
112 |
113 |
114 | <Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="")> _
115 | <Global.System.Xml.Serialization.XmlType(TypeName:="")> _
116 |
117 |
118 | <Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="")> _
119 |
120 | Public Partial Class
122 | implements Global.ProtoBuf.IExtensible, Global.System.Runtime.Serialization.ISerializable, Global.System.ComponentModel.INotifyPropertyChanged, Global.System.ComponentModel.INotifyPropertyChanging
126 |
127 | Public Sub New
128 | End Sub
129 |
130 | Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
131 | MyBase.New()
132 | Global.ProtoBuf.Serializer.Merge(info, Me)
133 | End Sub
134 |
135 | Sub GetObjectData(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) implements Global.System.Runtime.Serialization.ISerializable.GetObjectData
136 | Global.ProtoBuf.Serializer.Serialize(info, Me)
137 | End Sub
138 |
139 |
140 | Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
141 | Protected Overridable Sub OnPropertyChanged(ByVal propertyName As String)
142 | RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs(propertyName))
143 | End Sub
144 |
145 | Public Event PropertyChanging As Global.System.ComponentModel.PropertyChangingEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanging.PropertyChanging
146 | Protected Overridable Sub OnPropertyChanging(ByVal propertyName As String)
147 | RaiseEvent PropertyChanging(Me, New Global.System.ComponentModel.PropertyChangingEventArgs(propertyName))
148 | End Sub
149 |
150 | Private extensionObject As Global.ProtoBuf.IExtension
151 | Function GetExtensionObject(createIfMissing As Boolean) As Global.ProtoBuf.IExtension Implements Global.ProtoBuf.IExtensible.GetExtensionObject
152 | Return Global.ProtoBuf.Extensible.GetExtensionObject(extensionObject, createIfMissing)
153 | End Function
154 | End Class
155 |
156 |
157 |
158 |
159 |
160 |
161 |
165 |
166 |
167 |
168 |
169 | Public Enum
170 |
171 | End Enum
172 |
173 |
174 |
175 |
176 |
177 |
178 | =
179 |
180 | 0
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 | FixedSize
198 | Group
199 | TwosComplement
202 | ZigZag
203 | Default
204 |
205 |
206 |
207 |
208 | struct
209 | struct
210 | struct
211 | struct
212 | struct
213 | struct
214 | struct
215 | struct
216 | struct
217 | class
218 | class
219 | struct
220 | struct
221 | struct
222 | struct
223 | struct
224 | struct
225 | none
226 |
227 |
228 | Field type not implemented: (.)
229 |
230 |
231 |
232 |
233 |
234 |
235 | double
236 | Double
237 | Single
238 | Long
239 | ULong
240 | Integer
241 | ULong
242 | UInteger
243 | Boolean
244 | String
245 | Byte()
246 | UInteger
247 | Integer
248 | Long
249 | Integer
250 | Long
251 |
252 |
253 |
254 |
255 |
256 | Field type not implemented: (.)
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 | ""
266 | .
267 | '
268 | CType(, )
269 |
270 |
271 |
272 |
280 |
281 |
282 |
283 |
284 | .
285 | .
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 | 0.0
295 | 0.0F
296 | 0L
297 | 0L
298 | 0
299 | 0L
300 | 0
301 | False
302 | ""
303 | Nothing
304 | 0
305 | 0
306 | 0L
307 | 0
308 | 0L
309 | Nothing
310 | .
311 | Nothing
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 | Nullable(Of )
323 |
324 |
325 |
326 | Private =
327 |
328 |
329 | Private =
330 |
331 |
332 |
333 |
334 | <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
335 |
336 |
337 | <Global.System.ComponentModel.DefaultValue(CType(, ))> _
338 |
339 |
340 | <Global.System.ComponentModel.DefaultValue(CType(, ))> _
341 |
342 |
343 | <Global.System.Xml.Serialization.XmlElement("", Order:=)> _
345 |
346 | <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
347 |
348 |
349 | <Global.System.ComponentModel.DefaultValue(CType(, ))> _
350 |
351 |
352 | <Global.System.ComponentModel.DefaultValue(CType(, ))> _
353 |
354 |
355 | <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=False)> _
357 |
358 | <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
360 |
361 | <Global.System.ComponentModel.DefaultValue(CType(, ))> _
363 |
364 | <Global.System.ComponentModel.DefaultValue(CType(, ))> _
366 |
368 |
369 | <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
370 | <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=False)> _
372 |
373 | <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
374 | <Global.System.Xml.Serialization.XmlElement("", Order:=)> _
376 |
377 | <Global.ProtoBuf.ProtoMember(, IsRequired:=False, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
379 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 | Private
411 |
412 |
413 | <Global.ProtoBuf.ProtoMember(, IsRequired:=True, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
414 | <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=True)> _
416 |
417 | <Global.ProtoBuf.ProtoMember(, IsRequired:=True, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
418 | <Global.System.Xml.Serialization.XmlElement("", Order:=)> _
420 |
421 | <Global.ProtoBuf.ProtoMember(, IsRequired:=True, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
423 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 | Public Property
443 |
444 |
445 | Public Property
446 |
447 |
448 | Get
449 |
450 | Return
453 |
454 | If Not Is Nothing Then
455 | Return
456 | Else
457 | Return
458 | End If
460 | Return
463 |
464 | End Get
465 |
466 |
467 | Set()
468 |
469 |
470 | Set()
471 |
472 |
473 | OnChanging(value)
474 | OnPropertyChanging("")
475 | = value
476 | OnPropertyChanged("") OnChanged()
477 | End Set
478 | End Property
479 |
480 | partial void OnChanging( value);
481 | partial void OnChanged();
482 | <Global.System.Xml.Serialization.XmlIgnore> _
483 | <Global.System.ComponentModel.Browsable(false)> _
484 |
485 |
486 | Public Property Specified As Boolean
487 | Get
488 | Return .HasValue
489 | End Get
490 | Set (ByVal value As Boolean)
491 | If Not .HasValue Then
492 | If value = True then =
493 | Else
494 | If value = False then = Nothing
495 | End If
496 | End Set
497 | End Property
498 |
499 |
500 | Public Property Specified As Boolean
501 | Get
502 | Return IsNot Nothing
503 | End Get
504 | Set (ByVal value As Boolean)
505 | If Is Nothing Then
506 | If value = True then =
507 | Else
508 | If value = False then = Nothing
509 | End If
510 | End Set
511 | End Property
512 |
513 |
514 | Private Function ShouldSerialize() As Boolean
515 | Return Specified
516 | End Function
517 | Private Sub Reset()
518 | Specified = false
519 | End Sub
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 | Private ReadOnly as Global.System.Collections.Generic.List(Of ) = New Global.System.Collections.Generic.List(Of )()
529 |
530 |
531 | Private ReadOnly as Global.System.Collections.Generic.List(Of ) = New Global.System.Collections.Generic.List(Of )()
532 |
533 |
534 |
535 |
536 | <Global.ProtoBuf.ProtoMember(, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
537 | <Global.System.Runtime.Serialization.DataMember(Name:="", Order:=, IsRequired:=False)> _
538 |
539 |
540 | <Global.ProtoBuf.ProtoMember(, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
541 | <Global.System.Xml.Serialization.XmlElement("", Order:=)> _
542 |
543 |
544 | <Global.ProtoBuf.ProtoMember(, Name:="", DataFormat:=Global.ProtoBuf.DataFormat.)> _
545 |
546 |
548 | Public ReadOnly Property As Global.System.Collections.Generic.List(Of )
550 |
551 | Public ReadOnly Property As Global.System.Collections.Generic.List(Of )
553 |
554 |
555 | Get
556 | Return
557 | End Get
558 |
559 |
560 |
561 | Set (value As Global.System.Collections.Generic.List(Of ))
562 |
563 |
564 | Set (value As Global.System.Collections.Generic.List(Of ))
565 |
566 |
567 | = value
568 | End Set
569 |
570 | End Property
571 |
572 |
573 |
574 |
575 | <Global.System.ServiceModel.ServiceContract(Name:="")> _
576 |
577 | Public Interface I
578 |
579 | End Interface
580 |
581 |
582 | Public Class Client : Global.ProtoBuf.ServiceModel.RpcClient
583 | public Client() : base(typeof(I)) { }
584 |
585 |
586 | End Class
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 | <Global.System.ServiceModel.OperationContract(Name:="")> _
595 | <Global.ProtoBuf.ServiceModel.ProtoBehavior()> _
596 |
597 | ( request);
598 |
599 | <Global.System.ServiceModel.OperationContract(AsyncPattern:=True, Name:="")> _
600 | Global.System.IAsyncResult Begin( request, Global.System.AsyncCallback callback, object state);
601 | End(Global.System.IAsyncResult ar);
602 |
603 |
604 |
605 |
606 | ( request)
607 | {
608 | return () Send("", request);
609 | }
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 | Public Class CompletedEventArgs : Global.System.ComponentModel.AsyncCompletedEventArgs
619 | private object[] results;
620 |
621 | public CompletedEventArgs(object[] results, Global.System.Exception exception, bool cancelled, object userState)
622 | : base(exception, cancelled, userState)
623 | {
624 | this.results = results;
625 | }
626 |
627 | public Result
628 | {
629 | get {
630 | base.RaiseExceptionIfNecessary();
631 | return ()(this.results[0]);
632 | }
633 | }
634 | End Class
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 | <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
643 | public partial class Client : Global.System.ServiceModel.ClientBase<I>, I
644 | {
645 |
646 | public Client()
647 | {}
648 | public Client(string endpointConfigurationName)
649 | : base(endpointConfigurationName)
650 | {}
651 | public Client(string endpointConfigurationName, string remoteAddress)
652 | : base(endpointConfigurationName, remoteAddress)
653 | {}
654 | public Client(string endpointConfigurationName, Global.System.ServiceModel.EndpointAddress remoteAddress)
655 | : base(endpointConfigurationName, remoteAddress)
656 | {}
657 | public Client(Global.System.ServiceModel.Channels.Binding binding, Global.System.ServiceModel.EndpointAddress remoteAddress)
658 | : base(binding, remoteAddress)
659 | {}
660 |
661 |
662 | }
663 |
664 |
665 |
666 |
667 |
668 | private BeginOperationDelegate onBeginDelegate;
669 | private EndOperationDelegate onEndDelegate;
670 | private Global.System.Threading.SendOrPostCallback onCompletedDelegate;
671 |
672 | public event Global.System.EventHandler<CompletedEventArgs> Completed;
673 |
674 | public ( request)
675 | {
676 | return base.Channel.(request);
677 | }
678 |
679 | <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
680 | public Global.System.IAsyncResult Begin( request, Global.System.AsyncCallback callback, object asyncState)
681 | {
682 | return base.Channel.Begin(request, callback, asyncState);
683 | }
684 |
685 | <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
686 | public End(Global.System.IAsyncResult result)
687 | {
688 | return base.Channel.End(result);
689 | }
690 |
691 | private Global.System.IAsyncResult OnBegin(object[] inValues, Global.System.AsyncCallback callback, object asyncState)
692 | {
693 | request = (()(inValues[0]));
694 | return this.Begin(request, callback, asyncState);
695 | }
696 |
697 | private object[] OnEnd(Global.System.IAsyncResult result)
698 | {
699 | retVal = this.End(result);
700 | return new object[] {
701 | retVal};
702 | }
703 |
704 | private void OnCompleted(object state)
705 | {
706 | if ((this.Completed != null))
707 | {
708 | InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
709 | this.Completed(this, new CompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
710 | }
711 | }
712 |
713 | public void Async( request)
714 | {
715 | this.Async(request, null);
716 | }
717 |
718 | public void Async( request, object userState)
719 | {
720 | if ((this.onBeginDelegate == null))
721 | {
722 | this.onBeginDelegate = new BeginOperationDelegate(this.OnBegin);
723 | }
724 | if ((this.onEndDelegate == null))
725 | {
726 | this.onEndDelegate = new EndOperationDelegate(this.OnEnd);
727 | }
728 | if ((this.onCompletedDelegate == null))
729 | {
730 | this.onCompletedDelegate = new Global.System.Threading.SendOrPostCallback(this.OnCompleted);
731 | }
732 | base.InvokeAsync(this.onBeginDelegate, new object[] {
733 | request}, this.onEndDelegate, this.onCompletedDelegate, userState);
734 | }
735 |
736 |
737 |
738 |
739 | []
740 |
741 |
742 | |AddHandler|AddressOf|Alias|And|AndAlso|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDec|CDbl|Char|CInt|Class|CLng|CObj|Const|Continue|CSByte|CShort|CSng|CStr|CType|CUInt|CULng|CUShort|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|False|Finally|For|Friend|Function|Get|GetType|GetXMLNamespace|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|Narrowing|New|Next|Not|Nothing|NotInheritable|NotOverridable|Object|Of|On|Operator|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|REM|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|True|Try|TryCast|TypeOf|Variant|Wend|UInteger|ULong|UShort|Using|When|While|Widening|With|WithEvents|WriteOnly|Xor|
743 |
744 |
745 |
746 |
--------------------------------------------------------------------------------
/protoFile/ProtoToCs/xml.xslt:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Xml template for protobuf-net.
13 |
14 | This template writes the proto descriptor as xml.
15 | No options available.
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/protoFile/Unpacktool/Unpacktool.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 | using System.Collections.Generic;
4 | using protocol;
5 | using ProtoBuf;
6 | using System.IO;
7 |
8 | namespace NetWorkFrame
9 | {
10 | public class UnPackTool
11 | {
12 | public static IExtensible UnPack(ENetworkMessage networkMessage, int startIndex, int length, byte[] buffer)
13 | {
14 | IExtensible packet = null;
15 |
16 | try
17 | {
18 | using (MemoryStream streamForProto = new MemoryStream(buffer, startIndex, length))
19 | {
20 | switch (networkMessage)
21 | {
22 | case ENetworkMessage.KEEP_ALIVE_SYNC:
23 | packet = Serializer.Deserialize(streamForProto);
24 | break;
25 | case ENetworkMessage.LOGIN_REQ:
26 | packet = Serializer.Deserialize(streamForProto);
27 | break;
28 | case ENetworkMessage.LOGIN_RSP:
29 | packet = Serializer.Deserialize(streamForProto);
30 | break;
31 | case ENetworkMessage.GET_USERINFO_REQ:
32 | packet = Serializer.Deserialize(streamForProto);
33 | break;
34 | case ENetworkMessage.GET_USERINFO_RSP:
35 | packet = Serializer.Deserialize(streamForProto);
36 | break;
37 | case ENetworkMessage.LOGOUT_REQ:
38 | packet = Serializer.Deserialize(streamForProto);
39 | break;
40 | case ENetworkMessage.LOGOUT_RSP:
41 | packet = Serializer.Deserialize(streamForProto);
42 | break;
43 | case ENetworkMessage.OFFLINE_SYNC:
44 | packet = Serializer.Deserialize(streamForProto);
45 | break;
46 | case ENetworkMessage.GET_QUESTION_INFO_REQ:
47 | packet = Serializer.Deserialize(streamForProto);
48 | break;
49 | case ENetworkMessage.GET_QUESTION_INFO_RSP:
50 | packet = Serializer.Deserialize(streamForProto);
51 | break;
52 | default:
53 | Log4U.LogInfo("No Such Packet, packet type is " + networkMessage);
54 | break;
55 | }
56 | }
57 | }
58 | catch (System.Exception ex)
59 | {
60 | Log4U.LogError(ex.Message + "\n " + ex.StackTrace + "\n" + ex.Source);
61 |
62 | }return packet;
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------