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)
					{
						if (@class.MoodlightData.Enabled)
						{
							@class.MoodlightData.method_1();
						}
						else
						{
							@class.MoodlightData.method_0();
						}
						class2.ExtraData = @class.MoodlightData.method_7();
						class2.UpdateState();
					}
				}
			}
			catch
			{
			}
		}
Ejemplo n.º 2
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			ServerMessage Message = new ServerMessage(308);
			Message.AppendInt32(Session.GetHabbo().Volume);
			Message.AppendBoolean(false);
			Session.SendMessage(Message);
		}
Ejemplo n.º 3
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			uint num = Event.PopWiredUInt();
			Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && [email protected])
			{
				RoomUser class2 = @class.method_48(num);
				if (class2 == null || class2.PetData == null)
				{
					DataRow dataRow = null;
					using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
					{
						class3.AddParamWithValue("petid", num);
						dataRow = class3.ReadDataRow("SELECT Id, user_id, room_id, name, type, race, color, expirience, energy, nutrition, respect, createstamp, x, y, z FROM user_pets WHERE Id = @petid LIMIT 1");
					}
					if (dataRow != null)
					{
						Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GeneratePetFromRow(dataRow).SerializeInfo());
					}
				}
				else
				{
					Session.SendMessage(class2.PetData.SerializeInfo());
				}
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			string text = Event.PopFixedString();
			ServerMessage Message = new ServerMessage(7u);
			Message.AppendStringWithBreak(text.ToLower());
			if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip"))
			{
				double num = (double)Session.GetHabbo().GetSubscriptionManager().GetSubscription("habbo_vip").ExpireTime;
				double num2 = num - PhoenixEnvironment.GetUnixTimestamp();
				int num3 = (int)Math.Ceiling(num2 / 86400.0);
				int num4 = num3 / 31;
				if (num4 >= 1)
				{
					num4--;
				}
				Message.AppendInt32(num3 - num4 * 31);
				Message.AppendBoolean(true);
				Message.AppendInt32(num4);
				Message.AppendBoolean(true);
				Message.AppendBoolean(true);
				Message.AppendBoolean(Session.GetHabbo().Vip);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
			}
			else
			{
				if (Session.GetHabbo().GetSubscriptionManager().HasSubscription(text))
				{
					double num = (double)Session.GetHabbo().GetSubscriptionManager().GetSubscription(text).ExpireTime;
					double num2 = num - PhoenixEnvironment.GetUnixTimestamp();
					int num3 = (int)Math.Ceiling(num2 / 86400.0);
					int num4 = num3 / 31;
					if (num4 >= 1)
					{
						num4--;
					}
					Message.AppendInt32(num3 - num4 * 31);
					Message.AppendBoolean(true);
					Message.AppendInt32(num4);
					if (Session.GetHabbo().Rank >= 2u)
					{
						Message.AppendInt32(1);
						Message.AppendInt32(1);
						Message.AppendInt32(2);
					}
					else
					{
						Message.AppendInt32(1);
					}
				}
				else
				{
					for (int i = 0; i < 3; i++)
					{
						Message.AppendInt32(0);
					}
				}
			}
			Session.SendMessage(Message);
		}
Ejemplo n.º 5
0
		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);
		}
Ejemplo n.º 6
0
		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);
					}
				}
			}
		}
Ejemplo n.º 7
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			DataTable dataTable_ = Session.GetHabbo().GroupMemberships;
			if (dataTable_ != null)
			{
				ServerMessage Message = new ServerMessage(915u);
				Message.AppendInt32(dataTable_.Rows.Count);
				foreach (DataRow dataRow in dataTable_.Rows)
				{
                    Group @class = GroupManager.GetGroup((int)dataRow["groupid"]);
					Message.AppendInt32(@class.Id);
					Message.AppendStringWithBreak(@class.Name);
					Message.AppendStringWithBreak(@class.Badge);
					if (Session.GetHabbo().GroupID == @class.Id) // is favorite group?
					{
						Message.AppendBoolean(true);
					}
					else
					{
						Message.AppendBoolean(false);
					}
				}
				Session.SendMessage(Message);
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			ServerMessage Message = new ServerMessage(611);
			Message.AppendBoolean(true);
			Message.AppendInt32(2);
			Session.SendMessage(Message);
		}
Ejemplo n.º 9
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo() == null)
			{
				Session.Login(Event.PopFixedString());
				if (Session.GetHabbo() != null && Session.GetHabbo().MutedUsers != null && Session.GetHabbo().MutedUsers.Count > 0)
				{
					using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
					{
						try
						{
							ServerMessage Message = new ServerMessage(420);
							Message.AppendInt32(Session.GetHabbo().MutedUsers.Count);
							foreach (uint Id in Session.GetHabbo().MutedUsers)
							{
								string string_ = adapter.ReadString("SELECT username FROM users WHERE Id = " + Id + " LIMIT 1;");
								Message.AppendStringWithBreak(string_);
							}
							Session.SendMessage(Message);
						}
						catch
						{
							Console.ForegroundColor = ConsoleColor.Red;
							Logging.WriteLine("Login error: User is ignoring a user that no longer exists");
							Console.ForegroundColor = ConsoleColor.Gray;
						}

					}
				}
			}
		}
Ejemplo n.º 10
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			ServerMessage Message = new ServerMessage(443);
			Message.AppendInt32(Session.GetHabbo().AchievementScore);
			Message.AppendStringWithBreak("");
			Session.SendMessage(Message);
		}
		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);
				}
			}
		}
Ejemplo n.º 12
0
		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);
			}
		}
Ejemplo n.º 13
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			Room class14_ = Session.GetHabbo().CurrentRoom;
			if (class14_ != null)
			{
				Event.PopWiredUInt();
				string string_ = Event.PopFixedString();
				RoomUser @class = class14_.GetRoomUserByHabbo(string_);
				if (@class != null)
				{
					uint uint_ = @class.GetClient().GetHabbo().Id;
					if (Session.GetHabbo().MutedUsers.Contains(uint_))
					{
						Session.GetHabbo().MutedUsers.Remove(uint_);
						using (DatabaseClient class2 = PhoenixEnvironment.GetDatabase().GetClient())
						{
							class2.ExecuteQuery(string.Concat(new object[]
							{
								"DELETE FROM user_ignores WHERE user_id = ",
								Session.GetHabbo().Id,
								" AND ignore_id = ",
								uint_,
								" LIMIT 1;"
							}));
						}
						ServerMessage Message = new ServerMessage(419u);
						Message.AppendInt32(3);
						Session.SendMessage(Message);
					}
				}
			}
		}
Ejemplo n.º 14
0
		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)
		{
			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 void parse(GameClient Session, ClientMessage Event)
		{
			DataTable dataTable = null;
			using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
			{
				dataTable = adapter.ReadDataTable("SELECT asking_price FROM catalog_marketplace_offers WHERE user_id = '" + Session.GetHabbo().Id + "' AND state = '2'");
			}
			if (dataTable != null)
			{
				int num = 0;
				foreach (DataRow dataRow in dataTable.Rows)
				{
					num += (int)dataRow["asking_price"];
				}
				if (num >= 1)
				{
					Session.GetHabbo().Credits += num;
					Session.GetHabbo().UpdateCreditsBalance(true);
				}
				using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
				{
					adapter.ExecuteQuery("DELETE FROM catalog_marketplace_offers WHERE user_id = '" + Session.GetHabbo().Id + "' AND state = '2'");
				}
			}
		}
Ejemplo n.º 17
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null)
			{
				RoomItem class2 = @class.GetItem(Event.PopWiredUInt());
				if (class2 != null && !(class2.GetBaseItem().InteractionType.ToLower() != "postit"))
				{
					string text = Event.PopFixedString();
					string text2 = text.Split(new char[]
					{
						' '
					})[0];
					string str = PhoenixEnvironment.FilterInjectionChars(text.Substring(text2.Length + 1), true, true);
					if (@class.CheckRights(Session) || text.StartsWith(class2.ExtraData))
					{
						string text3 = text2;
						if (text3 != null && (text3 == "FFFF33" || text3 == "FF9CFF" || text3 == "9CCEFF" || text3 == "9CFF9C"))
						{
							class2.ExtraData = text2 + " " + str;
							class2.UpdateState(true, true);
						}
					}
				}
			}
		}
		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);
					}
				}
			}
		}
Ejemplo n.º 19
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GetIndexMessageForRank(Session.GetHabbo().Rank));
     }
 }
Ejemplo n.º 20
0
		public void parse(GameClient Session, ClientMessage Event)
		{
            if (Session != null && Session.GetHabbo() != null && Session.GetHabbo().GetMessenger() != null)
			{
				Session.SendMessage(Session.GetHabbo().GetMessenger().SerializeUpdates());
			}
		}
		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)
				{
					ServerMessage Message = new ServerMessage(365u);
					Message.AppendInt32(@class.MoodlightData.Presets.Count);
					Message.AppendInt32(@class.MoodlightData.CurrentPreset);
					int num = 0;
					foreach (MoodlightPreset current in @class.MoodlightData.Presets)
					{
						num++;
						Message.AppendInt32(num);
						Message.AppendInt32(int.Parse(PhoenixEnvironment.BoolToEnum(current.BackgroundOnly)) + 1);
						Message.AppendStringWithBreak(current.ColorCode);
						Message.AppendInt32(current.ColorIntensity);
					}
					Session.SendMessage(Message);
				}
			}
			catch
			{
			}
		}
Ejemplo n.º 22
0
		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 Event)
		{
			if (Session.GetHabbo().HasRole("acc_chatlogs"))
			{
				Session.SendMessage(PhoenixEnvironment.GetGame().GetModerationTool().SerializeUserChatlog(Event.PopWiredUInt()));
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			if (Session != null && Session.GetHabbo() != null)
			{
				Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializeFloorItemInventory());
			}
		}
Ejemplo n.º 25
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			Room class14_ = Session.GetHabbo().CurrentRoom;
			if (class14_ != null)
			{
				Event.PopWiredUInt();
				string string_ = Event.PopFixedString();
				RoomUser @class = class14_.GetRoomUserByHabbo(string_);
				if (@class != null && @class.GetClient().GetHabbo().Rank <= 2u)
				{
					uint uint_ = @class.GetClient().GetHabbo().Id;
					if (!Session.GetHabbo().MutedUsers.Contains(uint_))
					{
						Session.GetHabbo().MutedUsers.Add(uint_);
						using (DatabaseClient class2 = PhoenixEnvironment.GetDatabase().GetClient())
						{
							class2.ExecuteQuery(string.Concat(new object[]
							{
								"INSERT INTO user_ignores(user_id, ignore_id) VALUES (",
								Session.GetHabbo().Id,
								", ",
								uint_,
								");"
							}));
						}
						ServerMessage Message = new ServerMessage(419u);
						Message.AppendInt32(1);
						Session.SendMessage(Message);
					}
				}
			}
		}
Ejemplo n.º 26
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     if (Session.GetHabbo().GetMessenger() != null)
     {
         Session.SendMessage(Session.GetHabbo().GetMessenger().PerformSearch(Event.PopFixedString()));
     }
 }
Ejemplo n.º 27
0
		public void Destroy()
		{
			this.Session = null;
			this.RequestHandlers = null;
			this.Request = null;
			this.Response = null;
		}
		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)
		{
			Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && @class.CheckRights(Session))
			{
				uint num = Event.PopWiredUInt();
				string a = Event.PopFixedString().ToUpper();
				string text = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());
				text = text.Replace("hd-99999-99999", "");
				text += ".";
				RoomItem class2 = @class.Hashtable_0[num] as RoomItem;
				if (class2.ExtraData.Contains(','))
				{
					class2.Extra1 = class2.ExtraData.Split(new char[]
					{
						','
					})[0];
					class2.Extra2 = class2.ExtraData.Split(new char[]
					{
						','
					})[1];
				}
				if (a == "M")
				{
					class2.Extra1 = text;
				}
				else
				{
					class2.Extra2 = text;
				}
				class2.ExtraData = class2.Extra1 + "," + class2.Extra2;
				class2.UpdateState(true, true);
			}
		}
Ejemplo n.º 30
0
 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>()));
                     }
                 }
             }
         }
     }
 }