public override bool Execute(GameClient session, string[] pms) { Habbo user = Yupi.GetHabboForName(pms[0]); if (user == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (user.Rank >= session.GetHabbo().Rank) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank")); return true; } using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor()) { adapter.SetQuery("DELETE FROM users_bans WHERE value = @name"); adapter.AddParameter("name", user.UserName); adapter.RunQuery(); Yupi.GetGame() .GetModerationTool() .LogStaffEntry(session.GetHabbo().UserName, user.UserName, "Unban", $"User has been Unbanned [{pms[0]}]"); return true; } }
public override bool Execute(GameClient session, string[] pms) { GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (client == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (client.GetHabbo().Rank >= session.GetHabbo().Rank) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank")); return true; } int time; if (!int.TryParse(pms[1], out time)) { session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers")); return true; } client.GetHabbo().FloodTime = Yupi.GetUnixTimeStamp() + Convert.ToInt32(pms[1]); ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FloodFilterMessageComposer")); serverMessage.AppendInteger(Convert.ToInt32(pms[1])); client.SendMessage(serverMessage); return true; }
public override bool Execute(GameClient session, string[] pms) { GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (user == null || user.GetHabbo() == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (user.GetHabbo().Rank >= session.GetHabbo().Rank) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank")); return true; } try { user.GetConnection().Dispose(); Yupi.GetGame() .GetModerationTool() .LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "dc", $"Disconnect User[{pms[1]}]"); } catch { } return true; }
public override bool Execute(GameClient session, string[] pms) { GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (user == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (user.GetHabbo().Rank >= session.GetHabbo().Rank) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank")); return true; } string userName = pms[0]; string rank = pms[1]; using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor()) { adapter.SetQuery("UPDATE users SET rank=@rank WHERE username=@user LIMIT 1"); adapter.AddParameter("user", userName); adapter.AddParameter("rank", rank); adapter.RunQuery(); } session.SendWhisper(Yupi.GetLanguage().GetVar("user_rank_update")); return true; }
public override bool Execute(GameClient session, string[] pms) { GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (client == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } uint amount; if (!uint.TryParse(pms[1], out amount)) { session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers")); return true; } client.GetHabbo().Diamonds += amount; client.GetHabbo().UpdateSeasonalCurrencyBalance(); client.SendNotif(string.Format(Yupi.GetLanguage().GetVar("staff_gives_diamonds"), session.GetHabbo().UserName, amount)); return true; }
public override bool Execute(GameClient session, string[] pms) { GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (user == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (user.GetHabbo().Rank >= session.GetHabbo().Rank) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank")); return true; } try { Yupi.GetGame() .GetBanManager() .BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(2)), true, false); } catch { ServerLogManager.LogException($"An error occurred when {session.GetHabbo().UserName} tried to ban {user.GetHabbo().UserName}"); } return true; }
public override bool Execute(GameClient session, string[] pms) { Room room = session.GetHabbo().CurrentRoom; RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id); if (user == null) return true; if (room.RoomData.DisablePull) { session.SendWhisper("Realizar Pull Foi Desativado pelo Dono do Quarto"); return true; } GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (client == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (client.GetHabbo().Id == session.GetHabbo().Id) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_own")); return true; } RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id); if (user2 == null) return true; if (user2.TeleportEnabled) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable")); return true; } if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 2) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_far_away")); return true; } if (user.RotBody%2 != 0) user.RotBody--; switch (user.RotBody) { case 0: user2.MoveTo(user.X, user.Y - 1); break; case 2: user2.MoveTo(user.X + 1, user.Y); break; case 4: user2.MoveTo(user.X, user.Y + 1); break; case 6: user2.MoveTo(user.X - 1, user.Y); break; } return true; }
public override bool Execute(GameClient session, string[] pms) { string userName = pms[0]; GameClient userSession = Yupi.GetGame().GetClientManager().GetClientByUserName(userName); if (userSession == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (session.GetHabbo().Rank <= userSession.GetHabbo().Rank) { session.SendNotif(Yupi.GetLanguage().GetVar("user_is_higher_rank")); return true; } if (userSession.GetHabbo().CurrentRoomId < 1) { session.SendNotif(Yupi.GetLanguage().GetVar("command_kick_user_not_in_room")); return true; } Room room = Yupi.GetGame().GetRoomManager().GetRoom(userSession.GetHabbo().CurrentRoomId); if (room == null) return true; room.GetRoomUserManager().RemoveUserFromRoom(userSession, true, false); userSession.CurrentRoomUserId = -1; if (pms.Length > 1) { userSession.SendNotif( string.Format(Yupi.GetLanguage().GetVar("command_kick_user_mod_default") + "{0}.", string.Join(" ", pms.Skip(1)))); } else userSession.SendNotif(Yupi.GetLanguage().GetVar("command_kick_user_mod_default")); return true; }
public override bool Execute(GameClient session, string[] pms) { Room room = session.GetHabbo().CurrentRoom; if (!session.GetHabbo().CurrentRoom.RoomMuted) { session.SendWhisper("Room isn't muted."); return true; } session.GetHabbo().CurrentRoom.RoomMuted = false; /* var message = new ServerMessage(); message.Load(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer")); message.AppendString("Room is now UnMuted."); message.AppendString(""); room.SendMessage(message);*/ room.SendMessage(GameClient.GetBytesNotif("Este quarto foi des-selenciado.")); Yupi.GetGame() .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty, "Room Unmute", "Room UnMuted"); return true; }
public override bool Execute(GameClient session, string[] pms) { Room room = session.GetHabbo().CurrentRoom; if (room.RoomMuted) { session.SendWhisper("Room is already muted."); return true; } session.GetHabbo().CurrentRoom.RoomMuted = true; /* var message = new ServerMessage(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer")); message.AppendString(string.Format("The room was muted due to:\r{0}", string.Join(" ", pms))); message.AppendString(string.Empty); room.SendMessage(message);*/ room.SendMessage(GameClient.GetBytesNotif( $"Este quarto foi silenciado pelo motivo:\r{string.Join(" ", pms)}")); Yupi.GetGame() .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty, "Room Mute", "Room muted"); return true; }
public override bool Execute(GameClient session, string[] pms) { Room room = session.GetHabbo().CurrentRoom; RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id); if (user == null) return true; GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (client == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (client.GetHabbo().Id == session.GetHabbo().Id) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_own")); return true; } RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id); if (user2 == null) return true; if (user2.TeleportEnabled) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable")); return true; } if (user.RotBody % 2 != 0) user.RotBody--; switch (user.RotBody) { case 0: user2.MoveTo(user.X, user.Y - 1); break; case 2: user2.MoveTo(user.X + 1, user.Y); break; case 4: user2.MoveTo(user.X, user.Y + 1); break; case 6: user2.MoveTo(user.X - 1, user.Y); break; } return true; }
public override bool Execute(GameClient session, string[] pms) { uint speed; if (uint.TryParse(pms[0], out speed)) session.GetHabbo().CurrentRoom.GetRoomItemHandler().SetSpeed(speed); else session.SendWhisper(Yupi.GetLanguage().GetVar("command_setspeed_error_numbers")); return true; }
public override bool Execute(GameClient session, string[] pms) { GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (client == null || client.GetHabbo() == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (client.GetHabbo().Rank >= 4) { session.SendWhisper("You are not allowed to mute that user."); } Yupi.GetGame() .GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, client.GetHabbo().UserName, "Unmute", "Unmuted user"); client.GetHabbo().UnMute(); return true; }
public override bool Execute(GameClient session, string[] pms) { RoomUser user = session.GetHabbo() .CurrentRoom.GetRoomUserManager() .GetRoomUserByHabbo(pms[0]); if (user == null) session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); else user.Frozen = !user.Frozen; return true; }
public override bool Execute(GameClient session, string[] pms) { string mode = pms[0]; pms = pms.Skip(1).ToArray(); switch (mode.ToLower()) { case "info": { if (pms.Length == 0) session.SendWhisper("Usage :developer info [items/user/users/cache]"); else return GetInfo(session, pms); break; } case "set": { if (pms.Length < 2) session.SendWhisper("Usage :developer set [item/baseItem] id"); else return Set(session, pms); break; } case "copy": { return Copy(session); } case "paste": { return Paste(session); } case "delete": { return Delete(session); } default: { session.SendWhisper("Usage :developer [info/set/copy/paste/delete]"); break; } } return true; }
public override bool Execute(GameClient session, string[] pms) { GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (client == null || client.GetHabbo().Rank >= session.GetHabbo().Rank) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } client.GetHabbo().GetInventoryComponent().ClearItems(); return true; }
public override bool Execute(GameClient session, string[] pms) { Room room = Yupi.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId); if (room == null) return true; RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().LastSelectedUser); if (user2 == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName); if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 1) { session.SendWhisper(Yupi.GetLanguage().GetVar("kil_command_error_1")); return true; } if (user2.IsLyingDown || user2.IsSitting) { session.SendWhisper(Yupi.GetLanguage().GetVar("kil_command_error_2")); return true; } if ( !string.Equals(user2.GetUserName(), session.GetHabbo().UserName, StringComparison.CurrentCultureIgnoreCase)) { user2.Statusses.Add("lay", "0.55"); user2.IsLyingDown = true; user2.UpdateNeeded = true; user.Chat(user.GetClient(), Yupi.GetLanguage().GetVar("command.kill.user"), true, 0, 3); user2.Chat(user2.GetClient(), Yupi.GetLanguage().GetVar("command.kill.userdeath"), true, 0, 3); return true; } user.Chat(session, "I am sad", false, 0); return true; }
public override bool Execute(GameClient session, string[] pms) { string type = pms[0]; string word = pms[1]; if (string.IsNullOrEmpty(word)) { session.SendWhisper("Palabra inválida."); return true; } BlackWordsManager.AddBlackWord(type, word); return true; }
public override bool Execute(GameClient session, string[] pms) { string userName = pms[0]; string msg = string.Join(" ", pms.Skip(1)); GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(userName); if (client == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } client.SendNotif($"{msg} \r\r-{session.GetHabbo().UserName}"); return true; }
public override bool Execute(GameClient session, string[] pms) { Room room = session.GetHabbo().CurrentRoom; RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id); if (user == null) return true; if (!user.RidingHorse) { user.TeleportEnabled = !user.TeleportEnabled; room.GetGameMap().GenerateMaps(); return true; } session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable")); return true; }
public override bool Execute(GameClient session, string[] pms) { ushort maxUsers; if (!ushort.TryParse(pms[0], out maxUsers) || maxUsers == 0 || maxUsers > 200) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_setmax_error_number")); return true; } if (maxUsers > 100 && !(session.GetHabbo().Vip || session.GetHabbo().HasFuse("fuse_vip_commands"))) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_setmax_error_max")); return true; } if (maxUsers < 10 && !(session.GetHabbo().Vip || session.GetHabbo().HasFuse("fuse_vip_commands"))) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_setmax_error_min")); return true; } session.GetHabbo().CurrentRoom.SetMaxUsers(maxUsers); return true; }
public override bool Execute(GameClient session, string[] pms) { { GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (user == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (user.GetHabbo().Rank >= session.GetHabbo().Rank) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank")); return true; } try { int length = int.Parse(pms[1]); string message = pms.Length < 3 ? string.Empty : string.Join(" ", pms.Skip(2)); if (string.IsNullOrWhiteSpace(message)) message = Yupi.GetLanguage().GetVar("command_ban_user_no_reason"); ModerationTool.BanUser(session, user.GetHabbo().Id, length, message); Yupi.GetGame() .GetModerationTool() .LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "Ban", $"USER:{pms[0]} TIME:{pms[1]} REASON:{pms[2]}"); } catch { // error handle } return true; } }
public override bool Execute(GameClient client, string[] pms) { uint id = uint.Parse(pms[0]); Poll poll = Yupi.GetGame().GetPollManager().TryGetPollById(id); if (poll == null || poll.Type != PollType.Matching) { client.SendWhisper("Poll doesn't exists or isn't a matching poll."); return true; } poll.AnswersPositive = 0; poll.AnswersNegative = 0; MatchingPollAnswer(client, poll); Thread showPoll = new Thread(delegate () { MatchingPollResults(client, poll); }); showPoll.Start(); return true; }
public override bool Execute(GameClient session, string[] pms) { ushort result; ushort.TryParse(pms[0], out result); if (result > 4) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_dance_false")); result = 0; } ServerMessage message = new ServerMessage(); message.Init(LibraryParser.OutgoingRequest("DanceStatusMessageComposer")); message.AppendInteger(session.CurrentRoomUserId); message.AppendInteger(result); session.GetHabbo().CurrentRoom.SendMessage(message); return true; }
public override bool Execute(GameClient session, string[] pms) { GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]); if (client == null || client.GetHabbo() == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } if (client.GetHabbo().CurrentRoom == null || client.GetHabbo().CurrentRoom == session.GetHabbo().CurrentRoom) return false; ServerMessage roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer")); roomFwd.AppendInteger(client.GetHabbo().CurrentRoom.RoomId); session.SendMessage(roomFwd); return true; }
public override bool Execute(GameClient session, string[] pms) { string userName = pms[0]; if (string.IsNullOrEmpty(userName)) return true; GameClient clientByUserName = Yupi.GetGame().GetClientManager().GetClientByUserName(userName); if (clientByUserName == null || clientByUserName.GetHabbo() == null) { using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor()) { adapter.SetQuery( "SELECT username, rank, id, credits, activity_points, diamonds FROM users WHERE username=@user LIMIT 1"); adapter.AddParameter("user", userName); DataRow row = adapter.GetRow(); if (row == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } session.SendNotif(string.Format(Yupi.GetLanguage().GetVar("user_info_all"), userName, row[1], row[3], row[4], row[5])); } return true; } Habbo habbo = clientByUserName.GetHabbo(); StringBuilder builder = new StringBuilder(); if (habbo.CurrentRoom != null) { builder.AppendFormat(" - ROOM INFORMATION [{0}] - \r", habbo.CurrentRoom.RoomId); builder.AppendFormat("Owner: {0}\r", habbo.CurrentRoom.RoomData.Owner); builder.AppendFormat("Room Name: {0}\r", habbo.CurrentRoom.RoomData.Name); builder.Append( string.Concat("Current Users: ", habbo.CurrentRoom.UserCount, "/", habbo.CurrentRoom.RoomData.UsersMax)); } session.SendNotif(string.Concat("User info for: ", userName, " \rUser ID: ", habbo.Id, ":\rRank: ", habbo.Rank, "\rCurrentTalentLevel: ", habbo.CurrentTalentLevel, " \rCurrent Room: ", habbo.CurrentRoomId, " \rCredits: ", habbo.Credits, "\rDuckets: ", habbo.ActivityPoints, "\rDiamonds: ", habbo.Diamonds, "\rMuted: ", habbo.Muted.ToString(), "\r\r\r", builder.ToString())); return true; }
public override bool Execute(GameClient session, string[] pms) { ushort itemId; if (!ushort.TryParse(pms[0], out itemId)) return true; RoomUser user = session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName); if (user.RidingHorse) { session.SendWhisper(Yupi.GetLanguage().GetVar("horse_handitem_error")); return true; } if (user.IsLyingDown) return true; user.CarryItem(itemId); return true; }
public override bool Execute(GameClient session, string[] pms) { Room room = session.GetHabbo().CurrentRoom; RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(pms[0]); if (user == null) { session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found")); return true; } string gender = user.GetClient().GetHabbo().Gender; string look = user.GetClient().GetHabbo().Look; session.GetHabbo().Gender = gender; session.GetHabbo().Look = look; using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor()) { adapter.SetQuery( "UPDATE users SET gender = @gender, look = @look WHERE id = " + session.GetHabbo().Id); adapter.AddParameter("gender", gender); adapter.AddParameter("look", look); adapter.RunQuery(); } RoomUser myUser = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName); if (myUser == null) return true; ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer")); message.AppendInteger(myUser.VirtualId); message.AppendString(session.GetHabbo().Look); message.AppendString(session.GetHabbo().Gender.ToLower()); message.AppendString(session.GetHabbo().Motto); message.AppendInteger(session.GetHabbo().AchievementPoints); room.SendMessage(message.GetReversedBytes()); return true; }
public override bool Execute(GameClient session, string[] pms) { ushort danceId; ushort.TryParse(pms[0], out danceId); if (danceId > 4) { session.SendWhisper(Yupi.GetLanguage().GetVar("command_dance_wrong_syntax")); return true; } Room room = Yupi.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId); HashSet<RoomUser> roomUsers = room.GetRoomUserManager().GetRoomUsers(); foreach (RoomUser roomUser in roomUsers) { ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("DanceStatusMessageComposer")); message.AppendInteger(roomUser.VirtualId); message.AppendInteger(danceId); room.SendMessage(message); roomUser.DanceId = danceId; } return true; }
/// <summary> /// Tries the execute. /// </summary> /// <param name="parameters"></param> /// <param name="client">The client.</param> /// <param name="scommand"></param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public static bool TryExecute(string scommand, string parameters, GameClient client) { if (string.IsNullOrEmpty(scommand) || string.IsNullOrEmpty(parameters) || client.GetHabbo() == null || !client.GetHabbo().InRoom) return false; string[] pms = parameters.Split(' '); string commandName = scommand; if (AliasDictionary.ContainsKey(commandName)) commandName = AliasDictionary[commandName]; if (!CommandsDictionary.ContainsKey(commandName)) return false; Command command = CommandsDictionary[commandName]; if (!CanUse(command.MinRank, client)) return false; if (command.MinParams == -2 || (command.MinParams == -1 && pms.Length > 1) || command.MinParams != -1 && command.MinParams == pms.Length - 1) return command.Execute(client, pms.Skip(1).ToArray()); client.SendWhisper(Yupi.GetLanguage().GetVar("use_the_command_as") + command.Usage); return true; }