NetOuterComponentSystem.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 NetOuterComponentUpdateSystem : UpdateSystem<NetOuterComponent>
  23. {
  24. public override void Update(NetOuterComponent self)
  25. {
  26. self.Update();
  27. }
  28. }
  29. public static class NetOuterComponentEx
  30. {
  31. public static void Awake(this NetOuterComponent self)
  32. {
  33. self.Awake(NetworkProtocol.TCP);
  34. self.MessagePacker = new ProtobufPacker();
  35. self.MessageDispatcher = new OuterMessageDispatcher();
  36. }
  37. public static void Awake(this NetOuterComponent self, IPEndPoint ipEndPoint)
  38. {
  39. self.Awake(NetworkProtocol.TCP, ipEndPoint);
  40. self.MessagePacker = new ProtobufPacker();
  41. self.MessageDispatcher = new OuterMessageDispatcher();
  42. }
  43. public static void Update(this NetOuterComponent self)
  44. {
  45. self.Update();
  46. }
  47. }
  48. }