RouterComponent.cs 802 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4. using System.Net.Sockets;
  5. namespace ET
  6. {
  7. [ChildType(typeof(RouterNode))]
  8. [ComponentOf(typeof(Scene))]
  9. public class RouterComponent: Entity, IAwake<IPEndPoint, string>, IDestroy, IUpdate
  10. {
  11. public Socket OuterSocket;
  12. public Socket InnerSocket;
  13. public EndPoint IPEndPoint = new IPEndPoint(IPAddress.Any, 0);
  14. public byte[] Cache = new byte[1500];
  15. public Dictionary<uint, RouterNode> ConnectIdNodes = new Dictionary<uint, RouterNode>();
  16. // 已经连接成功的,虽然跟id一样,但是没有经过验证的不会加到这里
  17. public Dictionary<uint, RouterNode> OuterNodes = new Dictionary<uint, RouterNode>();
  18. public long LastCheckTime = 0;
  19. }
  20. }