ClearSameRoomUser() private method

private ClearSameRoomUser ( ) : void
return void
 public void RemoveUser(User user, bool free)
 {
     if (user == null)
     {
         return;
     }
     foreach (User otheruser in m_RoomUsers)
     {
         if (null != otheruser && otheruser != user)
         {
             otheruser.RemoveSameRoomUser(user);
         }
     }
     user.ClearSameRoomUser();
     if (null != m_ActiveScene)
     {
         Scene scene = m_ActiveScene;
         scene.LeaveScene(user);
     }
     LogSys.Log(LOG_TYPE.INFO, "FreeUser {0} for {1} {2}, [Room.RemoveUser]", user.LocalID, user.Guid, user.GetKey());
     m_RoomUsers.Remove(user);
     if (free)
     {
         m_UserPool.FreeUser(user.LocalID);
     }
 }
示例#2
0
        public void RemoveUser(User user, bool free)
        {
            if (user == null)
            {
                return;
            }
            Msg_RL_UserQuit quitBuilder = new Msg_RL_UserQuit();

            quitBuilder.UserGuid = user.Guid;
            quitBuilder.RoomId   = RoomId;
            m_Connector.SendMsgToLobby(quitBuilder);

            foreach (User otheruser in m_RoomUsers)
            {
                if (null != otheruser && otheruser != user)
                {
                    otheruser.RemoveSameRoomUser(user);
                }
            }
            user.ClearSameRoomUser();
            if (null != m_ActiveScene)
            {
                Scene scene = m_ActiveScene;
                scene.LeaveScene(user);
            }

            LogSys.Log(LOG_TYPE.INFO, "FreeUser {0} for {1} {2}, [Room.RemoveUser]", user.LocalID, user.Guid, user.GetKey());
            m_RoomUsers.Remove(user);
            if (free)
            {
                m_UserPool.FreeUser(user.LocalID);
            }
        }
示例#3
0
 private void RemoveUser(User user, bool free)
 {
     if (user == null) {
         return;
     }
     foreach (User otheruser in room_users_) {
         if (null != otheruser && otheruser != user) {
             otheruser.RemoveSameRoomUser(user);
         }
     }
     user.ClearSameRoomUser();
     if (null != m_ActiveScene) {
         Scene scene = m_ActiveScene;
         scene.LeaveScene(user);
     }
     LogSys.Log(LOG_TYPE.INFO, "FreeUser {0} for {1} {2}, [Room.RemoveUser]", user.LocalID, user.Guid, user.GetKey());
     room_users_.Remove(user);
     if (free) {
         user_pool_.FreeUser(user.LocalID);
     }
 }