|
|
@@ -1,214 +1,243 @@
|
|
|
+using ProtoBuf;
|
|
|
using System.Collections.Generic;
|
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
-using ProtoBuf;
|
|
|
-
|
|
|
namespace Model
|
|
|
{
|
|
|
- [BsonKnownTypes(typeof(AActorMessage))]
|
|
|
- public abstract partial class AMessage
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- [BsonKnownTypes(typeof(AActorRequest))]
|
|
|
- [ProtoInclude((int)Opcode.C2R_Login, typeof(C2R_Login))]
|
|
|
- [ProtoInclude((int)Opcode.C2G_LoginGate, typeof(C2G_LoginGate))]
|
|
|
- [ProtoInclude((int)Opcode.C2G_EnterMap, typeof(C2G_EnterMap))]
|
|
|
- [ProtoInclude((int)Opcode.C2R_Ping, typeof(C2R_Ping))]
|
|
|
- public abstract partial class ARequest : AMessage
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- [BsonKnownTypes(typeof(AActorResponse))]
|
|
|
- [ProtoInclude((int)Opcode.R2C_Login, typeof(R2C_Login))]
|
|
|
- [ProtoInclude((int)Opcode.G2C_LoginGate, typeof(G2C_LoginGate))]
|
|
|
- [ProtoInclude((int)Opcode.G2C_EnterMap, typeof(G2C_EnterMap))]
|
|
|
- [ProtoInclude((int)Opcode.R2C_Ping, typeof(R2C_Ping))]
|
|
|
- public abstract partial class AResponse : AMessage
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- [BsonKnownTypes(typeof(Actor_Test))]
|
|
|
- [BsonKnownTypes(typeof(AFrameMessage))]
|
|
|
- [BsonKnownTypes(typeof(Actor_CreateUnits))]
|
|
|
- [BsonKnownTypes(typeof(FrameMessage))]
|
|
|
- [ProtoInclude((int)Opcode.FrameMessage, typeof(FrameMessage))]
|
|
|
- [ProtoInclude((int)Opcode.AFrameMessage, typeof(AFrameMessage))]
|
|
|
- [ProtoInclude((int)Opcode.Actor_CreateUnits, typeof(Actor_CreateUnits))]
|
|
|
- public abstract partial class AActorMessage : AMessage
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- [BsonKnownTypes(typeof(Actor_TestRequest))]
|
|
|
- [BsonKnownTypes(typeof(Actor_TransferRequest))]
|
|
|
- public abstract partial class AActorRequest : ARequest
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- [BsonKnownTypes(typeof(Actor_TestResponse))]
|
|
|
- [BsonKnownTypes(typeof(Actor_TransferResponse))]
|
|
|
- public abstract partial class AActorResponse : AResponse
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 帧消息,继承这个类的消息会经过服务端转发
|
|
|
- /// </summary>
|
|
|
- [ProtoInclude((int)Opcode.Frame_ClickMap, typeof(Frame_ClickMap))]
|
|
|
- [BsonKnownTypes(typeof(Frame_ClickMap))]
|
|
|
- public abstract partial class AFrameMessage : AActorMessage
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.C2R_Login)]
|
|
|
- public class C2R_Login: ARequest
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class C2R_Login: ARequest
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public string Account;
|
|
|
|
|
|
- [ProtoMember(2)]
|
|
|
+ [ProtoMember(2, IsRequired = true)]
|
|
|
public string Password;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.R2C_Login)]
|
|
|
- public class R2C_Login: AResponse
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class R2C_Login: AResponse
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
- public string Address { get; set; }
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
+ public string Address;
|
|
|
+
|
|
|
+ [ProtoMember(2, IsRequired = true)]
|
|
|
+ public long Key;
|
|
|
|
|
|
- [ProtoMember(2)]
|
|
|
- public long Key { get; set; }
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.C2G_LoginGate)]
|
|
|
- public class C2G_LoginGate: ARequest
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class C2G_LoginGate: ARequest
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public long Key;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.G2C_LoginGate)]
|
|
|
- public class G2C_LoginGate: AResponse
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class G2C_LoginGate: AResponse
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public long PlayerId;
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
[Message(Opcode.Actor_Test)]
|
|
|
- public class Actor_Test : AActorMessage
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class Actor_Test: AActorMessage
|
|
|
{
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public string Info;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
[Message(Opcode.Actor_TestRequest)]
|
|
|
- public class Actor_TestRequest : AActorRequest
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class Actor_TestRequest: AActorRequest
|
|
|
{
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public string request;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
[Message(Opcode.Actor_TestResponse)]
|
|
|
- public class Actor_TestResponse : AActorResponse
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class Actor_TestResponse: AActorResponse
|
|
|
{
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public string response;
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
[Message(Opcode.Actor_TransferRequest)]
|
|
|
- public class Actor_TransferRequest : AActorRequest
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class Actor_TransferRequest: AActorRequest
|
|
|
{
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public int MapIndex;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
[Message(Opcode.Actor_TransferResponse)]
|
|
|
- public class Actor_TransferResponse : AActorResponse
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class Actor_TransferResponse: AActorResponse
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.C2G_EnterMap)]
|
|
|
- public class C2G_EnterMap: ARequest
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class C2G_EnterMap: ARequest
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.G2C_EnterMap)]
|
|
|
- public class G2C_EnterMap: AResponse
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class G2C_EnterMap: AResponse
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public long UnitId;
|
|
|
- [ProtoMember(2)]
|
|
|
+
|
|
|
+ [ProtoMember(2, IsRequired = true)]
|
|
|
public int Count;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ [Message(Opcode.UnitInfo)]
|
|
|
[ProtoContract]
|
|
|
- public class UnitInfo
|
|
|
+ public partial class UnitInfo
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public long UnitId;
|
|
|
- [ProtoMember(2)]
|
|
|
+
|
|
|
+ [ProtoMember(2, IsRequired = true)]
|
|
|
public int X;
|
|
|
- [ProtoMember(3)]
|
|
|
+
|
|
|
+ [ProtoMember(3, IsRequired = true)]
|
|
|
public int Z;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.Actor_CreateUnits)]
|
|
|
- public class Actor_CreateUnits : AActorMessage
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class Actor_CreateUnits: AActorMessage
|
|
|
{
|
|
|
[ProtoMember(1)]
|
|
|
public List<UnitInfo> Units = new List<UnitInfo>();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- public struct FrameMessageInfo
|
|
|
+ [Message(Opcode.FrameMessageInfo)]
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class FrameMessageInfo
|
|
|
{
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public long Id;
|
|
|
+
|
|
|
+ [ProtoMember(2, IsRequired = true)]
|
|
|
public AMessage Message;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.FrameMessage)]
|
|
|
- public class FrameMessage : AActorMessage
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class FrameMessage: AActorMessage
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public int Frame;
|
|
|
+
|
|
|
[ProtoMember(2)]
|
|
|
public List<AFrameMessage> Messages = new List<AFrameMessage>();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.Frame_ClickMap)]
|
|
|
- public class Frame_ClickMap: AFrameMessage
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class Frame_ClickMap: AFrameMessage
|
|
|
{
|
|
|
- [ProtoMember(1)]
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public int X;
|
|
|
- [ProtoMember(2)]
|
|
|
+
|
|
|
+ [ProtoMember(2, IsRequired = true)]
|
|
|
public int Z;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
[Message(Opcode.C2M_Reload)]
|
|
|
- public class C2M_Reload: ARequest
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class C2M_Reload: ARequest
|
|
|
{
|
|
|
+ [ProtoMember(1, IsRequired = true)]
|
|
|
public AppType AppType;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
[Message(Opcode.M2C_Reload)]
|
|
|
- public class M2C_Reload: AResponse
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class M2C_Reload: AResponse
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.C2R_Ping)]
|
|
|
- public class C2R_Ping: ARequest
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class C2R_Ping: ARequest
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- [ProtoContract]
|
|
|
[Message(Opcode.R2C_Ping)]
|
|
|
- public class R2C_Ping: AResponse
|
|
|
+ [ProtoContract]
|
|
|
+ public partial class R2C_Ping: AResponse
|
|
|
{
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+ [ProtoInclude((int)Opcode.Actor_Test, typeof(Actor_Test))]
|
|
|
+ [ProtoInclude((int)Opcode.Actor_CreateUnits, typeof(Actor_CreateUnits))]
|
|
|
+ [ProtoInclude((int)Opcode.FrameMessage, typeof(FrameMessage))]
|
|
|
+ [BsonKnownTypes(typeof(Actor_Test))]
|
|
|
+ [BsonKnownTypes(typeof(Actor_CreateUnits))]
|
|
|
+ [BsonKnownTypes(typeof(FrameMessage))]
|
|
|
+ public partial class AActorMessage {}
|
|
|
+
|
|
|
+ [ProtoInclude((int)Opcode.Actor_TestRequest, typeof(Actor_TestRequest))]
|
|
|
+ [ProtoInclude((int)Opcode.Actor_TransferRequest, typeof(Actor_TransferRequest))]
|
|
|
+ [BsonKnownTypes(typeof(Actor_TestRequest))]
|
|
|
+ [BsonKnownTypes(typeof(Actor_TransferRequest))]
|
|
|
+ public partial class AActorRequest {}
|
|
|
+
|
|
|
+ [ProtoInclude((int)Opcode.Actor_TestResponse, typeof(Actor_TestResponse))]
|
|
|
+ [ProtoInclude((int)Opcode.Actor_TransferResponse, typeof(Actor_TransferResponse))]
|
|
|
+ [BsonKnownTypes(typeof(Actor_TestResponse))]
|
|
|
+ [BsonKnownTypes(typeof(Actor_TransferResponse))]
|
|
|
+ public partial class AActorResponse {}
|
|
|
+
|
|
|
+ [ProtoInclude((int)Opcode.Frame_ClickMap, typeof(Frame_ClickMap))]
|
|
|
+ [BsonKnownTypes(typeof(Frame_ClickMap))]
|
|
|
+ public partial class AFrameMessage {}
|
|
|
+
|
|
|
+ [ProtoInclude((int)Opcode.C2R_Login, typeof(C2R_Login))]
|
|
|
+ [ProtoInclude((int)Opcode.C2G_LoginGate, typeof(C2G_LoginGate))]
|
|
|
+ [ProtoInclude((int)Opcode.C2G_EnterMap, typeof(C2G_EnterMap))]
|
|
|
+ [ProtoInclude((int)Opcode.C2M_Reload, typeof(C2M_Reload))]
|
|
|
+ [ProtoInclude((int)Opcode.C2R_Ping, typeof(C2R_Ping))]
|
|
|
+ [BsonKnownTypes(typeof(C2R_Login))]
|
|
|
+ [BsonKnownTypes(typeof(C2G_LoginGate))]
|
|
|
+ [BsonKnownTypes(typeof(C2G_EnterMap))]
|
|
|
+ [BsonKnownTypes(typeof(C2M_Reload))]
|
|
|
+ [BsonKnownTypes(typeof(C2R_Ping))]
|
|
|
+ public partial class ARequest {}
|
|
|
+
|
|
|
+ [ProtoInclude((int)Opcode.R2C_Login, typeof(R2C_Login))]
|
|
|
+ [ProtoInclude((int)Opcode.G2C_LoginGate, typeof(G2C_LoginGate))]
|
|
|
+ [ProtoInclude((int)Opcode.G2C_EnterMap, typeof(G2C_EnterMap))]
|
|
|
+ [ProtoInclude((int)Opcode.M2C_Reload, typeof(M2C_Reload))]
|
|
|
+ [ProtoInclude((int)Opcode.R2C_Ping, typeof(R2C_Ping))]
|
|
|
+ [BsonKnownTypes(typeof(R2C_Login))]
|
|
|
+ [BsonKnownTypes(typeof(G2C_LoginGate))]
|
|
|
+ [BsonKnownTypes(typeof(G2C_EnterMap))]
|
|
|
+ [BsonKnownTypes(typeof(M2C_Reload))]
|
|
|
+ [BsonKnownTypes(typeof(R2C_Ping))]
|
|
|
+ public partial class AResponse {}
|
|
|
+
|
|
|
+}
|