NetOuterComponent.cs 707 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. namespace Model
  2. {
  3. [ObjectEvent]
  4. public class NetOuterComponentEvent : ObjectEvent<NetOuterComponent>, IAwake, IAwake<string, int>, IUpdate
  5. {
  6. public void Awake()
  7. {
  8. this.Get().Awake();
  9. }
  10. public void Awake(string a, int b)
  11. {
  12. this.Get().Awake(a, b);
  13. }
  14. public void Update()
  15. {
  16. this.Get().Update();
  17. }
  18. }
  19. public class NetOuterComponent : NetworkComponent
  20. {
  21. public void Awake()
  22. {
  23. this.Awake(NetworkProtocol.TCP);
  24. this.messagePacker = new JsondotnetPacker();
  25. }
  26. public void Awake(string host, int port)
  27. {
  28. this.Awake(NetworkProtocol.TCP, host, port);
  29. this.messagePacker = new JsondotnetPacker();
  30. }
  31. public new void Update()
  32. {
  33. base.Update();
  34. }
  35. }
  36. }