OuterMessage.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. using ProtoBuf;
  2. using Model;
  3. using System.Collections.Generic;
  4. using MongoDB.Bson.Serialization.Attributes;
  5. namespace Model
  6. {
  7. [Message(OuterOpcode.Actor_Test)]
  8. [ProtoContract]
  9. public partial class Actor_Test: MessageObject, IActorMessage
  10. {
  11. [ProtoMember(1, IsRequired = true)]
  12. public string Info;
  13. }
  14. [Message(OuterOpcode.Actor_TestRequest)]
  15. [ProtoContract]
  16. public partial class Actor_TestRequest: MessageObject, IActorRequest
  17. {
  18. [ProtoMember(1, IsRequired = true)]
  19. public string request;
  20. }
  21. [Message(OuterOpcode.Actor_TestResponse)]
  22. [ProtoContract]
  23. public partial class Actor_TestResponse: MessageObject, IActorResponse
  24. {
  25. [ProtoMember(90, IsRequired = true)]
  26. public int Error { get; set; }
  27. [ProtoMember(91, IsRequired = true)]
  28. public string Message { get; set; }
  29. [ProtoMember(1, IsRequired = true)]
  30. public string response;
  31. }
  32. [Message(OuterOpcode.Actor_TransferRequest)]
  33. [ProtoContract]
  34. public partial class Actor_TransferRequest: MessageObject, IActorRequest
  35. {
  36. [ProtoMember(1, IsRequired = true)]
  37. public int MapIndex;
  38. }
  39. [Message(OuterOpcode.Actor_TransferResponse)]
  40. [ProtoContract]
  41. public partial class Actor_TransferResponse: MessageObject, IActorResponse
  42. {
  43. [ProtoMember(90, IsRequired = true)]
  44. public int Error { get; set; }
  45. [ProtoMember(91, IsRequired = true)]
  46. public string Message { get; set; }
  47. }
  48. [Message(OuterOpcode.C2G_EnterMap)]
  49. [ProtoContract]
  50. public partial class C2G_EnterMap: IRequest
  51. {
  52. }
  53. [Message(OuterOpcode.G2C_EnterMap)]
  54. [ProtoContract]
  55. public partial class G2C_EnterMap: IResponse
  56. {
  57. [ProtoMember(90, IsRequired = true)]
  58. public int Error { get; set; }
  59. [ProtoMember(91, IsRequired = true)]
  60. public string Message { get; set; }
  61. [ProtoMember(1, IsRequired = true)]
  62. public long UnitId;
  63. [ProtoMember(2, IsRequired = true)]
  64. public int Count;
  65. }
  66. [Message(OuterOpcode.UnitInfo)]
  67. [ProtoContract]
  68. public partial class UnitInfo
  69. {
  70. [ProtoMember(1, IsRequired = true)]
  71. public long UnitId;
  72. [ProtoMember(2, IsRequired = true)]
  73. public int X;
  74. [ProtoMember(3, IsRequired = true)]
  75. public int Z;
  76. }
  77. [Message(OuterOpcode.Actor_CreateUnits)]
  78. [ProtoContract]
  79. public partial class Actor_CreateUnits: MessageObject, IActorMessage
  80. {
  81. [ProtoMember(1)]
  82. public List<UnitInfo> Units = new List<UnitInfo>();
  83. }
  84. [Message(OuterOpcode.FrameMessageInfo)]
  85. [ProtoContract]
  86. public partial class FrameMessageInfo
  87. {
  88. [ProtoMember(1, IsRequired = true)]
  89. public long Id;
  90. [ProtoMember(2, IsRequired = true)]
  91. public MessageObject Message;
  92. }
  93. [Message(OuterOpcode.Frame_ClickMap)]
  94. [ProtoContract]
  95. public partial class Frame_ClickMap: MessageObject, IFrameMessage
  96. {
  97. [ProtoMember(92, IsRequired = true)]
  98. public long Id { get; set; }
  99. [ProtoMember(1, IsRequired = true)]
  100. public int X;
  101. [ProtoMember(2, IsRequired = true)]
  102. public int Z;
  103. }
  104. [Message(OuterOpcode.C2M_Reload)]
  105. [ProtoContract]
  106. public partial class C2M_Reload: IRequest
  107. {
  108. [ProtoMember(1, IsRequired = true)]
  109. public AppType AppType;
  110. }
  111. [Message(OuterOpcode.M2C_Reload)]
  112. [ProtoContract]
  113. public partial class M2C_Reload: IResponse
  114. {
  115. [ProtoMember(90, IsRequired = true)]
  116. public int Error { get; set; }
  117. [ProtoMember(91, IsRequired = true)]
  118. public string Message { get; set; }
  119. }
  120. [Message(OuterOpcode.C2R_Ping)]
  121. [ProtoContract]
  122. public partial class C2R_Ping: IRequest
  123. {
  124. }
  125. [Message(OuterOpcode.R2C_Ping)]
  126. [ProtoContract]
  127. public partial class R2C_Ping: IResponse
  128. {
  129. [ProtoMember(90, IsRequired = true)]
  130. public int Error { get; set; }
  131. [ProtoMember(91, IsRequired = true)]
  132. public string Message { get; set; }
  133. }
  134. }
  135. #if SERVER
  136. namespace Model
  137. {
  138. [BsonKnownTypes(typeof(Actor_Test))]
  139. [BsonKnownTypes(typeof(Actor_TestRequest))]
  140. [BsonKnownTypes(typeof(Actor_TestResponse))]
  141. [BsonKnownTypes(typeof(Actor_TransferRequest))]
  142. [BsonKnownTypes(typeof(Actor_TransferResponse))]
  143. [BsonKnownTypes(typeof(Actor_CreateUnits))]
  144. [BsonKnownTypes(typeof(Frame_ClickMap))]
  145. public partial class MessageObject {}
  146. }
  147. #endif
  148. namespace Model
  149. {
  150. [ProtoInclude(OuterOpcode.Actor_Test, typeof(Actor_Test))]
  151. [ProtoInclude(OuterOpcode.Actor_TestRequest, typeof(Actor_TestRequest))]
  152. [ProtoInclude(OuterOpcode.Actor_TestResponse, typeof(Actor_TestResponse))]
  153. [ProtoInclude(OuterOpcode.Actor_TransferRequest, typeof(Actor_TransferRequest))]
  154. [ProtoInclude(OuterOpcode.Actor_TransferResponse, typeof(Actor_TransferResponse))]
  155. [ProtoInclude(OuterOpcode.Actor_CreateUnits, typeof(Actor_CreateUnits))]
  156. [ProtoInclude(OuterOpcode.Frame_ClickMap, typeof(Frame_ClickMap))]
  157. public partial class MessageObject {}
  158. }