예제 #1
0
        public void ClientDisconnection(object sender, SimpleTcp.ClientDisconnectedEventArgs e)
        {
            if (_clients.ContainsKey(e.IpPort))
            {
                _clients.TryRemove(e.IpPort, out var fd);

                if (fd.AccountId > 0 && PlayersSession.ContainsKey(fd.AccountId))
                {
                    PlayersSession.TryRemove(fd.AccountId, out var ps);
                }
            }

            Display.Show(ShowType.Info, string.Format("Client [{0}] disconnected.", e.IpPort), Type);
        }
 internal void HandleClientDisconnected(object sender, ClientDisconnectedEventArgs args)
 {
     Disconnected?.Invoke(sender, args);
 }