HotfixMessage.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using Hotfix;
  2. using Model;
  3. using MongoDB.Bson.Serialization.Attributes;
  4. using ProtoBuf;
  5. namespace Hotfix
  6. {
  7. [Message(HotfixOpcode.C2R_Login)]
  8. [ProtoContract]
  9. public class C2R_Login : MessageObject, IRequest
  10. {
  11. [ProtoMember(1, IsRequired = true)]
  12. public string Account;
  13. [ProtoMember(2, IsRequired = true)]
  14. public string Password;
  15. }
  16. [Message(HotfixOpcode.R2C_Login)]
  17. [ProtoContract]
  18. public class R2C_Login : MessageObject, IResponse
  19. {
  20. [ProtoMember(1, IsRequired = true)]
  21. public string Address;
  22. [ProtoMember(2, IsRequired = true)]
  23. public long Key;
  24. [ProtoMember(90, IsRequired = true)]
  25. public int Error { get; set; }
  26. [ProtoMember(91, IsRequired = true)]
  27. public string Message { get; set; }
  28. }
  29. [Message(HotfixOpcode.C2G_LoginGate)]
  30. [ProtoContract]
  31. public class C2G_LoginGate : MessageObject, IRequest
  32. {
  33. [ProtoMember(1, IsRequired = true)]
  34. public long Key;
  35. }
  36. [Message(HotfixOpcode.G2C_LoginGate)]
  37. [ProtoContract]
  38. public class G2C_LoginGate : MessageObject, IResponse
  39. {
  40. [ProtoMember(1, IsRequired = true)]
  41. public long PlayerId;
  42. [ProtoMember(90, IsRequired = true)]
  43. public int Error { get; set; }
  44. [ProtoMember(91, IsRequired = true)]
  45. public string Message { get; set; }
  46. }
  47. [Message(HotfixOpcode.G2C_TestHotfixMessage)]
  48. [ProtoContract]
  49. public class G2C_TestHotfixMessage : MessageObject, IMessage
  50. {
  51. [ProtoMember(1, IsRequired = true)]
  52. public string Info;
  53. }
  54. [Message(HotfixOpcode.C2M_TestActorRequest)]
  55. [ProtoContract]
  56. public class C2M_TestActorRequest : MessageObject, IActorRequest
  57. {
  58. [ProtoMember(1, IsRequired = true)]
  59. public string Info;
  60. }
  61. [Message(HotfixOpcode.M2C_TestActorResponse)]
  62. [ProtoContract]
  63. public class M2C_TestActorResponse : MessageObject, IActorResponse
  64. {
  65. [ProtoMember(1, IsRequired = true)]
  66. public string Info;
  67. [ProtoMember(90, IsRequired = true)]
  68. public int Error { get; set; }
  69. [ProtoMember(91, IsRequired = true)]
  70. public string Message { get; set; }
  71. }
  72. }
  73. #if SERVER
  74. namespace Model
  75. {
  76. [BsonKnownTypes(typeof(M2C_TestActorResponse))]
  77. [BsonKnownTypes(typeof(C2M_TestActorRequest))]
  78. public partial class MessageObject
  79. {
  80. }
  81. }
  82. #else
  83. public partial class MessageObject
  84. {
  85. }
  86. #endif