AActorMessage.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using MongoDB.Bson.Serialization.Attributes;
  2. using ProtoBuf;
  3. namespace Model
  4. {
  5. [ProtoContract]
  6. [BsonKnownTypes(typeof(Actor_Test))]
  7. [BsonKnownTypes(typeof(AFrameMessage))]
  8. [BsonKnownTypes(typeof(Actor_CreateUnits))]
  9. [BsonKnownTypes(typeof(FrameMessage))]
  10. [ProtoInclude(10000, typeof(FrameMessage))]
  11. [ProtoInclude(10001, typeof(AFrameMessage))]
  12. [ProtoInclude(10002, typeof(Actor_CreateUnits))]
  13. public abstract class AActorMessage : AMessage
  14. {
  15. }
  16. [BsonKnownTypes(typeof(Actor_TestRequest))]
  17. [BsonKnownTypes(typeof(Actor_TransferRequest))]
  18. public abstract class AActorRequest : ARequest
  19. {
  20. }
  21. [BsonKnownTypes(typeof(Actor_TestResponse))]
  22. [BsonKnownTypes(typeof(Actor_TransferResponse))]
  23. public abstract class AActorResponse : AResponse
  24. {
  25. }
  26. /// <summary>
  27. /// 帧消息,继承这个类的消息会经过服务端转发
  28. /// </summary>
  29. [ProtoContract]
  30. [ProtoInclude(30000, typeof(Frame_ClickMap))]
  31. [BsonKnownTypes(typeof(Frame_ClickMap))]
  32. public abstract class AFrameMessage : AActorMessage
  33. {
  34. [ProtoMember(1)]
  35. public long Id;
  36. }
  37. }