ServerComponentSystem.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. namespace KYFramework.Network
  2. {
  3. [ObjectSystem]
  4. public class ServerComponentAwakeSystem : AwakeSystem<ServerComponent>
  5. {
  6. public override void Awake(ServerComponent self)
  7. {
  8. self.Awake(self.Protocol);
  9. self.MessagePacker = new ProtobufPacker();
  10. self.MessageDispatcher = new OuterMessageDispatcher();
  11. Log.Debug("服务组件初始化完毕!");
  12. }
  13. }
  14. [ObjectSystem]
  15. public class ServerComponentAwake1System : AwakeSystem<ServerComponent, string>
  16. {
  17. public override void Awake(ServerComponent self, string address)
  18. {
  19. self.Awake(self.Protocol, address);
  20. self.MessagePacker = new ProtobufPacker();
  21. self.MessageDispatcher = new OuterMessageDispatcher();
  22. Log.Debug("服务组件初始化完毕!");
  23. }
  24. }
  25. [ObjectSystem]
  26. public class ServerComponentLoadSystem : LoadSystem<ServerComponent>
  27. {
  28. public override void Load(ServerComponent self)
  29. {
  30. self.MessagePacker = new ProtobufPacker();
  31. self.MessageDispatcher = new OuterMessageDispatcher();
  32. }
  33. }
  34. [ObjectSystem]
  35. public class ServerComponentUpdateSystem : UpdateSystem<ServerComponent>
  36. {
  37. public override void Update(ServerComponent self)
  38. {
  39. self.Update();
  40. }
  41. }
  42. }