NetOuterComponent.cs 803 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 host, int port)
  11. {
  12. this.Get().Awake();
  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 MongoPacker();
  25. this.MessageDispatcher = new ClientDispatcher();
  26. }
  27. public void Awake(string host, int port)
  28. {
  29. this.Awake(NetworkProtocol.TCP, host, port);
  30. this.MessagePacker = new MongoPacker();
  31. this.MessageDispatcher = new ClientDispatcher();
  32. }
  33. public new void Update()
  34. {
  35. base.Update();
  36. }
  37. }
  38. }