public void Handle(GameClient Session, ClientMessage Event) { int num = Event.PopWiredInt32(); List <uint> list = new List <uint>(); for (int i = 0; i < num; i++) { list.Add(Event.PopWiredUInt()); } string text = Event.PopFixedString(); text = Essential.DoFilter(text, true, false); text = ChatCommandHandler.ApplyFilter(text); ServerMessage Message = new ServerMessage(Outgoing.InstantInvite); // Update Message.AppendUInt(Session.GetHabbo().Id); Message.AppendStringWithBreak(text); foreach (uint current in list) { if (Session.GetHabbo().GetMessenger().method_9(Session.GetHabbo().Id, current)) { GameClient @class = Essential.GetGame().GetClientManager().GetClient(current); if (@class == null) { break; } @class.SendMessage(Message); } } }
public static bool IsValidName(string username) { if (username.Length < 3 || username.Length > 15) { return(false); } if (username.Contains(" ")) { return(false); } if (!Regex.IsMatch(string_0, "^[-a-zA-Z0-9._:,]+$")) { return(false); } if (username != ChatCommandHandler.ApplyFilter(username)) { return(false); } return(true); }
public void Handle(GameClient Session, ClientMessage Event) { string text = Essential.FilterString(Event.PopFixedString()); if (text.Length <= 50 && !(text != ChatCommandHandler.ApplyFilter(text)) && !(text == Session.GetHabbo().Motto)) { Session.GetHabbo().Motto = text; using (DatabaseClient @class = Essential.GetDatabase().GetClient()) { @class.AddParamWithValue("motto", text); @class.ExecuteQuery("UPDATE users SET motto = @motto WHERE Id = '" + Session.GetHabbo().Id + "' LIMIT 1"); } if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "CHANGEMOTTO") { Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session); } if (Session.GetHabbo().InRoom) { Room class14_ = Session.GetHabbo().CurrentRoom; if (class14_ == null) { return; } RoomUser class2 = class14_.GetRoomUserByHabbo(Session.GetHabbo().Id); if (class2 == null) { return; } ServerMessage Message2 = new ServerMessage(Outgoing.UpdateUserInformation); //Rootkit Message2.AppendInt32(class2.VirtualId); Message2.AppendStringWithBreak(Session.GetHabbo().Figure); Message2.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower()); Message2.AppendStringWithBreak(Session.GetHabbo().Motto); Message2.AppendInt32(Session.GetHabbo().AchievementScore); // Message2.AppendStringWithBreak(""); class14_.SendMessage(Message2, null); } Session.GetHabbo().MottoAchievementsCompleted(); } }
internal void method_18(uint uint_1, string string_0) { if (!String.IsNullOrEmpty(string_0) && !String.IsNullOrWhiteSpace(string_0)) { if (!this.method_9(uint_1, this.uint_0)) { this.method_20(6, uint_1); } else { GameClient @class = Essential.GetGame().GetClientManager().GetClient(uint_1); if (@class == null || @class.GetHabbo().GetMessenger() == null) { this.method_20(5, uint_1); } else { if (this.method_25().GetHabbo().IsMuted) { this.method_20(4, uint_1); } else { if (@class.GetHabbo().IsMuted) { this.method_20(3, uint_1); return; } if (this.method_25().GetHabbo().method_4() > 0) { TimeSpan timeSpan = DateTime.Now - this.method_25().GetHabbo().dateTime_0; if (timeSpan.Seconds > 4) { this.method_25().GetHabbo().int_23 = 0; } if (timeSpan.Seconds < 4 && this.method_25().GetHabbo().int_23 > 5) { this.method_20(4, uint_1); return; } this.method_25().GetHabbo().dateTime_0 = DateTime.Now; this.method_25().GetHabbo().int_23++; } string_0 = ChatCommandHandler.ApplyFilter(string_0); if (ServerConfiguration.EnableChatlog && !this.method_25().GetHabbo().IsJuniori) { using (DatabaseClient class2 = Essential.GetDatabase().GetClient()) { class2.AddParamWithValue("message", "<PM to " + @class.GetHabbo().Username + ">: " + string_0); class2.ExecuteQuery(string.Concat(new object[] { "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('", this.method_25().GetHabbo().Id, "','0','", DateTime.Now.Hour, "','", DateTime.Now.Minute, "',UNIX_TIMESTAMP(),@message,'", this.method_25().GetHabbo().Username, "','", DateTime.Now.ToLongDateString(), "')" })); } } @class.GetHabbo().GetMessenger().method_19(string_0, this.uint_0); } } } } }
public void Handle(GameClient Session, ClientMessage Event) { string text = Essential.DoFilter(Event.PopFixedString(), false, true); if (text.Length < 3) { ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated Message.AppendInt32(2); Message.AppendString(text); Message.AppendInt32(0); Session.SendMessage(Message); } else { if (text.Length > 15) { ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated Message.AppendInt32(3); Message.AppendString(text); Message.AppendInt32(0); Session.SendMessage(Message); } else { if (text.Contains(" ") || !Session.GetClientMessageHandler().method_8(text) || text != ChatCommandHandler.ApplyFilter(text)) { ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated Message.AppendInt32(5); Message.AppendString(text); Message.AppendInt32(0); Session.SendMessage(Message); } else { if (Event.Id == 3511) { ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated Message.AppendInt32(0); Message.AppendString(text); Message.AppendInt32(0); Session.SendMessage(Message); } else { if (Event.Id == 1457) { ServerMessage Message3 = new ServerMessage(Outgoing.ChangeUsername1); // Updated Message3.AppendUInt(Session.GetHabbo().Id); Message3.AppendUInt(Session.GetHabbo().CurrentRoomId); Message3.AppendString(text); Session.SendMessage(Message3); if (Session.GetHabbo().CurrentRoomId > 0u) { Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id); ServerMessage Message4 = new ServerMessage(Outgoing.SetRoomUser); // P Message4.AppendInt32(1); class2.method_14(Message4); @class.SendMessage(Message4, null); } Dictionary <Room, int> dictionary = Essential.GetGame().GetRoomManager().method_22(); IEnumerable <Room> arg_204_0 = dictionary.Keys; if (ChangeUserNameMessageEvent.func_0 == null) { ChangeUserNameMessageEvent.func_0 = new Func <Room, int>(ChangeUserNameMessageEvent.smethod_0); } IOrderedEnumerable <Room> orderedEnumerable = arg_204_0.OrderByDescending(ChangeUserNameMessageEvent.func_0); foreach (Room current in orderedEnumerable) { if (current.Owner == Session.GetHabbo().Username) { current.Owner = text; Essential.GetGame().GetRoomManager().method_16(Essential.GetGame().GetRoomManager().GetRoom(current.Id)); } } using (DatabaseClient class3 = Essential.GetDatabase().GetClient()) { class3.AddParamWithValue("newuname", text); class3.AddParamWithValue("olduname", Session.GetHabbo().Username); class3.ExecuteQuery(string.Concat(new string[] { "UPDATE rooms SET owner = @newuname WHERE owner = @olduname" })); class3.AddParamWithValue("newuname", text); class3.ExecuteQuery(string.Concat(new object[] { "UPDATE users SET username = @newuname WHERE Id = '", Session.GetHabbo().Id, "' LIMIT 1" })); Essential.GetGame().GetClientManager().StoreCommand(Session, "flagme", "OldName: " + Session.GetHabbo().Username + " NewName: " + text); Session.GetHabbo().Username = text; Session.GetHabbo().method_1(class3); foreach (RoomData current2 in Session.GetHabbo().OwnedRooms) { current2.Owner = text; } } Session.GetHabbo().ChangeNamaAchievementsCompleted(); } } } } } }
public void Handle(GameClient Session, ClientMessage Event) { Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && Session != null && Session.GetHabbo().PassedSafetyQuiz) { Session.GetHabbo().CheckForUnmute(); if (Session.GetHabbo().IsMuted) { Session.SendNotification(EssentialEnvironment.GetExternalText("error_muted")); } else { if (Session.GetHabbo().HasFuse("ignore_roommute") || [email protected]_4) { string text = Essential.FilterString(Event.PopFixedString()); if (!String.IsNullOrEmpty(text) || !String.IsNullOrWhiteSpace(text)) { string text2 = text.Split(new char[] { ' ' })[0]; string text3 = text.Substring(text2.Length + 1); text3 = ChatCommandHandler.ApplyFilter(text3); RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id); RoomUser class3 = @class.method_56(text2); if (Session.GetHabbo().method_4() > 0) { TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().dateTime_0; if (timeSpan.Seconds > 4) { Session.GetHabbo().int_23 = 0; } if (timeSpan.Seconds < 4 && Session.GetHabbo().int_23 > 5 && !class2.IsBot) { ServerMessage Message = new ServerMessage(Outgoing.FloodFilter); Message.AppendInt32(Session.GetHabbo().method_4()); Session.SendMessage(Message); Session.GetHabbo().IsMuted = true; Session.GetHabbo().int_4 = Session.GetHabbo().method_4(); return; } Session.GetHabbo().dateTime_0 = DateTime.Now; Session.GetHabbo().int_23++; } ServerMessage Message2 = new ServerMessage(Outgoing.Whisp); // OLD 25 UPDATED Message2.AppendInt32(class2.VirtualId); Message2.AppendStringWithBreak(text3); Message2.AppendInt32(0); Message2.AppendInt32(Event.PopWiredInt32()); Message2.AppendInt32(0); Message2.AppendInt32(-1); if (class2 != null && !class2.IsBot && !Essential.GetAntiAd().ContainsIllegalWord(text3)) { class2.GetClient().SendMessage(Message2); } class2.Unidle(); if (class3 != null && !class3.IsBot && (class3.GetClient().GetHabbo().list_2.Count <= 0 || !class3.GetClient().GetHabbo().list_2.Contains(Session.GetHabbo().Id))) { if (!Essential.GetAntiAd().ContainsIllegalWord(text3)) { class3.GetClient().SendMessage(Message2); } if (ServerConfiguration.EnableChatlog) { using (DatabaseClient class4 = Essential.GetDatabase().GetClient()) { class4.AddParamWithValue("message", "<Whisper to " + class3.GetClient().GetHabbo().Username + ">: " + text3); class4.ExecuteQuery(string.Concat(new object[] { "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('", Session.GetHabbo().Id, "','", @class.Id, "','", DateTime.Now.Hour, "','", DateTime.Now.Minute, "',UNIX_TIMESTAMP(),@message,'", Session.GetHabbo().Username, "','", DateTime.Now.ToLongDateString(), "')" })); } } if (Essential.GetAntiAd().ContainsIllegalWord(text3)) { ServerMessage Message3 = new ServerMessage(Outgoing.InstantChat); Message3.AppendUInt(0u); Message3.AppendString("[AWS] " + Session.GetHabbo().Username + ": " + text3); Message3.AppendString(Essential.GetUnixTimestamp() + string.Empty); Essential.GetGame().GetClientManager().SendToStaffs(Session, Message3); Session.SendNotification(Essential.GetGame().GetRoleManager().GetConfiguration().getData("antiad.alert")); } } } } } } }
public void Handle(GameClient Session, ClientMessage Event) { try { Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); uint uint_ = Event.PopWiredUInt(); RoomItem class2 = @class.method_28(uint_); string text = class2.GetBaseItem().InteractionType.ToLower(); switch (text) { case "wf_act_give_phx": { Event.PopWiredInt32(); string text2 = Event.PopFixedString(); text2 = Essential.DoFilter(text2, false, true); text2 = ChatCommandHandler.ApplyFilter(text2); if (!(text2 == class2.string_2)) { string string_ = text2.Split(new char[] { ':' })[0].ToLower(); if (Essential.GetGame().GetRoleManager().HasSuperWiredFXFuse(string_, Session)) { class2.string_2 = text2; } else { Session.GetHabbo().Whisper(EssentialEnvironment.GetExternalText("wired_error_permissions")); } } break; } case "wf_cnd_phx": { Event.PopWiredInt32(); string text2 = Event.PopFixedString(); text2 = Essential.DoFilter(text2, false, true); text2 = ChatCommandHandler.ApplyFilter(text2); if (!(text2 == class2.string_2)) { string string_ = text2.Split(new char[] { ':' })[0].ToLower(); if (Essential.GetGame().GetRoleManager().HasSuperWiredcndFuse(string_, Session)) { class2.string_2 = text2; } else { Session.GetHabbo().Whisper(EssentialEnvironment.GetExternalText("wired_error_permissions")); } } break; } case "wf_act_saymsg": { Event.PopWiredInt32(); string text2 = Event.PopFixedString(); text2 = Essential.DoFilter(text2, false, true); if (text2.Length > 100) { text2 = text2.Substring(0, 100); } class2.string_2 = text2; break; } case "wf_act_kick_user": { Event.PopWiredInt32(); string text2 = Event.PopFixedString(); text2 = Essential.DoFilter(text2, false, true); if (text2.Length > 200) { text2 = text2.Substring(0, 200); } class2.string_2 = text2; break; } case "wf_trg_furnistate": case "wf_trg_onfurni": case "wf_trg_offfurni": case "wf_act_moveuser": case "wf_act_togglefurni": { Event.PopWiredInt32(); Event.PopFixedString(); /* class2.string_2 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2)); * class2.string_2 = class2.string_2.Substring(0, class2.string_2.Length - 2); * Event.ResetPointer(); * class2 = @class.method_28(Event.PopWiredUInt()); * Event.PopWiredBoolean(); * Event.PopFixedString(); */ int num2 = Event.PopWiredInt32(); class2.string_3 = ""; for (int i = 0; i < num2; i++) { class2.string_3 = class2.string_3 + "," + Convert.ToString(Event.PopWiredUInt()); } if (class2.string_3.Length > 0) { class2.string_3 = class2.string_3.Substring(1); } class2.string_2 = (Convert.ToDouble(Event.PopWiredInt32()) / 2) + ""; break; } case "wf_act_givepoints": Event.PopWiredInt32(); class2.string_2 = Convert.ToString(Event.PopWiredInt32()); class2.string_3 = Convert.ToString(Event.PopWiredInt32()); break; case "wf_act_moverotate": { Event.PopWiredInt32(); class2.string_2 = Convert.ToString(Event.PopWiredInt32()); class2.string_3 = Convert.ToString(Event.PopWiredInt32()); Event.PopWiredBoolean(); Event.PopWiredBoolean(); int num2 = Event.PopWiredInt32(); class2.string_4 = ""; class2.string_5 = ""; if (num2 > 0) { class2.string_5 = OldEncoding.encodeVL64(num2); for (int i = 0; i < num2; i++) { int num3 = Event.PopWiredInt32(); class2.string_5 += OldEncoding.encodeVL64(num3); class2.string_4 = class2.string_4 + "," + Convert.ToString(num3); } class2.string_4 = class2.string_4.Substring(1); } class2.string_6 = Convert.ToString(Event.PopWiredInt32()); break; } case "wf_act_matchfurni": { Event.PopWiredInt32(); Event.PopWiredBoolean(); Event.PopWiredBoolean(); class2.string_3 = ""; RoomItem expr_4A8 = class2; expr_4A8.string_3 += "I"; RoomItem expr_4E1 = class2; expr_4E1.string_3 += "I"; RoomItem expr_51A = class2; expr_51A.string_3 += "I"; // Event.PopFixedString(); int num2 = Event.PopWiredInt32(); class2.string_2 = ""; class2.string_4 = ""; class2.string_5 = ""; if (num2 > 0) { class2.string_5 = OldEncoding.encodeVL64(num2); for (int i = 0; i < num2; i++) { int num3 = Event.PopWiredInt32(); class2.string_5 += OldEncoding.encodeVL64(num3); class2.string_4 = class2.string_4 + "," + Convert.ToString(num3); RoomItem class3 = @class.method_28(Convert.ToUInt32(num3)); RoomItem expr_5E6 = class2; object string_2 = expr_5E6.string_2; expr_5E6.string_2 = string.Concat(new object[] { string_2, ";", class3.GetX, ",", class3.Int32_1, ",", class3.Double_0, ",", class3.int_3, ",", class3.ExtraData }); } class2.string_4 = class2.string_4.Substring(1); class2.string_2 = class2.string_2.Substring(1); } class2.string_6 = Convert.ToString(Event.PopWiredInt32()); break; } } Session.SendMessage(new ServerMessage(Outgoing.SaveWired)); // NEW class2.UpdateState(true, false); } catch { } }
public void Handle(GameClient Session, ClientMessage Event) { try { uint ItemId = Event.PopWiredUInt(); string ClothingName = Event.PopFixedString(); Room Room = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (Room != null) { RoomItem Item = Room.method_28(ItemId); if (Item == null) { return; } string Lookki = Session.GetHabbo().Figure; Lookki = Lookki.Replace(GetHair(Session.GetHabbo().Figure), ""); Lookki = Lookki.Replace(GetBody(Session.GetHabbo().Figure), ""); Item.ExtraData = Lookki + (char)5 + Session.GetHabbo().Gender + (char)5 + ChatCommandHandler.ApplyFilter(ClothingName); using (DatabaseClient class2 = Essential.GetDatabase().GetClient()) { class2.ExecuteQuery("DELETE FROM items_extra_data WHERE item_id = '" + Item.uint_0 + "'"); class2.AddParamWithValue("extradata", Item.ExtraData); class2.ExecuteQuery("INSERT INTO items_extra_data (item_id,extra_data) VALUES ('" + Item.uint_0 + "' , @extradata);"); } Room.method_79(Session, Item, Item.GetX, Item.Int32_1, Item.int_3, true, false, true); Item.ReqUpdate(1); Item.UpdateState(true, true, false); // Item.UpdateState(true, true); } } catch { } }
internal void HandleSpeech(GameClient Session, string str, bool bool_13, int TextColor = 0) { if (TextColor == 23 && Session.GetHabbo().Rank < 4) { TextColor = 0; } if (TextColor > 23 || TextColor < 0 || TextColor == 1 || TextColor == 8 || TextColor == 2) { TextColor = 0; } if (!String.IsNullOrEmpty(str) || !String.IsNullOrWhiteSpace(str)) { string object_ = str; // string linkRegex = @"((http|https):\/\/|www.)?[a-zA-Z0-9\-\.]+\b(com|co\.uk|org|net|eu|cf|info|ml|nl|ca|es|fi)\b"; if (Session == null || (Session.GetHabbo().HasFuse("ignore_roommute") || !this.GetRoom().bool_4)) { this.Unidle(); if (!this.IsBot && this.GetClient().GetHabbo().IsMuted) { this.GetClient().SendNotification(EssentialEnvironment.GetExternalText("error_muted")); } else { if (!str.StartsWith(":") || Session == null || !ChatCommandHandler.HandleCommands(Session, str.Substring(1))) { uint num = Outgoing.Talk; // Updated if (bool_13) { num = Outgoing.Shout; // Updated } if (!this.IsBot && Session.GetHabbo().method_4() > 0) { TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().dateTime_0; if (timeSpan.Seconds > 4) { Session.GetHabbo().int_23 = 0; } if (timeSpan.Seconds < 4 && Session.GetHabbo().int_23 > 5 && !this.IsBot) { ServerMessage Message = new ServerMessage(Outgoing.FloodFilter); Message.AppendInt32(Session.GetHabbo().method_4()); this.GetClient().SendMessage(Message); this.GetClient().GetHabbo().IsMuted = true; this.GetClient().GetHabbo().int_4 = Session.GetHabbo().method_4(); return; } Session.GetHabbo().dateTime_0 = DateTime.Now; Session.GetHabbo().int_23++; } if (!this.IsBot) { str = ChatCommandHandler.ApplyFilter(str); } if (!this.GetRoom().method_9(this, str)) { ServerMessage Message2 = new ServerMessage(num); Message2.AppendInt32(this.VirtualId); string Site = ""; if (str.Contains("http://") || str.Contains("www.")) { string[] Split = str.Split(' '); foreach (string Msg in Split) { if (Msg.StartsWith("http://") || Msg.StartsWith("www.")) { Site = Msg; } } //str = str.Replace(Site, "{0}"); } Message2.AppendStringWithBreak(str); Message2.AppendInt32(ParseEmoticon(str)); Message2.AppendInt32(this.IsBot && !this.IsPet ? 2 : TextColor); Message2.AppendInt32(0); Message2.AppendInt32(-1); if (!Essential.GetAntiAd().ContainsIllegalWord(object_)) { if (!this.IsBot && this.GetClient() != null && this.GetClient().GetHabbo().PassedSafetyQuiz) { this.GetRoom().method_58(Message2, Session.GetHabbo().list_2, Session.GetHabbo().Id); } else { this.GetRoom().SendMessage(Message2, this.IsPet ? this.GetRoom().RoomUsers.Where(p => p != null && p.GetClient() != null && p.GetClient().GetHabbo() != null && p.GetClient().GetHabbo().MutePets).Select(o => o.GetClient().GetHabbo().Id).ToList() : this.IsBot ? this.GetRoom().RoomUsers.Where(p => p != null && p.GetClient() != null && p.GetClient().GetHabbo() != null && p.GetClient().GetHabbo().MuteBots).Select(o => o.GetClient().GetHabbo().Id).ToList() : null); } } else if (Essential.GetAntiAd().ContainsIllegalWord(object_) && this.GetClient() != null) { ServerMessage Message3 = new ServerMessage(Outgoing.InstantChat); Message3.AppendUInt(0u); Message3.AppendString("[AWS] " + Session.GetHabbo().Username + ": " + object_); Message3.AppendString(Essential.GetUnixTimestamp() + string.Empty); Essential.GetGame().GetClientManager().SendToStaffs(Session, Message3); Session.SendNotification(Essential.GetGame().GetRoleManager().GetConfiguration().getData("antiad.alert")); return; } } else { if (!this.IsBot) { Session.GetHabbo().Whisper(str); } } if (!this.IsBot) { this.GetRoom().method_7(this, str, bool_13); if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "CHAT_WITH_SOMEONE") { Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session); } } if (ServerConfiguration.EnableChatlog && !this.IsBot && !Essential.GetAntiAd().ContainsIllegalWord(object_) && this.GetRoom().Id != 74402) { using (DatabaseClient @class = Essential.GetDatabase().GetClient()) { @class.AddParamWithValue("message", object_); @class.ExecuteQuery(string.Concat(new object[] { "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('", Session.GetHabbo().Id, "','", this.GetRoom().Id, "','", DateTime.Now.Hour, "','", DateTime.Now.Minute, "',UNIX_TIMESTAMP(),@message,'", Session.GetHabbo().Username, "','", DateTime.Now.ToLongDateString(), "')" })); } } } } } } }