NetInnerComponentSystem.cs 1.3 KB

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