Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System.Linq;
  2. using System.Collections.Generic;
  3. using Plus.HabboHotel.Rooms;
  4. using Plus.HabboHotel.Items;
  5. using Plus.Communication.Packets.Outgoing.Rooms.FloorPlan;
  6. using Plus.Communication.Packets.Outgoing.Rooms.Engine;
  7. using System.Drawing;
  8.  
  9. namespace Plus.Communication.Packets.Incoming.Rooms.FloorPlan
  10. {
  11. class FloorPlanEditorRoomPropertiesEvent : IPacketEvent
  12. {
  13. public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
  14. {
  15. if (!Session.GetHabbo().InRoom)
  16. return;
  17.  
  18. Room Room = Session.GetHabbo().CurrentRoom;
  19. if (Room == null)
  20. return;
  21.  
  22. if (Room.GetGameMap().Model == null)
  23. return;
  24.  
  25. List<Point> Squares = new List<Point>();
  26. Room.GetRoomItemHandler().GetFloor.ToList().ForEach(Item =>
  27. {
  28. Item.GetCoords.ForEach(Point =>
  29. {
  30. if (!Squares.Contains(Point))
  31. Squares.Add(Point);
  32. });
  33. });
  34.  
  35. Session.SendMessage(new FloorPlanFloorMapComposer(Squares));
  36. Session.SendMessage(new FloorPlanSendDoorComposer(Room.GetGameMap().Model.DoorX, Room.GetGameMap().Model.DoorY, Room.GetGameMap().Model.DoorOrientation));
  37. Session.SendMessage(new RoomVisualizationSettingsComposer(Room.WallThickness, Room.FloorThickness, PlusEnvironment.EnumToBool(Room.Hidewall.ToString())));
  38.  
  39. Squares.Clear();
  40. Squares = null;
  41. }
  42. }
  43. }