Reset() private method

private Reset ( ) : void
return void
Esempio n. 1
0
        public void Destroy()
        {
            LogSys.Log(LOG_TYPE.INFO, "room {0}({1}) destroy.", RoomId, LocalID);
            OnDestroy();
            m_RoomUserMgr.ActiveScene.Reset();
            m_ScenePool.RecycleScene(m_RoomUserMgr.ActiveScene);
            m_RoomUserMgr.ActiveScene = null;

            this.CurrentState = RoomState.Unuse;
            int userCt = m_RoomUserMgr.RoomUsers.Count;

            for (int i = userCt - 1; i >= 0; --i)
            {
                User user = m_RoomUserMgr.RoomUsers[i];
                if (null != user)
                {
                    LogSys.Log(LOG_TYPE.INFO, "FreeUser {0} for {1} {2}, [Room.Destroy]", user.LocalID, user.Guid, user.GetKey());
                    user.Reset();
                    m_UserPool.FreeUser(user.LocalID);
                    m_RoomUserMgr.RoomUsers.RemoveAt(i);
                }
            }
            for (int i = 0; i < m_RoomUserMgr.RoomObservers.Length; ++i)
            {
                m_RoomUserMgr.RoomObservers[i].Reset();
            }
        }
Esempio n. 2
0
        internal void Destroy()
        {
            LogSys.Log(LOG_TYPE.INFO, "room {0}({1}) destroy.", RoomID, LocalID);
            m_ActiveScene.Reset();
            m_ScenePool.RecycleScene(m_ActiveScene);
            m_ActiveScene = null;

            this.CurrentState = RoomState.Unuse;
            int userCt = room_users_.Count;

            for (int i = userCt - 1; i >= 0; --i)
            {
                User user = room_users_[i];
                if (null != user)
                {
                    LogSys.Log(LOG_TYPE.INFO, "FreeUser {0} for {1} {2}, [Room.Destroy]", user.LocalID, user.Guid, user.GetKey());
                    user.Reset();
                    user_pool_.FreeUser(user.LocalID);
                    room_users_.RemoveAt(i);
                }
            }
            for (int i = 0; i < room_observers_.Length; ++i)
            {
                room_observers_[i].Reset();
            }
        }