Exemplo n.º 1
0
        public NetworkSession(Session session, ConnectionListener connectionListener, ushort clientId, ushort serverId)
        {
            this.session            = session;
            this.connectionListener = connectionListener;

            ClientId = clientId;
            ServerId = serverId;

            // New network auth session timeouts will always be low.
            TimeoutTick = DateTime.UtcNow.AddSeconds(AuthenticationHandler.DefaultAuthTimeout).Ticks;

            for (int i = 0; i < currentBundles.Length; i++)
            {
                currentBundleLocks[i] = new object();
                currentBundles[i]     = new NetworkBundle();
            }
        }
Exemplo n.º 2
0
        public NetworkSession(Session session, ConnectionListener connectionListener, ushort clientId, ushort serverId)
        {
            this.session            = session;
            this.connectionListener = connectionListener;

            ClientId = clientId;
            ServerId = serverId;

            // New network auth session timeouts will always be low.
            TimeoutTick = DateTime.UtcNow.AddSeconds(AuthenticationHandler.DefaultAuthTimeout).Ticks;

            for (int i = 0; i < currentBundles.Length; i++)
            {
                currentBundleLocks[i] = new object();
                currentBundles[i]     = new NetworkBundle();
            }

            ConnectionData.CryptoClient.OnCryptoSystemCatastrophicFailure += (sender, e) =>
            {
                session.Terminate(SessionTerminationReason.ClientConnectionFailure);
            };
        }
Exemplo n.º 3
0
 public Session(ConnectionListener connectionListener, IPEndPoint endPoint, ushort clientId, ushort serverId)
 {
     EndPoint = endPoint;
     Network  = new NetworkSession(this, connectionListener, clientId, serverId);
 }