public void RemoveFurniture(GameClient Session, uint Id, bool Delete, bool ReGenerateMap) { RoomItem Item = this.GetItem(Id); if (Item != null) { Dictionary<int, AffectedTile> dictionary = this.GetAffectedTiles(Item.GetBaseItem().Length, Item.GetBaseItem().Width, Item.GetX, Item.GetY, Item.Rot); Item.Interactor.OnRemove(Session, Item); if (Item.IsWallItem) { ServerMessage Message = new ServerMessage(84); Message.AppendRawUInt(Item.Id); Message.AppendStringWithBreak(""); Message.AppendBoolean(false); this.SendMessage(Message, null); } else { if (Item.IsFloorItem) { ServerMessage Message = new ServerMessage(94); Message.AppendRawUInt(Item.Id); Message.AppendStringWithBreak(""); Message.AppendBoolean(false); this.SendMessage(Message, null); string text = Item.GetBaseItem().InteractionType.ToLower(); switch (text) { case "bb_patch": this.bbTiles.Remove(Item); if (Item.ExtraData == "5") { this.bbrTiles.Remove(Item); } else if (Item.ExtraData == "8") { this.bbgTiles.Remove(Item); } else if (Item.ExtraData == "11") { this.bbbTiles.Remove(Item); } else if (Item.ExtraData == "14") { this.bbyTiles.Remove(Item); } break; case "blue_score": this.BlueScoreboards.Remove(Item); break; case "green_score": this.GreenScoreboards.Remove(Item); break; case "red_score": this.RedScoreboards.Remove(Item); break; case "yellow_score": this.YellowScoreboards.Remove(Item); break; case "stickiepole": this.StickiePoles.Remove(Item); break; case "wf_trg_onsay": case "wf_trg_enterroom": case "wf_trg_furnistate": case "wf_trg_onfurni": case "wf_trg_offfurni": case "wf_trg_gameend": case "wf_trg_gamestart": case "wf_trg_attime": case "wf_trg_atscore": this.WF_Triggers.Remove(Item); break; case "wf_trg_timer": Item.TimerRunning = false; this.WF_Triggers.Remove(Item); break; case "wf_act_saymsg": case "wf_act_moveuser": case "wf_act_togglefurni": case "wf_act_givepoints": case "wf_act_moverotate": case "wf_act_matchfurni": case "wf_act_give_phx": this.WF_Effects.Remove(Item); break; case "wf_cnd_trggrer_on_frn": case "wf_cnd_furnis_hv_avtrs": case "wf_cnd_has_furni_on": case "wf_cnd_phx": this.WF_Conditions.Remove(Item); break; } } } if (Item.IsWallItem) { this.mWallItems.Remove(Item.Id); } else { this.mFloorItems.Remove(Item.Id); } if (this.mAddedItems.Contains(Item.Id)) { this.mAddedItems.Remove(Item.Id); } if (this.mMovedItems.Contains(Item.Id)) { this.mMovedItems.Remove(Item.Id); } if (!this.mRemovedItems.Contains(Item.Id)) { this.mRemovedItems.Add(Item.Id, Item); } if (Delete) { using (DatabaseClient class2 = PhoenixEnvironment.GetDatabase().GetClient()) { class2.ExecuteQuery("DELETE FROM items WHERE Id = '" + Id + "' LIMIT 1"); } } if (ReGenerateMap) { this.GenerateMaps(); } this.UpdateUserStatus(this.GetUserForSquare(Item.GetX, Item.GetY), true, true); foreach (AffectedTile tile in dictionary.Values) { this.UpdateUserStatus(this.GetUserForSquare(tile.X, tile.Y), true, true); } } }
internal List<RoomItem> RemoveAllFurniture(GameClient Session) { List<RoomItem> list = new List<RoomItem>(); foreach (RoomItem @class in this.Hashtable_0.Values) { @class.Interactor.OnRemove(Session, @class); ServerMessage Message = new ServerMessage(94u); Message.AppendRawUInt(@class.Id); Message.AppendStringWithBreak(""); Message.AppendBoolean(false); this.SendMessage(Message, null); list.Add(@class); } foreach (RoomItem @class in this.Hashtable_1.Values) { @class.Interactor.OnRemove(Session, @class); ServerMessage Message = new ServerMessage(84u); Message.AppendRawUInt(@class.Id); Message.AppendStringWithBreak(""); Message.AppendBoolean(false); this.SendMessage(Message, null); list.Add(@class); } this.mWallItems.Clear(); this.mFloorItems.Clear(); this.mRemovedItems.Clear(); this.mMovedItems.Clear(); this.mAddedItems.Clear(); using (DatabaseClient class2 = PhoenixEnvironment.GetDatabase().GetClient()) { class2.ExecuteQuery(string.Concat(new object[] { "UPDATE items SET room_id = 0, user_id = '", Session.GetHabbo().Id, "' WHERE room_id = '", this.RoomId, "'" })); } this.GenerateMaps(); this.method_83(); return list; }