HotfixMessage.cs 2.2 KB

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