Esempio n. 1
0
        public LoginClient(TcpClient tcpClient)
        {
            Client    = tcpClient;
            NetStream = tcpClient.GetStream();
            Address   = tcpClient.Client.RemoteEndPoint;

            Key   = new SessionKey();
            State = LoginClientState.Connected;
            ConnectionStartTime = DateTime.Now;
            UsesInternalIP      = Address.IsLocalIpAddress();

            InitializeNetwork();
        }
Esempio n. 2
0
 public LoginClient(TcpClient tcpClient, Managers.ClientManager clientManager, PacketHandler packetHandler)
 {
     _tcpClient     = tcpClient;
     ClientManager  = clientManager;
     _packetHandler = packetHandler;
     _networkStream = tcpClient.GetStream();
     Address        = tcpClient.Client.RemoteEndPoint;
     SessionId      = RandomThreadSafe.Instance.Next();
     Key            = new SessionKey(RandomThreadSafe.Instance.Next(), RandomThreadSafe.Instance.Next(), RandomThreadSafe.Instance.Next(),
                                     RandomThreadSafe.Instance.Next());
     State = LoginClientState.Connected;
     InitializeNetwork();
 }
Esempio n. 3
0
        public LoginClient(TcpClient tcpClient, Managers.ClientManager clientManager, PacketHandler packetHandler)
        {
            Client         = tcpClient;
            _clientManager = clientManager;
            _packetHandler = packetHandler;
            NetStream      = tcpClient.GetStream();
            Address        = tcpClient.Client.RemoteEndPoint;
            Random rnd = new Random();

            SessionId = rnd.Next();
            Key       = new SessionKey(rnd.Next(), rnd.Next(), rnd.Next(), rnd.Next());
            State     = LoginClientState.Connected;
            InitializeNetwork();
        }
Esempio n. 4
0
        public LoginClient(TcpClient tcpClient, Managers.ClientManager clientManager, PacketHandler packetHandler)
        {
            Client         = tcpClient;
            _clientManager = clientManager;
            _packetHandler = packetHandler;
            NetStream      = tcpClient.GetStream();
            Address        = tcpClient.Client.RemoteEndPoint;
            Random rnd = new Random();

            SessionId           = rnd.Next();
            Key                 = new SessionKey(rnd.Next(), rnd.Next(), rnd.Next(), rnd.Next());
            State               = LoginClientState.Connected;
            ConnectionStartTime = DateTime.Now;
            UsesInternalIP      = Address.IsLocalIpAddress();

            InitializeNetwork();
        }