using System; using System.Collections.Generic; using System.Linq; using System.Text; using DuckEmulator.HabboHotel.Outside.Rooms; using DuckEmulator.HabboHotel.Outside.Messages.Types; using DuckEmulator.HabboHotel.Outside.Clients; using DuckEmulator.HabboHotel.Outside.Furniture; namespace DuckEmulator.HabboHotel.Outside.Misc { sealed class ChatCommandHandler { internal static Boolean ChatCommand(string Command, RoomUser User) { if (User == null) return false; var Params = Command.Split(' '); switch (Params[0].ToLower()) { case "about": { ServerMessage Message = new ServerMessage(808); Message.AppendStringWithBreak("DuckEmulator"); Message.AppendStringWithBreak("The duckhotel.zapto.org is proudly powered by DuckEmu, the advanced Habbo Hotel emulator."); Message.AppendStringWithBreak("", 10); Message.AppendStringWithBreak("", 10); Message.AppendStringWithBreak("http://duckemulator.realcontents.com.pt/"); User.GetClient().GetConnection().SendResponse(Message); } return true; case "emustats": { User.GetClient().SendNotif(DuckEnvironment.GetDetailsString(), false); } return true; case "commands": { StringBuilder Builder = new StringBuilder(); Builder.AppendLine("DuckEmu related commands"); Builder.AppendLine(); Builder.AppendLine(":about (© Copyright)"); Builder.AppendLine(":emustats (Emulator status)"); Builder.AppendLine(":commands (This alert)"); Builder.AppendLine(":pickall (Pick all furniture)"); if (User.GetClient().GetHabbo().Rank > 1) { Builder.AppendLine(":ha message (Hotel Alert)"); } User.GetClient().SendNotif(Builder.ToString(), false); } return true; case "ha": { if (User.GetClient().GetHabbo().Rank > 1 && Params.Length >= 2) { string Msg = Command.Substring(3); if (Msg != "") { foreach (Client Client in DuckEnvironment.ClientManager.Clients.Values.ToList()) { Client.SendNotif(Msg, true); } } return true; } } return false; case "pickall": { if (User.GetClient().GetHabbo().GetCurrentRoom().RoomEngine.HasRights(User.GetClient().GetHabbo(), true)) { foreach (uint FurniId in User.GetClient().GetHabbo().GetCurrentRoom().RoomEngine.Items.Keys) { Furni Furni = User.GetClient().GetHabbo().GetCurrentRoom().RoomEngine.GetFurni(FurniId); if (Furni == null) { continue; } if (User.GetClient().GetHabbo().GetCurrentRoom().DeleteItem(FurniId)) { User.GetClient().GetHabbo().GetInventory().AddnewFurni(Furni, false); } } return true; } } return false; } return false; } } }