NetInnerComponentSystem.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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, string>
  15. {
  16. public override void Awake(NetInnerComponent self, string a)
  17. {
  18. self.Awake(a);
  19. }
  20. }
  21. [ObjectSystem]
  22. public class NetInnerComponentLoadSystem : LoadSystem<NetInnerComponent>
  23. {
  24. public override void Load(NetInnerComponent self)
  25. {
  26. self.MessagePacker = new MongoPacker();
  27. self.MessageDispatcher = new InnerMessageDispatcher();
  28. }
  29. }
  30. [ObjectSystem]
  31. public class NetInnerComponentUpdateSystem : UpdateSystem<NetInnerComponent>
  32. {
  33. public override void Update(NetInnerComponent self)
  34. {
  35. self.Update();
  36. }
  37. }
  38. public static class NetInnerComponentHelper
  39. {
  40. public static void Awake(this NetInnerComponent self)
  41. {
  42. self.Awake(NetworkProtocol.TCP);
  43. self.MessagePacker = new MongoPacker();
  44. self.MessageDispatcher = new InnerMessageDispatcher();
  45. self.AppType = StartConfigComponent.Instance.StartConfig.AppType;
  46. }
  47. public static void Awake(this NetInnerComponent self, string address)
  48. {
  49. self.Awake(NetworkProtocol.TCP, address);
  50. self.MessagePacker = new MongoPacker();
  51. self.MessageDispatcher = new InnerMessageDispatcher();
  52. self.AppType = StartConfigComponent.Instance.StartConfig.AppType;
  53. }
  54. public static void Update(this NetInnerComponent self)
  55. {
  56. self.Update();
  57. }
  58. }
  59. }