NetInnerComponentSystem.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 NetInnerComponentStartSystem : StartSystem<NetInnerComponent>
  15. {
  16. public override void Start(NetInnerComponent self)
  17. {
  18. self.Start();
  19. }
  20. }
  21. [ObjectSystem]
  22. public class NetInnerComponentAwake1System : AwakeSystem<NetInnerComponent, IPEndPoint>
  23. {
  24. public override void Awake(NetInnerComponent self, IPEndPoint a)
  25. {
  26. self.Awake(a);
  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 NetInnerComponentEx
  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 = self.Entity.GetComponent<StartConfigComponent>().StartConfig.AppType;
  45. }
  46. public static void Awake(this NetInnerComponent self, IPEndPoint ipEndPoint)
  47. {
  48. self.Awake(NetworkProtocol.TCP, ipEndPoint);
  49. self.MessagePacker = new MongoPacker();
  50. self.MessageDispatcher = new InnerMessageDispatcher();
  51. self.AppType = self.Entity.GetComponent<StartConfigComponent>().StartConfig.AppType;
  52. }
  53. public static void Update(this NetInnerComponent self)
  54. {
  55. self.Update();
  56. }
  57. }
  58. }