public static ProxySession Create(ClientConnection clientConnection, AccountDocument accountDocument) { long id = ProxySessionManager.GetScrambledId(); ProxySession proxySession = new ProxySession(id, clientConnection, accountDocument); Logging.Assert(ProxySessionManager.m_sessions.TryAdd(id, proxySession), "ProxySessionManager.m_sessions.TryAdd(id, proxySession) return false"); return(proxySession); }
public static void Remove(ProxySession session) { ProxySessionManager.m_sessions.TryRemove(session.Id, out _); }
public static bool TryGet(long id, out ProxySession session) { return(ProxySessionManager.m_sessions.TryGetValue(id, out session)); }