NetInnerComponentSystem.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using ETModel;
  2. namespace ETHotfix
  3. {
  4. [ObjectSystem]
  5. public class NetInnerComponentAwakeSystem : AwakeSystem<NetInnerComponent>
  6. {
  7. public override void Awake(NetInnerComponent self)
  8. {
  9. self.Awake();
  10. }
  11. }
  12. [ObjectSystem]
  13. public class NetInnerComponentAwake1System : AwakeSystem<NetInnerComponent, string>
  14. {
  15. public override void Awake(NetInnerComponent self, string a)
  16. {
  17. self.Awake(a);
  18. }
  19. }
  20. [ObjectSystem]
  21. public class NetInnerComponentLoadSystem : LoadSystem<NetInnerComponent>
  22. {
  23. public override void Load(NetInnerComponent self)
  24. {
  25. self.MessagePacker = new MongoPacker();
  26. self.MessageDispatcher = new InnerMessageDispatcher();
  27. }
  28. }
  29. [ObjectSystem]
  30. public class NetInnerComponentUpdateSystem : UpdateSystem<NetInnerComponent>
  31. {
  32. public override void Update(NetInnerComponent self)
  33. {
  34. self.Update();
  35. }
  36. }
  37. public static class NetInnerComponentHelper
  38. {
  39. public static void Awake(this NetInnerComponent self)
  40. {
  41. self.Awake(NetworkProtocol.TCP);
  42. self.MessagePacker = new MongoPacker();
  43. self.MessageDispatcher = new InnerMessageDispatcher();
  44. self.AppType = StartConfigComponent.Instance.StartConfig.AppType;
  45. }
  46. public static void Awake(this NetInnerComponent self, string address)
  47. {
  48. self.Awake(NetworkProtocol.TCP, address);
  49. self.MessagePacker = new MongoPacker();
  50. self.MessageDispatcher = new InnerMessageDispatcher();
  51. self.AppType = StartConfigComponent.Instance.StartConfig.AppType;
  52. }
  53. public static void Update(this NetInnerComponent self)
  54. {
  55. self.Update();
  56. }
  57. }
  58. }