Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text;
- using System.Collections.Generic;
- using Plus.HabboHotel.Rooms;
- using Plus.Communication.Packets.Outgoing.Rooms.Session;
- namespace Plus.HabboHotel.Rooms.Chat.Commands.User
- {
- class ReloadCommand : IChatCommand
- {
- public string PermissionRequired
- {
- get { return "command_unload"; }
- }
- public string Parameters
- {
- get { return "%id%"; }
- }
- public string Description
- {
- get { return "Recarga la habitaciĆ³n."; }
- }
- public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
- {
- if (Session.GetHabbo().GetPermissions().HasRight("room_unload_any"))
- {
- Room R = null;
- if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Room.Id, out R))
- return;
- PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(R, true);
- }
- else
- {
- if (Room.CheckRights(Session, true))
- {
- List<RoomUser> UsersToReturn = Room.GetRoomUserManager().GetRoomUsers().ToList();
- PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(Room);
- foreach (RoomUser User in UsersToReturn)
- {
- if (User == null || User.GetClient() == null)
- continue;
- User.GetClient().SendMessage(new RoomForwardComposer(Room.Id));
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement