public override bool Execute(GameClient client, string[] pms) { ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer")); message.AppendString("Yupi"); message.AppendInteger(4); message.AppendString("title"); message.AppendString("Yupi"); message.AppendString("message"); StringBuilder info = new StringBuilder(); info.Append("<h5><b>Yupi - Based on Azure Emulator</b><h5></br></br>"); info.Append("<br />"); info.AppendFormat( "<b><br />Developed by:</b> <br />Kessiler Rodrigues (Kessiler)<br />Claudio Santoro (sant0ro/bi0s) <br />Rafael Oliveira (iPlezier) <br /><br /> "); info.AppendFormat( "<b>Thanks to:</b> <br />Jamal, Mike Santifort, Martinmine, Rockster, The old Azure Team, Bruna F., and to all people that uses Yupi.<br /> <br /> "); info.AppendFormat("<b>Warning:</b><br />1. This emulator was planned to be used for ManiaHotel (maniahotel.com.br) <br />2. Please don't sell this emulator or earn money with it<br />3. All rights reserved to Sulake Corporation Oy<br />4. All Emulator rights for Mania Dev<br />"); message.AppendString(info.ToString()); message.AppendString("linkUrl"); message.AppendString("event:"); message.AppendString("linkTitle"); message.AppendString("ok"); client.SendMessage(message); return true; }
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights) { if (!hasRights) return; int num; int.TryParse(item.ExtraData, out num); switch (request) { case 1: num++; break; case 2: num--; break; case 3: num = 0; break; } item.ExtraData = num.ToString(); item.UpdateState(false, true); }
/// <summary> /// Serializes the quest. /// </summary> /// <param name="message">The message.</param> /// <param name="session">The session.</param> /// <param name="quest">The quest.</param> /// <param name="category">The category.</param> internal static void SerializeQuest(ServerMessage message, GameClient session, Quest quest, string category) { if (message == null || session == null) { return; } var amountOfQuestsInCategory = Yupi.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(category); { var num = quest == null ? amountOfQuestsInCategory : quest.Number - 1; var num2 = quest == null ? 0 : session.GetHabbo().GetQuestProgress(quest.Id); if (quest != null && quest.IsCompleted(num2)) { num++; } message.AppendString(category); message.AppendInteger(quest == null ? 0 : (quest.Category.Contains("xmas2012") ? 0 : num)); message.AppendInteger(quest == null ? 0 : (quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory)); message.AppendInteger(quest?.RewardType ?? 3); message.AppendInteger(quest?.Id ?? 0); message.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id); message.AppendString(quest == null ? string.Empty : quest.ActionName); message.AppendString(quest == null ? string.Empty : quest.DataBit); message.AppendInteger(quest?.Reward ?? 0); message.AppendString(quest == null ? string.Empty : quest.Name); message.AppendInteger(num2); message.AppendInteger(quest?.GoalData ?? 0u); message.AppendInteger(quest?.TimeUnlock ?? 0); message.AppendString(string.Empty); message.AppendString(string.Empty); message.AppendBool(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 void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights) { if (session == null) return; RoomUser user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id); if (user == null) return; if (user.Coordinate != item.SquareInFront && user.CanWalk) { user.MoveTo(item.SquareInFront); return; } if (!item.GetRoom().GetGameMap().CanWalk(item.SquareBehind.X, item.SquareBehind.Y, user.AllowOverride)) return; if (item.InteractingUser == 0) { item.InteractingUser = user.HabboId; user.CanWalk = false; if (user.IsWalking && (user.GoalX != item.SquareInFront.X || user.GoalY != item.SquareInFront.Y)) user.ClearMovement(); user.AllowOverride = true; user.MoveTo(item.Coordinate); item.ReqUpdate(4, true); } }
public override bool Execute(GameClient session, string[] pms) { Yupi.GetGame().GetHallOfFame().RefreshHallOfFame(); Yupi.GetGame().GetRoomManager().GetCompetitionManager().RefreshCompetitions(); Yupi.GetGame().GetTargetedOfferManager().LoadOffer(); return true; }
public override bool Execute(GameClient session, string[] pms) { uint amount; if (!uint.TryParse(pms[0], out amount)) { session.SendNotif(Yupi.GetLanguage().GetVar("enter_numbers")); return true; } foreach (GameClient client in Yupi.GetGame().GetClientManager().Clients.Values) { if (client?.GetHabbo() == null) continue; Habbo habbo = client.GetHabbo(); habbo.Diamonds += amount; client.GetHabbo().UpdateSeasonalCurrencyBalance(); client.SendNotif(Yupi.GetLanguage().GetVar("command_diamonds_one_give") + amount + Yupi.GetLanguage().GetVar("command_diamonds_two_give")); } return true; }
public override bool Execute(GameClient session, string[] pms) { PetTypeManager.Load(); PetCommandHandler.Init(Yupi.GetDatabaseManager().GetQueryReactor()); 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 void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights) { RoomUser roomUser = null; if (session != null) roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id); if (roomUser == null) return; if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y)) { if (item.ExtraData == "-1") return; if (request == -1) { item.ExtraData = "0"; item.UpdateState(); return; } item.ExtraData = "-1"; item.UpdateState(false, true); item.ReqUpdate(4, true); return; } roomUser.MoveTo(item.SquareInFront); }
public override void OnPlace(GameClient session, RoomItem item) { item.GetRoom().GetRoomItemHandler().HopperCount++; using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor()) { queryReactor.SetQuery("INSERT INTO items_hopper (hopper_id, room_id) VALUES (@hopperid, @roomid);"); queryReactor.AddParameter("hopperid", item.Id); queryReactor.AddParameter("roomid", item.RoomId); queryReactor.RunQuery(); } if (item.InteractingUser == 0u) return; RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser); if (roomUserByHabbo != null) { roomUserByHabbo.ClearMovement(); roomUserByHabbo.AllowOverride = false; roomUserByHabbo.CanWalk = true; } item.InteractingUser = 0u; }
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights) { if (!hasRights) return; int num; int.TryParse(item.ExtraData, out num); switch (request) { case 1: if (item.PendingReset && num > 0) { num = 0; item.PendingReset = false; } else { num += 60; item.UpdateNeeded = false; } break; case 2: item.UpdateNeeded = !item.UpdateNeeded; item.PendingReset = true; break; } item.ExtraData = num.ToString(); item.UpdateState(); }
public override bool Execute(GameClient session, string[] pms) { session.GetHabbo().GetInventoryComponent().Redeemcredits(session); session.SendNotif(Yupi.GetLanguage().GetVar("command_redeem_credits")); return true; }
public override bool Execute(GameClient session, string[] pms) { session.GetHabbo().SpectatorMode = true; session.SendNotif("In next room you enter you will be invisible."); return true; }
/// <summary> /// Initializes a new instance of the <see cref="HelperSession" /> class. /// </summary> /// <param name="helper">The helper.</param> /// <param name="requester">The requester.</param> /// <param name="question">The question.</param> internal HelperSession(GameClient helper, GameClient requester, string question) { Helper = helper; Requester = requester; Chats = new List<string> {question}; Response(requester, question); }
public override bool Execute(GameClient session, string[] pms) { using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor()) Yupi.ConfigData = new ServerDatabaseSettings(adapter); session.SendNotif(Yupi.GetLanguage().GetVar("command_refresh_settings")); 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; }
/// <summary> /// Gives the badge. /// </summary> /// <param name="badge">The badge.</param> /// <param name="inDatabase">if set to <c>true</c> [in database].</param> /// <param name="session">The session.</param> /// <param name="wiredReward">if set to <c>true</c> [wired reward].</param> internal void GiveBadge(string badge, bool inDatabase, GameClient session, bool wiredReward = false) { if (wiredReward) session.SendMessage(SerializeBadgeReward(!HasBadge(badge))); if (HasBadge(badge)) return; if (inDatabase) { using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor()) { queryReactor.SetQuery( string.Concat("INSERT INTO users_badges (user_id,badge_id,badge_slot) VALUES (", _userId, ",@badge,", 0, ")")); queryReactor.AddParameter("badge", badge); queryReactor.RunQuery(); } } BadgeList.Add(badge, new Badge(badge, 0)); session.SendMessage(SerializeBadge(badge)); session.SendMessage(Update(badge)); }
public override bool Execute(GameClient session, string[] pms) { Room room = session.GetHabbo().CurrentRoom; using (IQueryAdapter commitableQueryReactor = Yupi.GetDatabaseManager().GetQueryReactor()) commitableQueryReactor.RunFastQuery( $"UPDATE rooms_data SET roomtype = 'public' WHERE id = {room.RoomId}"); uint roomId = session.GetHabbo().CurrentRoom.RoomId; List<RoomUser> users = new List<RoomUser>(session.GetHabbo().CurrentRoom.GetRoomUserManager().UserList.Values); Yupi.GetGame().GetRoomManager().UnloadRoom(session.GetHabbo().CurrentRoom, "Unload command"); Yupi.GetGame().GetRoomManager().LoadRoom(roomId); ServerMessage roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer")); roomFwd.AppendInteger(roomId); byte[] data = roomFwd.GetReversedBytes(); foreach (RoomUser user in users.Where(user => user != null && user.GetClient() != null)) user.GetClient().SendMessage(data); return true; }
public override bool Execute(GameClient session, string[] pms) { using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor()) Yupi.GetGame().GetPollManager().Init(adapter); session.SendNotif(Yupi.GetLanguage().GetVar("command_refresh_polls")); return true; }
/// <summary> /// Composes the specified session. /// </summary> /// <param name="session">The session.</param> /// <param name="talent">The Talent.</param> /// <returns>ServerMessage.</returns> internal static ServerMessage Compose(GameClient session, Talent talent) { ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("TalentLevelUpMessageComposer")); serverMessage.AppendString(talent.Type); serverMessage.AppendInteger(talent.Level); serverMessage.AppendInteger(0); if (talent.Type == "citizenship" && talent.Level == 4) { serverMessage.AppendInteger(2); serverMessage.AppendString("HABBO_CLUB_VIP_7_DAYS"); serverMessage.AppendInteger(7); serverMessage.AppendString(talent.Prize); serverMessage.AppendInteger(0); } else { serverMessage.AppendInteger(1); serverMessage.AppendString(talent.Prize); serverMessage.AppendInteger(0); } return serverMessage; }
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; }
/// <summary> /// Adds the guide. /// </summary> /// <param name="guide">The guide.</param> public void AddGuide(GameClient guide) { switch (guide.GetHabbo().DutyLevel) { case 1: if (!GuidesOnDuty.Contains(guide)) GuidesOnDuty.Add(guide); break; case 2: if (!HelpersOnDuty.Contains(guide)) HelpersOnDuty.Add(guide); break; case 3: if (!GuardiansOnDuty.Contains(guide)) GuardiansOnDuty.Add(guide); break; default: if (!GuidesOnDuty.Contains(guide)) GuidesOnDuty.Add(guide); break; } }
/// <summary> /// Composes the specified session. /// </summary> /// <param name="session">The session.</param> /// <param name="quest">The quest.</param> /// <returns>ServerMessage.</returns> internal static ServerMessage Compose(GameClient session, Quest quest) { var amountOfQuestsInCategory = Yupi.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(quest.Category); var i = quest == null ? amountOfQuestsInCategory : quest.Number; var i2 = quest == null ? 0 : session.GetHabbo().GetQuestProgress(quest.Id); var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestCompletedMessageComposer")); serverMessage.AppendString(quest.Category); serverMessage.AppendInteger(i); serverMessage.AppendInteger(quest.Name.Contains("xmas2012") ? 1 : amountOfQuestsInCategory); serverMessage.AppendInteger(quest == null ? 3 : quest.RewardType); serverMessage.AppendInteger(quest == null ? 0 : quest.Id); serverMessage.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id); serverMessage.AppendString(quest == null ? string.Empty : quest.ActionName); serverMessage.AppendString(quest == null ? string.Empty : quest.DataBit); serverMessage.AppendInteger(quest == null ? 0 : quest.Reward); serverMessage.AppendString(quest == null ? string.Empty : quest.Name); serverMessage.AppendInteger(i2); serverMessage.AppendInteger(quest == null ? 0u : quest.GoalData); serverMessage.AppendInteger(quest == null ? 0 : quest.TimeUnlock); serverMessage.AppendString(""); serverMessage.AppendString(""); serverMessage.AppendBool(true); serverMessage.AppendBool(true); return serverMessage; }
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 void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights) { RoomUser roomUser = null; if (session != null) roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id); if (roomUser == null) return; if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y)) { uint num = item.GetBaseItem().Modes - 1; int num2, num3; int.TryParse(item.ExtraData, out num2); if (num2 <= 0) num3 = 1; else { if (num2 >= num) num3 = 0; else num3 = num2 + 1; } item.ExtraData = num3.ToString(); item.UpdateState(); item.GetRoom().GetWiredHandler().ExecuteWired(Interaction.TriggerStateChanged, roomUser, item); return; } roomUser.MoveTo(item.SquareInFront); }
/// <summary> /// Initializes a new instance of the <see cref="InventoryComponent" /> class. /// </summary> /// <param name="userId">The user identifier.</param> /// <param name="client">The client.</param> /// <param name="userData">The user data.</param> internal InventoryComponent(uint userId, GameClient client, UserData userData) { _mClient = client; UserId = userId; _floorItems = new HybridDictionary(); _wallItems = new HybridDictionary(); SongDisks = new HybridDictionary(); foreach (UserItem current in userData.Inventory) { if (current.BaseItem.InteractionType == Interaction.MusicDisc) SongDisks.Add(current.Id, current); if (current.IsWallItem) _wallItems.Add(current.Id, current); else _floorItems.Add(current.Id, current); } _inventoryPets = new HybridDictionary(); _inventoryBots = new HybridDictionary(); _mAddedItems = new HybridDictionary(); _mRemovedItems = new HybridDictionary(); _isUpdated = false; foreach (KeyValuePair<uint, RoomBot> bot in userData.Bots) AddBot(bot.Value); foreach (KeyValuePair<uint, Pet> pets in userData.Pets) AddPets(pets.Value); }
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) { using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor()) { FurnitureDataManager.SetCache(); Yupi.GetGame().GetItemManager().LoadItems(adapter); Yupi.GetGame().GetCatalog().Initialize(adapter); Yupi.GetGame().ReloadItems(); FurnitureDataManager.Clear(); } Yupi.GetGame() .GetClientManager() .QueueBroadcaseMessage( new ServerMessage(LibraryParser.OutgoingRequest("PublishShopMessageComposer"))); ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer")); message.AppendString("ninja_promo_LTD"); message.AppendInteger(4); message.AppendString("title"); message.AppendString("Novo Raro Limitado!"); message.AppendString("message"); message.AppendString( "<i><h1>Como Assim?</h1>, Um Novo Raro Limitado foi Adicionado na Loja!<br> Descubra como ele é Abrindo a Loja!</br>"); message.AppendString("linkUrl"); message.AppendString("event:catalog/open/ultd_furni"); message.AppendString("linkTitle"); message.AppendString("Ver o Raro"); Yupi.GetGame().GetClientManager().QueueBroadcaseMessage(message); return true; }
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights) { if (item.ExtraData == "1" || !item.GetBaseItem().VendingIds.Any() || item.InteractingUser != 0u || session == null) return; RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id); if (roomUserByHabbo == null) return; if (!Gamemap.TilesTouching(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y)) { roomUserByHabbo.MoveTo(item.SquareInFront); return; } item.InteractingUser = session.GetHabbo().Id; roomUserByHabbo.CanWalk = false; roomUserByHabbo.ClearMovement(); roomUserByHabbo.SetRot(PathFinder.CalculateRotation(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y)); item.ReqUpdate(2, true); item.ExtraData = "1"; item.UpdateState(false, true); }