NetOuterComponentSystem.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Net;
  2. using ETModel;
  3. namespace ETHotfix
  4. {
  5. [ObjectSystem]
  6. public class NetOuterComponentAwakeSystem : AwakeSystem<NetOuterComponent>
  7. {
  8. public override void Awake(NetOuterComponent self)
  9. {
  10. self.Awake();
  11. }
  12. }
  13. [ObjectSystem]
  14. public class NetOuterComponentAwake1System : AwakeSystem<NetOuterComponent, IPEndPoint>
  15. {
  16. public override void Awake(NetOuterComponent self, IPEndPoint a)
  17. {
  18. self.Awake(a);
  19. }
  20. }
  21. [ObjectSystem]
  22. public class NetOuterComponentStartSystem : StartSystem<NetOuterComponent>
  23. {
  24. public override void Start(NetOuterComponent self)
  25. {
  26. self.Start();
  27. }
  28. }
  29. [ObjectSystem]
  30. public class NetOuterComponentUpdateSystem : UpdateSystem<NetOuterComponent>
  31. {
  32. public override void Update(NetOuterComponent self)
  33. {
  34. self.Update();
  35. }
  36. }
  37. public static class NetOuterComponentEx
  38. {
  39. public static void Awake(this NetOuterComponent self)
  40. {
  41. self.Awake(NetworkProtocol.KCP);
  42. self.MessagePacker = new ProtobufPacker();
  43. self.MessageDispatcher = new OuterMessageDispatcher();
  44. }
  45. public static void Awake(this NetOuterComponent self, IPEndPoint ipEndPoint)
  46. {
  47. self.Awake(NetworkProtocol.KCP, ipEndPoint);
  48. self.MessagePacker = new ProtobufPacker();
  49. self.MessageDispatcher = new OuterMessageDispatcher();
  50. }
  51. public static void Update(this NetOuterComponent self)
  52. {
  53. self.Update();
  54. }
  55. }
  56. }