public void DeleteSession(UInt64 nSessionID) { try { NetSession session = m_dicSession[nSessionID]; m_dicSession.Remove(nSessionID); session.Close(); } catch {} }
public void Destroy() { List <UInt64> listDestroyedSession = new List <UInt64>(); foreach (KeyValuePair <UInt64, NetSession> pair in m_dicSession) { NetSession session = pair.Value; session.Close(); } m_dicSession.Clear(); }
public void Update() { List <UInt64> listDestroyedSession = new List <UInt64>(); foreach (KeyValuePair <UInt64, NetSession> pair in m_dicSession) { NetSession session = pair.Value; if (session.Destroyed) { session.Close(); listDestroyedSession.Add(pair.Key); } } foreach (UInt64 Key in listDestroyedSession) { m_dicSession.Remove(Key); } }