Advertisement
Guest User

GetMoodlightConfigEvent.cs

a guest
Jan 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 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.HabboHotel.Items;
  8. using Plus.HabboHotel.Items.Data.Moodlight;
  9.  
  10. using Plus.Communication.Packets.Outgoing.Rooms.Furni.Moodlight;
  11.  
  12. namespace Plus.Communication.Packets.Incoming.Rooms.Furni.Moodlight
  13. {
  14. class GetMoodlightConfigEvent : IPacketEvent
  15. {
  16. public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
  17. {
  18. if (!Session.GetHabbo().InRoom)
  19. return;
  20.  
  21. Room Room;
  22.  
  23. if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
  24. return;
  25.  
  26. if (!Room.CheckRights(Session, true))
  27. return;
  28.  
  29. if (Room.MoodlightData == null)
  30. {
  31. foreach (Item item in Room.GetRoomItemHandler().GetWall.ToList())
  32. {
  33. if (item.GetBaseItem().InteractionType == InteractionType.MOODLIGHT)
  34. Room.MoodlightData = new MoodlightData(item.Id);
  35. }
  36. }
  37.  
  38. if (Room.MoodlightData == null)
  39. return;
  40.  
  41. Session.SendMessage(new MoodlightConfigComposer(Room.MoodlightData));
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement