Beispiel #1
0
        public void RemoveSession(IPEndPoint point, string msg)
        {
            string        id      = IPEndPointToID(point);
            RakNetSession session = null;

            Logger.Info("%raknet_sessionClose", IPEndPointToID(point));
            Logger.Log("%raknet_sessionClose_reason", msg);

            this.sessions.TryRemove(id, out session);
        }
Beispiel #2
0
        public void CreateSession(IPEndPoint point, long clientID, short mtuSize)
        {
            string id = IPEndPointToID(point);

            if (this.sessions.ContainsKey(id))
            {
                return;
            }

            if (this.sessions.Count > 4096)
            {
                //TODO: SendMessage...
                return;
            }

            RakNetSession session = new RakNetSession(this, point, clientID, mtuSize);

            this.sessions.TryAdd(id, session);

            Server.Instance.NetworkManager.CreatePlayer(point, IPEndPointToID(point));

            Logger.Info("%raknet_sessionCreate", IPEndPointToID(point), mtuSize);
        }