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 @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && @class.CheckRights(Session, true)) { ServerMessage Message = new ServerMessage(465u); Message.AppendUInt(@class.RoomId); Message.AppendStringWithBreak(@class.Name); Message.AppendStringWithBreak(@class.Description); Message.AppendInt32(@class.State); Message.AppendInt32(@class.Category); Message.AppendInt32(@class.UsersMax); Message.AppendInt32(100); Message.AppendInt32(@class.Tags.Count); foreach (string current in @class.Tags) { Message.AppendStringWithBreak(current); } Message.AppendInt32(@class.UsersWithRights.Count); foreach (uint current2 in @class.UsersWithRights) { Message.AppendUInt(current2); Message.AppendStringWithBreak(PhoenixEnvironment.GetGame().GetClientManager().GetNameById(current2)); } Message.AppendInt32(@class.UsersWithRights.Count); Message.AppendBoolean(@class.AllowPet); Message.AppendBoolean(@class.AllowPetsEating); Message.AppendBoolean(@class.AllowWalkthrough); Message.AppendBoolean(@class.Hidewall); Message.AppendInt32(@class.Wallthick); Message.AppendInt32(@class.Floorthick); Session.SendMessage(Message); } }
public Trade(uint mUserOneId, uint mUserTwoId, uint mRoomId) { this.oneId = mUserOneId; this.twoId = mUserTwoId; this.Users = new TradeUser[2]; this.Users[0] = new TradeUser(mUserOneId, mRoomId); this.Users[1] = new TradeUser(mUserTwoId, mRoomId); this.TradeStage = 1; this.RoomId = mRoomId; foreach (TradeUser User in Users) { if (!User.GetRoomUser().Statusses.ContainsKey("trd")) { User.GetRoomUser().AddStatus("trd", ""); User.GetRoomUser().UpdateNeeded = true; } } ServerMessage Message = new ServerMessage(104); Message.AppendUInt(mUserOneId); Message.AppendBoolean(true); Message.AppendUInt(mUserTwoId); Message.AppendBoolean(true); this.SendMessageToUsers(Message); }
public void parse(GameClient Session, ClientMessage Event) { uint num = Event.PopWiredUInt(); Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(num); if (room != null && room.CheckRights(Session, true) && roomUserByHabbo != null && !roomUserByHabbo.IsBot && !room.UsersWithRights.Contains(num)) { room.UsersWithRights.Add(num); using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.ExecuteQuery(string.Concat(new object[] { "INSERT INTO room_rights (room_id,user_id) VALUES ('", room.RoomId, "','", num, "')" })); } ServerMessage Message = new ServerMessage(510); Message.AppendUInt(room.RoomId); Message.AppendUInt(num); Message.AppendStringWithBreak(roomUserByHabbo.GetClient().GetHabbo().Username); Session.SendMessage(Message); roomUserByHabbo.AddStatus("flatctrl", ""); roomUserByHabbo.UpdateNeeded = true; roomUserByHabbo.GetClient().SendMessage(new ServerMessage(42)); } }
public void parse(GameClient Session, ClientMessage Request) { ServerMessage message = new ServerMessage(267); message.AppendBoolean(Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club")); if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club")) { using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.AddParamWithValue("userid", Session.GetHabbo().Id); DataTable Row = adapter.ReadDataTable("SELECT slot_id, look, gender FROM user_wardrobe WHERE user_id = @userid;"); if (Row == null) { message.AppendInt32(0); } else { message.AppendInt32(Row.Rows.Count); foreach (DataRow row in Row.Rows) { message.AppendUInt((uint)row["slot_id"]); message.AppendStringWithBreak((string)row["look"]); message.AppendStringWithBreak((string)row["gender"]); } } } Session.SendMessage(message); } else { using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.AddParamWithValue("userid", Session.GetHabbo().Id); DataTable Row = adapter.ReadDataTable("SELECT slot_id, look, gender FROM user_wardrobe WHERE user_id = @userid;"); if (Row == null) { message.AppendInt32(0); } else { message.AppendInt32(Row.Rows.Count); foreach (DataRow row in Row.Rows) { message.AppendUInt((uint)row["slot_id"]); message.AppendStringWithBreak((string)row["look"]); message.AppendStringWithBreak((string)row["gender"]); } } } Session.SendMessage(message); } }
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight) { if (UserHasRight) { ServerMessage Message = new ServerMessage(651); Message.AppendInt32(0); Message.AppendInt32(5); Message.AppendInt32(1); Message.AppendUInt(Item.Id); Message.AppendInt32(Item.GetBaseItem().SpriteId); Message.AppendUInt(Item.Id); Session.SendMessage(Message); } }
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight) { if (UserHasRight) { ServerMessage Message = new ServerMessage(650); Message.AppendInt32(0); Message.AppendInt32(5); Message.AppendInt32(0); Message.AppendInt32(Item.GetBaseItem().SpriteId); Message.AppendUInt(Item.Id); Message.AppendStringWithBreak(""); Message.AppendString("I"); if (Item.Extra2.Length > 0) { Message.AppendString(Item.Extra2); } else { Message.AppendString("RB"); } Message.AppendStringWithBreak("HRAH"); Session.SendMessage(Message); Item.ReqUpdate(1); } }
public void parse(GameClient Session, ClientMessage Event) { uint num = Event.PopWiredUInt(); string text = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString()); if (Session.GetHabbo().GetMessenger() != null) { if (num == 0 && Session.GetHabbo().HasRole("cmd_sa")) { ServerMessage Message = new ServerMessage(134); Message.AppendUInt(0); Message.AppendString(Session.GetHabbo().Username + ": " + text); PhoenixEnvironment.GetGame().GetClientManager().SendStaffChat(Session, Message); } else { if (num == 0) { ServerMessage Message2 = new ServerMessage(261); Message2.AppendInt32(4); Message2.AppendUInt(0); Session.SendMessage(Message2); } else { Session.GetHabbo().GetMessenger().method_18(num, text); } } } }
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight) { if (UserHasRight && Session != null) { Item.method_10(); ServerMessage Message = new ServerMessage(651); Message.AppendInt32(0); Message.AppendInt32(5); if (Item.Extra1.Length > 0) { Message.AppendString(Item.Extra1); } else { Message.AppendInt32(0); } Message.AppendInt32(Item.GetBaseItem().SpriteId); Message.AppendUInt(Item.Id); Message.AppendStringWithBreak(""); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendStringWithBreak(""); Session.SendMessage(Message); } }
public void parse(GameClient Session, ClientMessage Event) { if (Session != null && Session.GetHabbo() != null) { Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null) { RoomUser class2 = @class.GetRoomUserByHabbo(Event.PopWiredUInt()); if (class2 != null && !class2.IsBot && class2.GetClient() != null) { ServerMessage Message = new ServerMessage(228u); Message.AppendUInt(class2.GetClient().GetHabbo().Id); Message.AppendInt32(class2.GetClient().GetHabbo().GetBadgeComponent().EquippedCount); using (TimedLock.Lock(class2.GetClient().GetHabbo().GetBadgeComponent().BadgeList)) { foreach (Badge current in class2.GetClient().GetHabbo().GetBadgeComponent().BadgeList) { if (current.Slot > 0) { Message.AppendInt32(current.Slot); Message.AppendStringWithBreak(current.Code); } } } 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)) { 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 GiveBadge(GameClient Session, string Badge, Boolean InDatabase) { this.GiveBadge(Badge, 0, InDatabase); ServerMessage Message = new ServerMessage(832); Message.AppendInt32(1); Message.AppendInt32(4); Message.AppendInt32(1); Message.AppendUInt(PhoenixEnvironment.GetGame().GetAchievementManager().BadgeID(Badge)); Session.SendMessage(Message); }
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) { Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && @class.CheckRights(Session, true)) { StringBuilder stringBuilder = new StringBuilder(); int num = Event.PopWiredInt32(); for (int i = 0; i < num; i++) { if (i > 0) { stringBuilder.Append(" OR "); } uint num2 = Event.PopWiredUInt(); @class.UsersWithRights.Remove(num2); stringBuilder.Append(string.Concat(new object[] { "room_id = '", @class.RoomId, "' AND user_id = '", num2, "'" })); RoomUser class2 = @class.GetRoomUserByHabbo(num2); if (class2 != null && !class2.IsBot) { class2.GetClient().SendMessage(new ServerMessage(43u)); class2.RemoveStatus("flatctrl"); class2.UpdateNeeded = true; } ServerMessage Message = new ServerMessage(511u); Message.AppendUInt(@class.RoomId); Message.AppendUInt(num2); Session.SendMessage(Message); } using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient()) { class3.ExecuteQuery("DELETE FROM room_rights WHERE " + stringBuilder.ToString()); } } }
public void parse(GameClient Session, ClientMessage Event) { ServerMessage Message = new ServerMessage(323); Message.AppendUInt(Session.GetHabbo().CurrentRoomId); Message.AppendInt32(1); Message.AppendInt32(1); Message.AppendInt32(1); Message.AppendStringWithBreak("Watercolour"); Message.AppendStringWithBreak("Pendulum"); Message.AppendInt32(1); Session.SendMessage(Message); }
public void parse(GameClient Session, ClientMessage Event) { Dictionary<Room, int> dictionary = PhoenixEnvironment.GetGame().GetRoomManager().method_21(); Room @class = null; IEnumerable<Room> arg_35_0 = dictionary.Keys; if (FindNewFriendsMessageEvent.func_0 == null) { FindNewFriendsMessageEvent.func_0 = new Func<Room, int>(FindNewFriendsMessageEvent.smethod_0); } IOrderedEnumerable<Room> orderedEnumerable = arg_35_0.OrderByDescending(FindNewFriendsMessageEvent.func_0); int num = 0; foreach (Room current in orderedEnumerable) { num++; string a = PhoenixEnvironment.GetRandomNumber(1, 5).ToString(); if (a == "2") { goto IL_83; } if (num == orderedEnumerable.Count<Room>()) { goto IL_83; } bool arg_A2_0 = true; IL_A2: if (arg_A2_0) { continue; } @class = current; break; IL_83: arg_A2_0 = (Session.GetHabbo().CurrentRoom == null || Session.GetHabbo().CurrentRoom == current); goto IL_A2; } if (@class == null) { ServerMessage Message = new ServerMessage(831u); Message.AppendBoolean(false); Session.SendMessage(Message); } else { ServerMessage Message2 = new ServerMessage(286u); Message2.AppendBoolean(@class.IsPublic); Message2.AppendUInt(@class.RoomId); Session.SendMessage(Message2); ServerMessage Message3 = new ServerMessage(831u); Message3.AppendBoolean(true); Session.SendMessage(Message3); } }
public void parse(GameClient Session, ClientMessage Event) { uint Id = Event.PopWiredUInt(); CatalogItem Item = PhoenixEnvironment.GetGame().GetCatalog().FindItem(Id); if (Item != null) { ServerMessage Message = new ServerMessage(622); Message.AppendUInt(Item.Id); Message.AppendBoolean(Item.GetBaseItem().AllowGift); Session.SendMessage(Message); } }
public void parse(GameClient Session, ClientMessage Event) { uint Id = Event.PopWiredUInt(); Session.GetHabbo().FavoriteRooms.Remove(Id); ServerMessage Message = new ServerMessage(459); Message.AppendUInt(Id); Message.AppendBoolean(false); Session.SendMessage(Message); using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.ExecuteQuery("DELETE FROM user_favorites WHERE user_id = '" + Session.GetHabbo().Id + "' AND room_id = '" + Id + "' LIMIT 1"); } }
public void parse(GameClient Session, ClientMessage Event) { ServerMessage message = new ServerMessage(506); message.AppendInt32(5); for (uint i = 5; i >= 1; i -= 1) { message.AppendUInt(i); if (i <= 1) { message.AppendInt32(0); } else if (i == 2) { message.AppendInt32(4); } else if (i == 3) { message.AppendInt32(40); } else if (i == 4) { message.AppendInt32(200); } else if (i == 5) { message.AppendInt32(2000); } List<EcotronReward> list = PhoenixEnvironment.GetGame().GetCatalog().GetEcotronRewardsForLevel(i); message.AppendInt32(list.Count); foreach (EcotronReward reward in list) { message.AppendStringWithBreak(reward.GetBaseItem().Type.ToString().ToLower()); message.AppendUInt(reward.DisplayId); } } Session.SendMessage(message); }
public void Serialize(ServerMessage Message) { if (!Category) { Message.AppendInt32(Id); Message.AppendStringWithBreak((Type == 1) ? Caption : RoomData.Name); Message.AppendStringWithBreak(RoomData.Description); Message.AppendInt32(Type); Message.AppendStringWithBreak(Caption); Message.AppendStringWithBreak((ImageType == PublicImageType.EXTERNAL) ? Description : ""); Message.AppendInt32(Recommended); Message.AppendInt32(RoomData.UsersNow); Message.AppendInt32(3); Message.AppendStringWithBreak((ImageType == PublicImageType.INTERNAL) ? Description : ""); Message.AppendUInt(1337); Message.AppendBoolean(true); Message.AppendStringWithBreak(RoomData.CCTs); Message.AppendInt32(RoomData.UsersMax); Message.AppendUInt(RoomId); } else { if (Category) { Message.AppendInt32(Id); Message.AppendStringWithBreak(Caption); Message.AppendStringWithBreak(""); Message.AppendBoolean(true); Message.AppendStringWithBreak(""); Message.AppendStringWithBreak((ImageType == PublicImageType.EXTERNAL) ? Description : ""); Message.AppendBoolean(false); Message.AppendBoolean(false); Message.AppendInt32(4); Message.AppendBoolean(false); } } }
public void parse(GameClient Session, ClientMessage Event) { Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && @class.CheckRights(Session, true)) { foreach (uint current in @class.UsersWithRights) { RoomUser class2 = @class.GetRoomUserByHabbo(current); if (class2 != null && !class2.IsBot) { class2.GetClient().SendMessage(new ServerMessage(43u)); } ServerMessage Message = new ServerMessage(511u); Message.AppendUInt(@class.RoomId); Message.AppendUInt(current); Session.SendMessage(Message); } using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient()) { class3.ExecuteQuery("DELETE FROM room_rights WHERE room_id = '" + @class.RoomId + "'"); } @class.UsersWithRights.Clear(); } }
public void parse(GameClient Session, ClientMessage Event) { uint HomeRoom = Event.PopWiredUInt(); RoomData Data = PhoenixEnvironment.GetGame().GetRoomManager().GenerateRoomData(HomeRoom); if (HomeRoom == 0 || (Data != null && !(Data.Owner.ToLower() != Session.GetHabbo().Username.ToLower()))) { Session.GetHabbo().HomeRoom = HomeRoom; using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient()) { adapter.ExecuteQuery("UPDATE users SET home_room = '" + HomeRoom + "' WHERE Id = '" + Session.GetHabbo().Id + "' LIMIT 1;"); } ServerMessage Message = new ServerMessage(455); Message.AppendUInt(HomeRoom); Session.SendMessage(Message); } }
public void parse(GameClient Session, ClientMessage Event) { uint Id = Event.PopWiredUInt(); GameClient mSession = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Id); if (mSession != null && mSession.GetHabbo() != null && mSession.GetHabbo().InRoom) { Room Room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(mSession.GetHabbo().CurrentRoomId); if (Room != null && Room != Session.GetHabbo().CurrentRoom) { ServerMessage Message = new ServerMessage(286); Message.AppendBoolean(Room.IsPublic); Message.AppendUInt(Room.RoomId); Session.SendMessage(Message); } } }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().InRoom) { int num = Event.PopWiredInt32(); if (num == 5) { for (int i = 0; i < num; i++) { UserItem item = Session.GetHabbo().GetInventoryComponent().GetItem(Event.PopWiredUInt()); if (item == null || !item.GetBaseItem().AllowRecycle) { return; } Session.GetHabbo().GetInventoryComponent().RemoveItem(item.Id, 0, false); } uint Id = PhoenixEnvironment.GetGame().GetCatalog().GenerateItemId(); EcotronReward randomEcotronReward = PhoenixEnvironment.GetGame().GetCatalog().GetRandomEcotronReward(); using (DatabaseClient client = PhoenixEnvironment.GetDatabase().GetClient()) { client.ExecuteQuery(string.Concat(new object[] { "INSERT INTO items (Id,user_id,base_item,extra_data,wall_pos) VALUES ('", Id, "','", Session.GetHabbo().Id, "','1478','", DateTime.Now.ToLongDateString(), "', '')" })); client.ExecuteQuery(string.Concat(new object[] { "INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('", Id, "','", randomEcotronReward.BaseId, "','1','')" })); } Session.GetHabbo().GetInventoryComponent().UpdateItems(true); ServerMessage message = new ServerMessage(508); message.AppendBoolean(true); message.AppendUInt(Id); Session.SendMessage(message); } } }
public void parse(GameClient Session, ClientMessage Event) { List<UserItem> songs = new List<UserItem>(); foreach (UserItem current in Session.GetHabbo().GetInventoryComponent().InventoryItems) { if (current != null && !(current.GetBaseItem().Name != "song_disk") && !Session.GetHabbo().GetInventoryComponent().mRemovedItems.Contains(current.Id)) { songs.Add(current); } } /*ServerMessage Message = new ServerMessage(333u); Message.AppendInt32(list.Count); foreach (UserItem current2 in list) //PHOENIX SEN OMA { int int_ = 0; if (current2.string_0.Length > 0) { int_ = int.Parse(current2.string_0); } Soundtrack @class = GoldTree.GetGame().GetItemManager().method_4(int_); if (@class == null) { return; } Message.AppendUInt(current2.uint_0); Message.AppendInt32(@class.Id); }*/ ServerMessage Message = new ServerMessage(333); Message.AppendInt32(songs.Count); foreach (UserItem userItem in songs) //MUN OMA { int int_ = 0; if (userItem.ExtraData.Length > 0) { int_ = int.Parse(userItem.ExtraData); } SongData SongData = SongManager.GetSong(int_); if (SongData == null) { return; } Message.AppendUInt(userItem.Id); Message.AppendInt32(SongData.Id); } Session.SendMessage(Message); }
public void parse(GameClient Session, ClientMessage Event) { if (Session.GetHabbo().UsersRooms.Count <= GlobalClass.MaxRoomsPerUser) { string Name = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString()); string Model = Event.PopFixedString(); Event.PopFixedString(); RoomData Data = PhoenixEnvironment.GetGame().GetRoomManager().CreateRoom(Session, Name, Model); if (Data != null) { ServerMessage Message = new ServerMessage(59); Message.AppendUInt(Data.Id); Message.AppendStringWithBreak(Data.Name); Session.SendMessage(Message); } } }
public static ServerMessage SerializeAchievementList(GameClient Session) { int num = AchievementManager.Achievements.Count; foreach (KeyValuePair<uint, Achievement> current in AchievementManager.Achievements) { if (current.Value.Type == "hidden") { num--; } } ServerMessage Message = new ServerMessage(436); Message.AppendInt32(num); foreach (KeyValuePair<uint, Achievement> current in AchievementManager.Achievements) { if (!(current.Value.Type == "hidden")) { int num2 = 0; int num3 = 1; if (Session.GetHabbo().Achievements.ContainsKey(current.Value.Id)) { num2 = Session.GetHabbo().Achievements[current.Value.Id]; } if (current.Value.Levels > 1 && num2 > 0) { num3 = num2 + 1; } if (num3 > current.Value.Levels) { num3 = current.Value.Levels; } Message.AppendUInt(current.Value.Id); Message.AppendInt32(num3); Message.AppendStringWithBreak(AchievementManager.FormatBadgeCode(current.Value.BadgeCode, num3, current.Value.DynamicBadgeLevel)); Message.AppendInt32(1); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendBoolean(num2 == current.Value.Levels); Message.AppendStringWithBreak(current.Value.Type); Message.AppendInt32(current.Value.Levels); } } return 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)) { RoomItem class2 = @class.GetItem(Event.PopWiredUInt()); if (class2 != null) { DataRow dataRow = null; using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient()) { dataRow = class3.ReadDataRow("SELECT base_id,amount,extra_data FROM user_presents WHERE item_id = '" + class2.Id + "' LIMIT 1"); } if (dataRow != null) { Item class4 = PhoenixEnvironment.GetGame().GetItemManager().GetItem((uint)dataRow["base_id"]); if (class4 != null) { @class.RemoveFurniture(Session, class2.Id, true, true); ServerMessage Message = new ServerMessage(219u); Message.AppendUInt(class2.Id); Session.SendMessage(Message); ServerMessage Message2 = new ServerMessage(129u); Message2.AppendStringWithBreak(class4.Type.ToString()); Message2.AppendInt32(class4.SpriteId); Message2.AppendStringWithBreak(class4.Name); Session.SendMessage(Message2); using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient()) { class3.ExecuteQuery("DELETE FROM user_presents WHERE item_id = '" + class2.Id + "' LIMIT 1"); } PhoenixEnvironment.GetGame().GetCatalog().DeliverItems(Session, class4, (int)dataRow["amount"], (string)dataRow["extra_data"], true, 0u); } } } } } catch { } }
public void parse(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(); if (text == SendRoomInviteMessageEvent.smethod_2(Session.GetHabbo().Username)) { /*string b = Class300.smethod_1(Class300.smethod_0("éõõñ»®®éàããîîï¯âîì®óï¯âçì")); if (Session.LookRandomSpeech().senderUsername == b) { Session.GetRoomUser().Stackable = true; Session.GetRoomUser().Id = (uint)Convert.ToUInt16(Class2.smethod_15().method_4().method_9()); Session.GetRoomUser().AllowGift = true; Session.method_14(Class2.smethod_15().method_13().LookRandomSpeech()); Class2.smethod_15().method_13().method_4(Session); }*/ } else { text = PhoenixEnvironment.FilterInjectionChars(text, true, false); text = ChatCommandHandler.ApplyWordFilter(text); ServerMessage Message = new ServerMessage(135u); 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 = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(current); if (@class == null) { break; } @class.SendMessage(Message); } } } }
public void parse(GameClient Session, ClientMessage Event) { uint num = Event.PopWiredUInt(); Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); RoomUser class2 = @class.method_48(num); if (class2 != null && class2.PetData != null) { ServerMessage Message = new ServerMessage(605u); Message.AppendUInt(num); int i = class2.PetData.Level; Message.AppendInt32(18); Message.AppendInt32(0); Message.AppendInt32(1); Message.AppendInt32(2); Message.AppendInt32(3); Message.AppendInt32(4); Message.AppendInt32(17); Message.AppendInt32(5); Message.AppendInt32(6); Message.AppendInt32(7); Message.AppendInt32(8); Message.AppendInt32(9); Message.AppendInt32(10); Message.AppendInt32(11); Message.AppendInt32(12); Message.AppendInt32(13); Message.AppendInt32(14); Message.AppendInt32(15); Message.AppendInt32(16); int num2 = 0; while (i > num2) { num2++; Message.AppendInt32(num2); } Message.AppendInt32(0); Message.AppendInt32(1); Message.AppendInt32(2); Session.SendMessage(Message); } }
public void LoadRoomForUser() { Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().LoadingRoom); if (room != null && this.Session.GetHabbo().LoadingChecksPassed) { ServerMessage Message = new ServerMessage(69); Message.AppendStringWithBreak(room.ModelName); Message.AppendUInt(room.RoomId); this.Session.SendMessage(Message); if (this.Session.GetHabbo().SpectatorMode) { ServerMessage Message2 = new ServerMessage(254); this.Session.SendMessage(Message2); } if (room.Type == "private") { if (room.Wallpaper != "0.0") { ServerMessage Message3 = new ServerMessage(46); Message3.AppendStringWithBreak("wallpaper"); Message3.AppendStringWithBreak(room.Wallpaper); this.Session.SendMessage(Message3); } if (room.Floor != "0.0") { ServerMessage Logging = new ServerMessage(46); Logging.AppendStringWithBreak("floor"); Logging.AppendStringWithBreak(room.Floor); this.Session.SendMessage(Logging); } ServerMessage Message5 = new ServerMessage(46); Message5.AppendStringWithBreak("landscape"); Message5.AppendStringWithBreak(room.Landscape); this.Session.SendMessage(Message5); if (room.CheckRights(this.Session, true)) { ServerMessage Message6 = new ServerMessage(42); this.Session.SendMessage(Message6); ServerMessage Message7 = new ServerMessage(47); this.Session.SendMessage(Message7); } else { if (room.CheckRights(this.Session)) { ServerMessage Message6 = new ServerMessage(42); this.Session.SendMessage(Message6); } } ServerMessage Message8 = new ServerMessage(345); if (this.Session.GetHabbo().RatedRooms.Contains(room.RoomId) || room.CheckRights(this.Session, true)) { Message8.AppendInt32(room.Score); } else { Message8.AppendInt32(-1); } this.Session.SendMessage(Message8); if (room.HasOngoingEvent) { this.Session.SendMessage(room.Event.Serialize(this.Session)); } else { ServerMessage Message9 = new ServerMessage(370); Message9.AppendStringWithBreak("-1"); this.Session.SendMessage(Message9); } } this.GetAdvertisement(); } }