[SOLVED] Floorplan Saving

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
Hi I have a weird issue,

if you create a floor plan, press save, it will kick you out of the room, update the floor plan but I can't seem to get the user sent back to the room.

It will send the "GetUserRoomEvent" packet or whatever but doesn't load the room. You stay at the hotel view. If you click on the room in the navigator however; it will put you into the room.

What the heck is going on?
I have tried multiple methods to get the user to be teleported to the room again.

I changed nothing for this class.

Thanks,
Jay
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
Nope. Just sends you to the hotel view
 
I should also note I tried sending the user to the hotelview , updating the room, then sending the user back

and I also tried updating the room, sending user to hotel room, sending them back

and I also tried updating the room, and sending the user to the room again
 
Mother of God I fixed it finally.

Code:
List<RoomUser> roomusers = Room.GetRoomUserManager().GetRoomUsers().ToList();
            List<GameClient> UsersToReturn = new List<GameClient>();

            foreach (RoomUser user in roomusers)
            {
                UsersToReturn.Add(user.GetClient());
            }

            int roomId = Room.Id;
            PlusEnvironment.GetGame().GetRoomManager().ReloadModel(ModelName);
            PlusEnvironment.GetGame().GetRoomManager().SaveFloorPlan(Room, false);

            PlusEnvironment.GetGame().GetRoomManager().LoadRoom(roomId);

            foreach (GameClient client in UsersToReturn)
            {

                if (client == null)
                    continue;

               //client.GetHabbo().PrepareRoom(roomId, "");
               client.SendMessage(new RoomForwardComposer(Room.Id));
           }
 

Users who are viewing this thread

Top