Пример #1
0
        public void DeleteSession(UInt64 nSessionID)
        {
            try
            {
                NetSession session = m_dicSession[nSessionID];
                m_dicSession.Remove(nSessionID);

                session.Close();
            }
            catch {}
        }
Пример #2
0
        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();
        }
Пример #3
0
        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);
            }
        }