Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections.Generic;
  5.  
  6. using Plus.HabboHotel.Rooms;
  7. using Plus.Communication.Packets.Outgoing.Rooms.Session;
  8.  
  9. namespace Plus.HabboHotel.Rooms.Chat.Commands.User
  10. {
  11. class ReloadCommand : IChatCommand
  12. {
  13. public string PermissionRequired
  14. {
  15. get { return "command_unload"; }
  16. }
  17.  
  18. public string Parameters
  19. {
  20. get { return "%id%"; }
  21. }
  22.  
  23. public string Description
  24. {
  25. get { return "Reload de huidige kamer."; }
  26. }
  27.  
  28. public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
  29. {
  30. if (Session.GetHabbo().GetPermissions().HasRight("room_unload_any"))
  31. {
  32. Room R = null;
  33. if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Room.Id, out R))
  34. return;
  35.  
  36. PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(R, true);
  37. }
  38. else
  39. {
  40. if (Room.CheckRights(Session, true))
  41. {
  42.  
  43.  
  44. List<RoomUser> UsersToReturn = Room.GetRoomUserManager().GetRoomUsers().ToList();
  45.  
  46. PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(Room);
  47.  
  48.  
  49. foreach (RoomUser User in UsersToReturn)
  50. {
  51. if (User == null || User.GetClient() == null)
  52. continue;
  53.  
  54. User.GetClient().SendMessage(new RoomForwardComposer(Room.Id));
  55. }
  56.  
  57.  
  58.  
  59. }
  60. }
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement