public void parse(GameClient Session, ClientMessage Event) { Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && (@class.AllowPet || @class.CheckRights(Session, true))) { uint uint_ = Event.PopWiredUInt(); Pet class2 = Session.GetHabbo().GetInventoryComponent().GetPet(uint_); if (class2 != null && !class2.PlacedInRoom) { int num = Event.PopWiredInt32(); int num2 = Event.PopWiredInt32(); if (@class.CanWalk(num, num2, 0.0, true, false)) { if (@class.Int32_2 >= GlobalClass.MaxPetsPerRoom) { Session.SendNotif(TextManager.GetText("error_maxpets") + GlobalClass.MaxPetsPerRoom); } else { class2.PlacedInRoom = true; class2.RoomId = @class.RoomId; List<RandomSpeech> list = new List<RandomSpeech>(); List<BotResponse> list2 = new List<BotResponse>(); @class.method_4(new RoomBot(class2.PetId, class2.RoomId, AIType.Pet, "freeroam", class2.Name, "", class2.Look, num, num2, 0, 0, 0, 0, 0, 0, ref list, ref list2, 0), class2); if (@class.CheckRights(Session, true)) { Session.GetHabbo().GetInventoryComponent().MovePetToRoom(class2.PetId, @class.RoomId); } } } } } }
public void parse(GameClient Session, ClientMessage Event) { int num = Event.PopWiredInt32(); ServerMessage Message = new ServerMessage(300); Message.AppendInt32(num); if (num > 0) { for (int i = 0; i < num; i++) { int num2 = Event.PopWiredInt32(); if (num2 > 0) { /*Soundtrack @class = GoldTree.GetGame().GetItemManager().method_4(num2); Message.AppendInt32(@class.Id); Message.AppendStringWithBreak(@class.Name); Message.AppendStringWithBreak(@class.Track); Message.AppendInt32(@class.Length); Message.AppendStringWithBreak(@class.Author);*/ Message.AppendInt32(SongManager.GetSong(num2).Id); Message.AppendStringWithBreak(SongManager.GetSong(num2).Name); Message.AppendStringWithBreak(SongManager.GetSong(num2).Track); Message.AppendInt32(SongManager.GetSong(num2).Length); Message.AppendStringWithBreak(SongManager.GetSong(num2).Author); } } } Session.SendMessage(Message); }
public void parse(GameClient Session, ClientMessage Event) { int MinCost = Event.PopWiredInt32(); int MaxCost = Event.PopWiredInt32(); string SearchQuery = Event.PopFixedString(); int FilterMode = Event.PopWiredInt32(); Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().SerializeOffersNew(MinCost, MaxCost, SearchQuery, FilterMode)); }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().HasRole("acc_supporttool")) { int Result = Event.PopWiredInt32(); Event.PopWiredInt32(); uint TicketId = Event.PopWiredUInt(); PhoenixEnvironment.GetGame().GetModerationTool().CloseTicket(Session, TicketId, Result); } }
public void parse(GameClient Session, ClientMessage Event) { Event.PopWiredInt32(); uint num = Event.PopWiredUInt(); Event.PopWiredInt32(); if (PhoenixEnvironment.GetConfig().data["emu.messages.roommgr"] == "1") { Logging.WriteLine("[RoomMgr] Requesting Public Room [ID: " + num + "]"); } RoomData @class = PhoenixEnvironment.GetGame().GetRoomManager().GenerateRoomData(num); if (@class != null && !(@class.Type != "public")) { Session.GetMessageHandler().PrepareRoomForUser(num, ""); } }
public void parse(GameClient Session, ClientMessage Event) { uint Id = Event.PopWiredUInt(); Event.PopFixedString(); Event.PopWiredInt32(); RoomData Data = PhoenixEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id); if (Data != null) { if (Data.Type == "private") { ServerMessage Message = new ServerMessage(286); Message.AppendBoolean(Data.IsPublicRoom); Message.AppendUInt(Id); Session.SendMessage(Message); } else { ServerMessage Message2 = new ServerMessage(453); Message2.AppendUInt(Data.Id); Message2.AppendStringWithBreak(Data.CCTs); Message2.AppendUInt(Data.Id); Session.SendMessage(Message2); } } }
public void parse(GameClient Session, ClientMessage Event) { Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id); roomUserByHabbo.Unidle(); int i = Event.PopWiredInt32(); if (i < 0 || i > 4 || (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && i > 1)) { i = 0; } if (i > 0 && roomUserByHabbo.CarryItemID > 0) { roomUserByHabbo.CarryItem(0); } roomUserByHabbo.DanceId = i; ServerMessage Message = new ServerMessage(480); Message.AppendInt32(roomUserByHabbo.VirtualId); Message.AppendInt32(i); room.SendMessage(Message, null); if (Session.GetHabbo().CurrentQuestId == 6) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(6, Session); } }
public void parse(GameClient Session, ClientMessage Event) { if (((Session != null) && (Session.GetHabbo() != null)) && (Session.GetHabbo().CurrentRoom != null)) { Room currentRoom = Session.GetHabbo().CurrentRoom; if (currentRoom.CheckRights(Session, true)) { RoomMusicController roomMusicController = currentRoom.GetRoomMusicController(); if (roomMusicController.PlaylistSize < roomMusicController.PlaylistCapacity) { int num = Event.PopWiredInt32(); UserItem item = Session.GetHabbo().GetInventoryComponent().GetItem((uint)num); if ((item != null) && (item.GetBaseItem().InteractionType == "musicdisc")) { SongItem diskItem = new SongItem(item); if (roomMusicController.AddDisk(diskItem) >= 0) { //diskItem.SaveToDatabase((int)currentRoom.Id); // <-- old diskItem.SaveToDatabase((int)roomMusicController.LinkedItemId); // <-- new Session.GetHabbo().GetInventoryComponent().RemoveItem((uint)num, 0, true); Session.GetHabbo().GetInventoryComponent().UpdateItems(true); Session.SendMessage(JukeboxDiscksComposer.Compose(roomMusicController.PlaylistCapacity, roomMusicController.Playlist.Values.ToList<SongInstance>())); } } } } } }
public void parse(GameClient Session, ClientMessage Event) { try { Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); uint uint_ = Event.PopWiredUInt(); RoomItem item = room.GetItem(uint_); string text = item.GetBaseItem().InteractionType.ToLower(); if (text != null && (text == "wf_cnd_trggrer_on_frn" || text == "wf_cnd_furnis_hv_avtrs" || text == "wf_cnd_has_furni_on")) { Event.PopWiredBoolean(); Event.PopFixedString(); item.Extra1 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2)); item.Extra1 = item.Extra1.Substring(0, item.Extra1.Length - 1); Event.ResetPointer(); item = room.GetItem(Event.PopWiredUInt()); Event.PopWiredBoolean(); Event.PopFixedString(); int num = Event.PopWiredInt32(); item.Extra2 = ""; for (int i = 0; i < num; i++) { item.Extra2 = item.Extra2 + "," + Convert.ToString(Event.PopWiredUInt()); } if (item.Extra2.Length > 0) { item.Extra2 = item.Extra2.Substring(1); } } } catch { } }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().HasRole("acc_supporttool")) { Event.PopWiredInt32(); int num = Event.PopWiredInt32(); string Msg = Event.PopFixedString(); string text2 = ""; if (num.Equals(3)) { text2 += "Room Cautioned."; } text2 = text2 + " Message: " + Msg; PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, "ModTool - Room Alert", text2); PhoenixEnvironment.GetGame().GetModerationTool().method_13(Session.GetHabbo().CurrentRoomId, !num.Equals(3), Msg); } }
public void parse(GameClient Session, ClientMessage Event) { Room Room = Session.GetHabbo().CurrentRoom; if (Room != null) { RoomUser @class = Room.GetRoomUserByHabbo(Session.GetHabbo().Id); if (@class != null && @class.CanWalk) { int num = Event.PopWiredInt32(); int num2 = Event.PopWiredInt32(); if (num != @class.X || num2 != @class.Y) { if (@class.Target != null) { try { if (@class.Target.IsBot) { @class.Unidle(); } @class.Target.MoveTo(num, num2); return; } catch { @class.Target = null; @class.Riding = null; @class.MoveTo(num, num2); Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, true); return; } } if (@class.TeleportMode) { @class.X = num; @class.Y = num2; @class.UpdateNeeded = true; } else { @class.MoveTo(num, num2); } } } } }
public void parse(GameClient Session, ClientMessage Event) { int PageId = Event.PopWiredInt32(); uint ItemId = Event.PopWiredUInt(); string ExtraData = Event.PopFixedString(); string GiftUser = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString()); string GiftMessage = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString()); PhoenixEnvironment.GetGame().GetCatalog().HandlePurchase(Session, PageId, ItemId, ExtraData, true, GiftUser, GiftMessage, true); }
public void parse(GameClient Session, ClientMessage Event) { Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && @class.CheckRights(Session)) { RoomItem class2 = @class.GetItem(Event.PopWiredUInt()); if (class2 != null) { int num = Event.PopWiredInt32(); int num2 = Event.PopWiredInt32(); int num3 = Event.PopWiredInt32(); Event.PopWiredInt32(); if (Session.GetHabbo().CurrentQuestId == 1u && (num != class2.GetX || num2 != class2.GetY)) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(1u, Session); } else { if (Session.GetHabbo().CurrentQuestId == 7u && num3 != class2.Rot) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(7u, Session); } else { if (Session.GetHabbo().CurrentQuestId == 9u && class2.GetZ >= 0.1) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(9u, Session); } } } bool flag = false; string text = class2.GetBaseItem().InteractionType.ToLower(); if (text != null && text == "teleport") { flag = true; } @class.method_79(Session, class2, num, num2, num3, false, false, false); if (flag) { @class.method_64(); } } } }
public void parse(GameClient Session, ClientMessage Event) { Session.GetHabbo().GetBadgeComponent().ResetSlots(); using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.ExecuteQuery("UPDATE user_badges SET badge_slot = '0' WHERE user_id = '" + Session.GetHabbo().Id + "'"); goto IL_131; } IL_52: int num = Event.PopWiredInt32(); string text = Event.PopFixedString(); if (text.Length != 0) { if (!Session.GetHabbo().GetBadgeComponent().HasBadge(text) || num < 1 || num > 5) { return; } if (Session.GetHabbo().CurrentQuestId == 16u) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(16u, Session); } Session.GetHabbo().GetBadgeComponent().GetBadge(text).Slot = num; using (DatabaseClient @class = PhoenixEnvironment.GetDatabase().GetClient()) { @class.AddParamWithValue("slotid", num); @class.AddParamWithValue("badge", text); @class.AddParamWithValue("userid", Session.GetHabbo().Id); @class.ExecuteQuery("UPDATE user_badges SET badge_slot = @slotid WHERE badge_id = @badge AND user_id = @userid LIMIT 1"); } } IL_131: if (Event.RemainingLength > 0) { goto IL_52; } ServerMessage Message = new ServerMessage(228u); Message.AppendUInt(Session.GetHabbo().Id); Message.AppendInt32(Session.GetHabbo().GetBadgeComponent().EquippedCount); foreach (Badge current in Session.GetHabbo().GetBadgeComponent().BadgeList) { if (current.Slot > 0) { Message.AppendInt32(current.Slot); Message.AppendStringWithBreak(current.Code); } } if (Session.GetHabbo().InRoom && PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId) != null) { PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).SendMessage(Message, null); } else { Session.SendMessage(Message); } }
public void parse(GameClient Session, ClientMessage Event) { uint num = Event.PopWiredUInt(); string string_ = Event.PopFixedString(); Event.PopWiredInt32(); if (PhoenixEnvironment.GetConfig().data["emu.messages.roommgr"] == "1") { Logging.WriteLine("[RoomMgr] Requesting Private Room [ID: " + num + "]"); } Session.GetMessageHandler().PrepareRoomForUser(num, string_); }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().GetMessenger() != null) { int num = Event.PopWiredInt32(); int num2 = Event.PopWiredInt32(); if (num == 0 && num2 == 1) { uint uint_ = Event.PopWiredUInt(); Session.GetHabbo().GetMessenger().HandleRequest(uint_); } else { if (num == 1) { Session.GetHabbo().GetMessenger().HandleAllRequests(); } } } }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().HasRole("acc_supporttool")) { uint UserId = Event.PopWiredUInt(); string Message = Event.PopFixedString(); int Length = Event.PopWiredInt32() * 3600; PhoenixEnvironment.GetGame().GetModerationTool().BanUser(Session, UserId, Length, Message); } }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().GetMessenger() != null) { int num = Event.PopWiredInt32(); for (int i = 0; i < num; i++) { Session.GetHabbo().GetMessenger().method_13(Event.PopWiredUInt()); } } }
public void parse(GameClient Session, ClientMessage Event) { bool errorOccured = false; if (PhoenixEnvironment.GetGame().GetModerationTool().UsersHasPendingTicket(Session.GetHabbo().Id)) { errorOccured = true; } if (!errorOccured) { string message = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString()); Event.PopWiredInt32(); int Type = Event.PopWiredInt32(); uint ReportedUser = Event.PopWiredUInt(); PhoenixEnvironment.GetGame().GetModerationTool().SendNewTicket(Session, Type, ReportedUser, message); } ServerMessage Message = new ServerMessage(321); Message.AppendBoolean(errorOccured); Session.SendMessage(Message); }
public void parse(GameClient Session, ClientMessage Event) { Room Room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (Room != null && Room.CheckRights(Session, true) && Room.Event != null) { int Category = Event.PopWiredInt32(); string Name = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString()); string Description = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString()); int Id = Event.PopWiredInt32(); Room.Event.Category = Category; Room.Event.Name = Name; Room.Event.Description = Description; Room.Event.Tags = new List<string>(); for (int i = 0; i < Id; i++) { Room.Event.Tags.Add(PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString())); } Room.SendMessage(Room.Event.Serialize(Session), null); } }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().HasRole("acc_supporttool")) { int num = Event.PopWiredInt32(); for (int i = 0; i < num; i++) { uint TicketId = Event.PopWiredUInt(); PhoenixEnvironment.GetGame().GetModerationTool().ReleaseTicket(Session, TicketId); } } }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().HasRole("acc_chatlogs")) { Event.PopWiredInt32(); uint roomID = Event.PopWiredUInt(); if (PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(roomID) != null) { Session.SendMessage(PhoenixEnvironment.GetGame().GetModerationTool().SerializeRoomChatlog(roomID)); } } }
public void parse(GameClient Session, ClientMessage Event) { Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && @class.CheckRights(Session, true)) { RoomUser class2 = @class.GetRoomUserByVirtualId(Event.PopWiredInt32()); if (class2 != null && class2.IsBot) { @class.RemoveBot(class2.VirtualId, true); } } }
public void parse(GameClient Session, ClientMessage Event) { int int_ = Event.PopWiredInt32(); int Sprite = Event.PopWiredInt32(); ServerMessage Message = new ServerMessage(617); Message.AppendInt32(1); Message.AppendInt32(PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().OfferCountForSprite(Sprite)); Dictionary<int, DataRow> dictionary = new Dictionary<int, DataRow>(); DataTable Table = null; using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { Table = adapter.ReadDataTable("SELECT * FROM catalog_marketplace_data WHERE daysago > -30 AND sprite = " + Sprite + " LIMIT 30;"); } if (Table != null) { foreach (DataRow dataRow in Table.Rows) { dictionary.Add(Convert.ToInt32(dataRow["daysago"]), dataRow); } } Message.AppendInt32(30); Message.AppendInt32(29); for (int i = -29; i < 0; i++) { Message.AppendInt32(i); if (dictionary.ContainsKey(i + 1)) { Message.AppendInt32(Convert.ToInt32(dictionary[i + 1]["avgprice"]) / Convert.ToInt32(dictionary[i + 1]["sold"])); Message.AppendInt32(Convert.ToInt32(dictionary[i + 1]["sold"])); } else { Message.AppendInt32(0); Message.AppendInt32(0); } } Message.AppendInt32(int_); Message.AppendInt32(Sprite); Session.SendMessage(Message); }
public void parse(GameClient Session, ClientMessage Event) { try { Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && @class.CheckRights(Session, true) && @class.MoodlightData != null) { RoomItem class2 = null; foreach (RoomItem class3 in @class.Hashtable_1.Values) { if (class3.GetBaseItem().InteractionType.ToLower() == "dimmer") { class2 = class3; break; } } if (class2 != null) { int num = Event.PopWiredInt32(); int num2 = Event.PopWiredInt32(); string string_ = Event.PopFixedString(); int int_ = Event.PopWiredInt32(); bool bool_ = false; if (num2 >= 2) { bool_ = true; } @class.MoodlightData.Enabled = true; @class.MoodlightData.CurrentPreset = num; @class.MoodlightData.method_2(num, string_, int_, bool_); class2.ExtraData = @class.MoodlightData.method_7(); class2.UpdateState(); } } } catch { } }
public void parse(GameClient Session, ClientMessage Event) { try { Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (room != null) { RoomItem item = room.GetItem(Event.PopWiredUInt()); if (item != null) { bool userHasRights = false; if (room.CheckRights(Session)) { userHasRights = true; } item.Interactor.OnTrigger(Session, item, Event.PopWiredInt32(), userHasRights); if (Session.GetHabbo().CurrentQuestId == 12) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(12, Session); } else if (Session.GetHabbo().CurrentQuestId == 18 && item.GetBaseItem().Name == "bw_lgchair") { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(18, Session); } else if (Session.GetHabbo().CurrentQuestId == 20 && item.GetBaseItem().Name.Contains("bw_sboard")) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(20, Session); } else if (Session.GetHabbo().CurrentQuestId == 21 && item.GetBaseItem().Name.Contains("bw_van")) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(21, Session); } else if (Session.GetHabbo().CurrentQuestId == 22 && item.GetBaseItem().Name.Contains("party_floor")) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(22, Session); } else if (Session.GetHabbo().CurrentQuestId == 23 && item.GetBaseItem().Name.Contains("party_ball")) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(23, Session); } else if (Session.GetHabbo().CurrentQuestId == 24 && item.GetBaseItem().Name.Contains("jukebox")) { PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(24, Session); } } } } catch { } }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().GetInventoryComponent() != null) { if (Session.GetHabbo().InRoom) { Room Room = Session.GetHabbo().CurrentRoom; RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id); if (User.IsTrading) { return; } } int SellingPrice = Event.PopWiredInt32(); Event.PopWiredInt32(); uint ItemId = Event.PopWiredUInt(); UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId); if (Item != null && Item.GetBaseItem().AllowTrade) { PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().SellItem(Session, Item.Id, SellingPrice); } } }
public void parse(GameClient Session, ClientMessage Event) { Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (room != null) { RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id); if (roomUserByHabbo != null) { roomUserByHabbo.Unidle(); int num = Event.PopWiredInt32(); int num2 = Event.PopWiredInt32(); if (num != roomUserByHabbo.X || num2 != roomUserByHabbo.Y) { int rotation = Rotation.Calculate(roomUserByHabbo.X, roomUserByHabbo.Y, num, num2); roomUserByHabbo.SetRot(rotation); if (roomUserByHabbo.Riding != null && roomUserByHabbo.Target != null) { roomUserByHabbo.Target.SetRot(rotation); } } } } }
public void parse(GameClient Session, ClientMessage Event) { Room Room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (Room != null && Room.CheckRights(Session, true)) { Event.PopWiredInt32(); Dictionary<int, int> Items = new Dictionary<int, int>(); int BackgroundImage = Event.PopWiredInt32(); int ForegroundImage = Event.PopWiredInt32(); int num3 = Event.PopWiredInt32(); for (int i = 0; i < num3; i++) { int num4 = Event.PopWiredInt32(); int num5 = Event.PopWiredInt32(); if (num4 < 0 || num4 > 10 || (num5 < 1 || num5 > 27) || Items.ContainsKey(num4)) { return; } Items.Add(num4, num5); } if (BackgroundImage >= 1 && BackgroundImage <= 24 && (ForegroundImage >= 0 && ForegroundImage <= 11)) { StringBuilder stringBuilder = new StringBuilder(); int num6 = 0; foreach (KeyValuePair<int, int> Item in Items) { if (num6 > 0) { stringBuilder.Append("|"); } stringBuilder.Append(Item.Key + "," + Item.Value); num6++; } using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.ExecuteQuery("UPDATE rooms SET icon_bg = '" + BackgroundImage + "', icon_fg = '" + ForegroundImage + "', icon_items = '" + stringBuilder.ToString() + "' WHERE Id = '" + Room.RoomId + "' LIMIT 1"); } Room.myIcon = new RoomIcon(BackgroundImage, ForegroundImage, Items); ServerMessage Message = new ServerMessage(457); Message.AppendUInt(Room.RoomId); Message.AppendBoolean(true); Session.SendMessage(Message); ServerMessage Message2 = new ServerMessage(456); Message2.AppendUInt(Room.RoomId); Session.SendMessage(Message2); RoomData Data = Room.RoomData; ServerMessage Message3 = new ServerMessage(454); Message3.AppendBoolean(false); Data.Serialize(Message3, false, false); Session.SendMessage(Message3); } } }
public void parse(GameClient session, ClientMessage message) { int id = message.PopWiredInt32(); int userid = message.PopWiredInt32(); if (id <= 0 || userid <= 0) return; using (DatabaseClient dbclient = PhoenixEnvironment.GetDatabase().GetClient()) { DataRow datarow = dbclient.ReadDataRow("SELECT id FROM friend_stream_likes WHERE friend_stream_id = '" + id + "' AND userid = '" + userid + "' LIMIT 1"); if (datarow == null) { dbclient.AddParamWithValue("fsi", id); dbclient.AddParamWithValue("userid", userid); dbclient.ExecuteQuery("INSERT INTO friend_stream_likes (friend_stream_id, userid) VALUES (@fsi, @userid)"); } else { session.SendNotif("You cant like twice!"); } } }