/// <summary> /// Kick user from the server /// </summary> /// <param name="sessionId"></param> /// <param name="reason"></param> /// <returns></returns> public void KickUser(int sessionId, string reason) { _server.kickUser(sessionId, reason); // remove from cache foreach (var u in _entity.OnlineUsers) { if (u.Value.Session == sessionId) { _entity.OnlineUsers.Remove(u.Key); break; } } }