public void Handle(HabboHotel.GameClients.GameClient Session, global::Essential.Messages.ClientMessage Event)
 {
     ServerMessage Message5_0 = new ServerMessage(Outgoing.Game2FullGameStatusMessageEvent);//Game2FullGameStatusMessageEvent
     Message5_0.AppendInt32(1);
     Message5_0.AppendInt32(1);
     Message5_0.AppendInt32(1);
     //SOMETHING
     Message5_0.AppendInt32(1);
     Message5_0.AppendInt32(1);
     Message5_0.AppendInt32(1);
     Message5_0.AppendInt32(1);
     Message5_0.AppendInt32(3);
     Habbo habbo = Session.GetHabbo();
     Message5_0.AppendInt32(habbo.SnowUserId);
     Message5_0.AppendInt32(habbo.SnowX);
     Message5_0.AppendInt32(habbo.SnowY);
     Message5_0.AppendInt32((int)(habbo.SnowX / 0xc80));
     Message5_0.AppendInt32((int)(habbo.SnowY / 0xc80));
     Message5_0.AppendInt32(habbo.SnowRot);
     Message5_0.AppendInt32(0);
     Message5_0.AppendInt32(0);
     //SOMETHING2
     Message5_0.AppendInt32(0);
     Message5_0.AppendInt32(0);
     Message5_0.AppendInt32(0);
     Session.GetHabbo().SnowWar.SendToStorm(Message5_0);
 }
		public void Handle(GameClient Session, ClientMessage Event)
		{
			uint num = Event.PopWiredUInt();
			string text = Essential.FilterString(Event.PopFixedString());
			if (Session != null && Session.GetHabbo() != null && Session.GetHabbo().GetMessenger() != null && Session.GetHabbo().PassedSafetyQuiz)
			{
                Session.GetHabbo().CheckForUnmute();
				if (num == 0u && Session.GetHabbo().HasFuse("cmd_sa"))
				{
                    ServerMessage Message = new ServerMessage(Outgoing.InstantChat);
					Message.AppendUInt(0u);
					Message.AppendString(Session.GetHabbo().Username + ": " + text);
                    Message.AppendString(Essential.GetUnixTimestamp() + string.Empty);
					Essential.GetGame().GetClientManager().SendToStaffs(Session, Message, false);
				}
				else
				{
					if (num == 0u)
					{
                       /* ServerMessage Message2 = new ServerMessage(1133);
						Message2.AppendInt32(4);
						Message2.AppendUInt(0u);
						Session.SendMessage(Message2);*/
					}
					else
					{
                        if (Session != null && Session.GetHabbo() != null)
                        {
                            Session.GetHabbo().GetMessenger().method_18(num, text);
                        }
					}
				}
			}
		}
Example #3
0
		public Trade(uint uint_3, uint uint_4, uint uint_5)
		{
			this.uint_1 = uint_3;
			this.uint_2 = uint_4;
			this.class65_0 = new TradeUser[2];
			this.class65_0[0] = new TradeUser(uint_3, uint_5);
			this.class65_0[1] = new TradeUser(uint_4, uint_5);
			this.int_0 = 1;
			this.uint_0 = uint_5;
			TradeUser[] array = this.class65_0;
			for (int i = 0; i < array.Length; i++)
			{
				TradeUser @class = array[i];
				if ([email protected]_0().Statusses.ContainsKey("trd"))
				{
					@class.method_0().AddStatus("trd", "");
					@class.method_0().UpdateNeeded = true;
				}
			}
            ServerMessage Message = new ServerMessage(Outgoing.TradeStart); // Updated
			Message.AppendUInt(uint_3);
			Message.AppendInt32(1);
			Message.AppendUInt(uint_4);
            Message.AppendInt32(1);
			this.method_13(Message);
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && @class.method_26(Session))
			{
				string string_ = Event.PopFixedString();
                bool canletin = Event.PopWiredBoolean();
				GameClient class2 = Essential.GetGame().GetClientManager().GetClientByHabbo(string_);
				if (class2 != null && class2.GetHabbo() != null && class2.GetHabbo().bool_6 && class2.GetHabbo().uint_2 == Session.GetHabbo().CurrentRoomId)
				{
					if (canletin)
					{
						class2.GetHabbo().bool_5 = true;
                        ServerMessage Message4 = new ServerMessage(Outgoing.FlatAccessible); // Updated
                        Message4.AppendString("");
                        class2.SendMessage(Message4);
					}
					else
					{
                        ServerMessage Message5 = new ServerMessage(Outgoing.DoorBellNoPerson); // Updated
                        Message5.AppendString("");
                        class2.SendMessage(Message5);
					}
				}
			}
		}
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room Room = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            if (Room != null && Room.CheckRights(Session, true))
            {

                        ServerMessage LoadUsersWithRights = new ServerMessage(Outgoing.FlatControllerAdded);
                        LoadUsersWithRights.AppendUInt(Room.Id);
                        LoadUsersWithRights.AppendInt32(Room.UsersWithRights.Count);
                        foreach (uint current2 in Room.UsersWithRights)
                        {

                            LoadUsersWithRights.AppendUInt(current2);
                            LoadUsersWithRights.AppendString(Essential.GetGame().GetClientManager().GetNameById(current2));
                        }
                        Session.SendMessage(LoadUsersWithRights);

                        foreach (uint current3 in Room.UsersWithRights)
                        {
                            ServerMessage serverMessage = new ServerMessage(Outgoing.GivePowers); // Updated
                            serverMessage.AppendUInt(Room.Id);
                            serverMessage.AppendUInt(current3);
                            serverMessage.AppendStringWithBreak(Essential.GetGame().GetClientManager().GetNameById(current3));
                            Session.SendMessage(serverMessage);
                        }
        
            }
        }
		public void Handle(GameClient Session, ClientMessage Event)
		{
			int num = Event.PopWiredInt32();

            ServerMessage Message = new ServerMessage(Outgoing.SongInfo); // Updated
			Message.AppendInt32(num);
			if (num > 0)
			{
				for (int i = 0; i < num; i++)
				{
					int num2 = Event.PopWiredInt32();

                    
                    if (num2 > 0)
                    {
                        Message.AppendInt32(SongManager.GetSong(num2).Id);
                        Message.AppendString(SongManager.GetSong(num2).Name);
                        Message.AppendString(SongManager.GetSong(num2).Track);
                        Message.AppendInt32(SongManager.GetSong(num2).Length);
                        Message.AppendString(SongManager.GetSong(num2).Author);
                    }
                    else
                    {
                        // Ei lähetetä osittaista pakettia!!
                        return;
                    }
                }
            }
          
			Session.SendMessage(Message);
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			uint num = Event.PopWiredUInt();
            RoomData @class = Essential.GetGame().GetRoomManager().method_12(num);
			if (@class == null || Session.GetHabbo().list_1.Count >= 30 || Session.GetHabbo().list_1.Contains(num) || @class.Type == "public")
			{
			}
			else
			{
                ServerMessage Message2 = new ServerMessage(Outgoing.FavsUpdate); // Updated
				Message2.AppendUInt(num);
				Message2.AppendBoolean(true);
				Session.SendMessage(Message2);
				Session.GetHabbo().list_1.Add(num);
				using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
				{
					class2.ExecuteQuery(string.Concat(new object[]
					{
						"INSERT INTO user_favorites (user_id,room_id) VALUES ('",
						Session.GetHabbo().Id,
						"','",
						num,
						"')"
					}));
				}
			}
		}
 public void Handle(GameClient Session, ClientMessage Event)
 {
     ServerMessage message = new ServerMessage(Outgoing.SendGuildParts); //Rootkit
     message.AppendInt32(10);
     message.AppendInt32((int)(Session.GetHabbo().OwnedRooms.Count - this.GetMyRoomsGuilds(Session)));
     foreach (RoomData data in Session.GetHabbo().OwnedRooms)
     {
         if (data.GuildId == 0)
         {
             message.AppendInt32(data.Id);
             message.AppendString(data.Name);
             message.AppendBoolean(false);
         }
     }
     message.AppendInt32(5);
     message.AppendInt32(10);
     message.AppendInt32(3);
     message.AppendInt32(4);
     message.AppendInt32(0x19);
     message.AppendInt32(0x11);
     message.AppendInt32(5);
     message.AppendInt32(0x19);
     message.AppendInt32(0x11);
     message.AppendInt32(3);
     message.AppendInt32(0x1d);
     message.AppendInt32(11);
     message.AppendInt32(4);
     message.AppendInt32(0);
     message.AppendInt32(0);
     message.AppendInt32(0);
     Session.SendMessage(message);
     Session.SendMessage(Essential.GetGame().GetCatalog().groupsDataMessage);
 }
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
                ServerMessage message = new ServerMessage(Outgoing.WiredFurniTrigger);
                message.AppendBoolean(false);
                if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
                    message.AppendInt32(1000000);
                else
                    message.AppendInt32(5);
                message.AppendInt32(0);
                message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
                message.AppendInt32(RoomItem_0.uint_0);
                if (RoomItem_0.string_3.Length > 0)
                {
                    message.AppendString(RoomItem_0.string_3);
                }
                else
                {
                    message.AppendString("I");
                }
                message.AppendInt32(1);
                message.AppendInt32(1);
                message.AppendInt32(1);
                message.AppendInt32(3);
                message.AppendInt32(0);
                message.AppendInt32(0);
                Session.SendMessage(message);
			}
		}
Example #10
0
        public ServerMessage SerializeTool()
		{
            ServerMessage Message = new ServerMessage(Outgoing.OpenModTools); // Updated
            Message.AppendInt32(0);
			Message.AppendInt32(this.UserMessagePresets.Count);
			using (TimedLock.Lock(this.UserMessagePresets))
			{
				foreach (string current in this.UserMessagePresets)
				{
					Message.AppendStringWithBreak(current);
				}
			}
            Message.AppendInt32(0);
            Message.AppendBoolean(true); // ticket_queue fuse
            Message.AppendBoolean(true); // chatlog fuse
            Message.AppendBoolean(true); // message / caution fuse
            Message.AppendBoolean(true); // kick fuse
            Message.AppendBoolean(true); // band fuse
            Message.AppendBoolean(true); // broadcastshit fuse
            Message.AppendBoolean(true); // other shit fuse
            Message.AppendInt32(0);
			Message.AppendInt32(this.RoomMessagePresets.Count);
			using (TimedLock.Lock(this.RoomMessagePresets))
			{
				foreach (string current in this.RoomMessagePresets)
				{
					Message.AppendStringWithBreak(current);
				}
			}
			return Message;
		}
Example #11
0
          /*  public ServerMessage GetEntries(DataTable EntriesTable, GameClient Session)
            {
                gc = Session;
                List<StreamEntry> Entries = new List<StreamEntry>();
                ServerMessage Message = new ServerMessage(Outgoing.EventStream);
                Dictionary<uint, int> ContainsID = new Dictionary<uint, int>();
                uint virtualidcounter = 0;
                foreach (DataRow Entry in EntriesTable.Rows)
                {
                    if (!ContainsID.ContainsKey((uint)Entry["id"]))
                    {
                        virtualidcounter = virtualidcounter + 1;
                        DataRow UserRow = GetUserRow(Entry["userid"].ToString());
                        Entries.Add(new StreamEntry((int)Entry["id"], (int)virtualidcounter, Entry["userid"].ToString(), (string)UserRow["username"], UserRow["gender"].ToString().ToLower(), (string)UserRow["look"], GetMinutes((double)Entry["time"]), Convert.ToInt32(Entry["data_extra"].ToString()), GetEntryLiked((int)Entry["id"], false), (string)Entry["data"]));
                        ContainsID.Add((uint)Entry["id"], 1);
                    }
                }
                Message.AppendInt32(Entries.Count);
                this.ESEntry = Entries;
                return AppendEntryOnServerMessage(Message, Entries);
            }*/
            public ServerMessage GetEntries(DataTable EntriesTable, GameClient Session)
            {
                gc = Session;
                List<StreamEntry> Entries = new List<StreamEntry>();
                ServerMessage Message = new ServerMessage(Outgoing.EventStream);
                Dictionary<int,int> ids = new Dictionary<int,int>();
                int virtualIdCounter = 0;
                foreach (DataRow Entry in EntriesTable.Rows)
                {
                    try
                    {
                        int id = int.Parse(Entry["id"].ToString());
                        if (!ids.ContainsKey(id))
                        {
                            virtualIdCounter++;
                            DataRow userRow = GetUserRow(Entry["userid"].ToString());

                            Entries.Add(new StreamEntry(id, virtualIdCounter, Entry["userid"].ToString(), (string)userRow["username"], userRow["gender"].ToString().ToLower(), (string)userRow["look"], GetMinutes((double)Entry["time"]), Convert.ToInt32(Entry["data_extra"].ToString()), GetEntryCanLike(id, false), (string)Entry["data"]));
                            ids.Add(id, 1);
                        }
                    }
                    catch (Exception ex) { Console.WriteLine(ex.ToString()); }
                }
                Message.AppendInt32(Entries.Count);
                this.ESEntry = Entries;
                return AppendEntryOnServerMessage(Message, Entries);
            }
		public void Handle(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();
			
				text = Essential.DoFilter(text, true, false);
				text = ChatCommandHandler.ApplyFilter(text);
                ServerMessage Message = new ServerMessage(Outgoing.InstantInvite); // Update
				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 = Essential.GetGame().GetClientManager().GetClient(current);
						if (@class == null)
						{
							break;
						}
						@class.SendMessage(Message);
					}
				}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room Room = Session.GetHabbo().CurrentRoom;
            if (Room != null)
			{
				string string_ = Event.PopFixedString();
                RoomUser @class = Room.method_56(string_);
				if (@class != null)
				{
					uint uint_ = @class.GetClient().GetHabbo().Id;
					if (!Session.GetHabbo().list_2.Contains(uint_))
					{
						Session.GetHabbo().list_2.Add(uint_);
						using (DatabaseClient class2 = Essential.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(Outgoing.UpdateIgnoreStatus); // Updated
                        Message.AppendInt32(1);
                        Message.AppendString(string_);
						Session.SendMessage(Message);
					}
				}
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
            ServerMessage Message = new ServerMessage(Outgoing.Recycle); // Updated
            Message.AppendInt32(1);
            Message.AppendInt32(0);
            Session.SendMessage(Message);
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			DataTable dataTable_ = Session.GetHabbo().dataTable_0;
			if (dataTable_ != null)
			{
                ServerMessage Message = new ServerMessage(Outgoing.UserGuilds);
				Message.AppendInt32(dataTable_.Rows.Count);
				foreach (DataRow dataRow in dataTable_.Rows)
				{
					GroupsManager @class = Groups.GetGroupById((int)dataRow["groupid"]);
					Message.AppendInt32(@class.Id);
                    Message.AppendStringWithBreak(@class.Name);
                    Message.AppendStringWithBreak(@class.Badge);
					if (Session.GetHabbo().FavouriteGroup == @class.Id) // is favorite group?
					{
						Message.AppendBoolean(true);
					}
					else
					{
						Message.AppendBoolean(false);
					}
				}
				Session.SendMessage(Message);
			}
		}
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0)
     {
         ServerMessage Message = new ServerMessage(Outgoing.WiredCondition); // Updated
         Message.AppendBoolean(false);
         if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
             Message.AppendInt32(1000000);
         else
             Message.AppendInt32(5);
         Message.AppendInt32(0);
         Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         Message.AppendUInt(RoomItem_0.uint_0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Session.SendMessage(Message);
     }
 }
		public void Handle(GameClient Session, ClientMessage Event)
		{
            ServerMessage Message = new ServerMessage(Outgoing.CanCreateRoom); // Updated
            Message.AppendInt32(0);
            Message.AppendInt32(99999);
			Session.SendMessage(Message);
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
             ServerMessage Message = new ServerMessage(Outgoing.PetRace); //Rootkit
             string PetType = Event.PopFixedString();
             Message.AppendStringWithBreak(PetType);
             int petid = int.Parse(PetType.Substring(PetType.IndexOf('t'), PetType.Length - PetType.IndexOf('t')).Replace("t",""));
            if (PetRace.RaceGotRaces(petid))
            {
                List<PetRace> Races = PetRace.GetRacesForRaceId(petid);
                Message.AppendInt32(Races.Count);
                foreach (PetRace r in Races)
                {
                    Message.AppendInt32(petid);
                    Message.AppendInt32(r.Color1);
                    Message.AppendInt32(r.Color2);
                    Message.AppendBoolean(r.Has1Color);
                    Message.AppendBoolean(r.Has2Color); 
                }
            }
            else
            {
                Message.AppendInt32(0);
            }
				Session.SendMessage(Message);
			}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			try
			{
				Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                if (@class != null && @class.CheckRights(Session, true) && @class.MoodlightData != null)
				{
                    ServerMessage Message = new ServerMessage(Outgoing.DimmerData); // Updated
					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(Essential.BooleanToString(current.BackgroundOnly)) + 1);
						Message.AppendStringWithBreak(current.ColorCode);
						Message.AppendInt32(current.ColorIntensity);
					}
					Session.SendMessage(Message);
				}
			}
			catch
			{
			}
		}
Example #20
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (bool_0)
			{
                ServerMessage Message = new ServerMessage(Outgoing.WiredCondition); // Updated
                Message.AppendBoolean(false);
                Message.AppendInt32(5);
                if (RoomItem_0.string_3 != "")
                {
                    Message.AppendInt32(RoomItem_0.string_3.Split(',').Length);

                    foreach (string ItemId in RoomItem_0.string_3.Split(','))
                    {
                        Message.AppendInt32(int.Parse(ItemId));
                    }
                }
                else
                {
                    Message.AppendInt32(0);
                }
                Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
                Message.AppendUInt(RoomItem_0.uint_0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(1);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
                Message.AppendInt32(0);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
            if (bool_0)
            {
                ServerMessage message = new ServerMessage(Outgoing.WiredEffect); // Updated
                message.AppendBoolean(false);
                if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
                    message.AppendInt32(1000000);
                else
                    message.AppendInt32(5);
                message.AppendInt32(0);
                message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
                message.AppendInt32(RoomItem_0.uint_0);
                message.AppendString("");
                message.AppendInt32(2);
                if (RoomItem_0.string_2 != "")
                    message.AppendInt32(int.Parse(RoomItem_0.string_2));
                else
                    message.AppendInt32(5);
                if (RoomItem_0.string_3 != "")
                    message.AppendInt32(int.Parse(RoomItem_0.string_3));
                else
                    message.AppendInt32(1);
                message.AppendInt32(0);
                message.AppendInt32(6);
                message.AppendInt32(0);
                message.AppendInt32(0);
                message.AppendInt32(0);
                Session.SendMessage(message);
            }
		}
 public void Handle(HabboHotel.GameClients.GameClient Session, global::Essential.Messages.ClientMessage Event)
 {
     using(DatabaseClient dbClient = Essential.GetDatabase().GetClient())
     {
         string username = Event.PopFixedString();
         string password = Event.PopFixedString(); //TODO: Hash undso..
         dbClient.AddParamWithValue("username", username);
         
         string currentpassword = "";
         try
         {
             currentpassword = dbClient.ReadString("SELECT password FROM users WHERE username=@username");
         }
         catch { }
         if (currentpassword == "")
         { Session.SendMessage(new ServerMessage(Outgoing.InvalidUsername)); return; }
         if (currentpassword != password)
         { Session.SendMessage(new ServerMessage(Outgoing.InvalidPassword)); return; }
         ServerMessage asdf = new ServerMessage(12345);
         asdf.AppendBoolean(true);
         asdf.AppendString("Hi");
         asdf.AppendInt32(1337);
         asdf.AppendUInt(12345);
         Session.SendMessage(asdf);
         Session.tryLogin(dbClient.ReadString("SELECT auth_ticket FROM users WHERE username=@username"));
     }
 }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            if (!Session.GetHabbo().CurrentRoom.CCTs.Contains("park"))
            {
                return;
            }

            if (Session.GetHabbo().CurrentRoom.IsInfobusOpen == false)
            {
                ServerMessage InfobusClosed = new ServerMessage(Outgoing.InfobusMessage);
                InfobusClosed.AppendStringWithBreak("Ich bin zurzeit geschlossen! Komm später wieder.");
                Session.SendMessage(InfobusClosed);
            }
            else
            {
                Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id).MoveTo(28, 5);

                if (Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id).X == 28 && Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id).Y == 5)
                {
                    ServerMessage Message = new ServerMessage(Outgoing.RoomForward);
                    Message.AppendBoolean(true);
                    Message.AppendInt32(56);
                    Session.SendMessage(Message);
                }
                    
                
            }
        }
		public void Handle(GameClient session, ClientMessage message)
		{
			if (session != null && session.GetHabbo() != null)
			{
				Room room = Essential.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);

				if (room != null)
				{
					RoomUser targetUser = room.GetRoomUserByHabbo(message.PopWiredUInt());

					if (targetUser != null && !targetUser.IsBot && targetUser.GetClient() != null)
					{
                        ServerMessage Message = new ServerMessage(Outgoing.UpdateBadges); // Updated

						Message.AppendUInt(targetUser.GetClient().GetHabbo().Id);
						Message.AppendInt32(targetUser.GetClient().GetHabbo().GetBadgeComponent().VisibleBadges);

						using (TimedLock.Lock(targetUser.GetClient().GetHabbo().GetBadgeComponent().GetBadges()))
						{
							foreach (Badge current in targetUser.GetClient().GetHabbo().GetBadgeComponent().GetBadges())
							{
								if (current.Slot > 0)
								{
									Message.AppendInt32(current.Slot);
									Message.AppendStringWithBreak(current.Code);
								}
							}
						}

						session.SendMessage(Message);
					}
				}
			}
		}
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (Session.GetHabbo().CurrentRoom.CheckRights(Session, true))
     {
         ServerMessage message = new ServerMessage(Outgoing.WiredCondition);
         message.AppendBoolean(false);
         if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
             message.AppendInt32(1000000);
         else
             message.AppendInt32(5);
         message.AppendInt32(0);
         message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         message.AppendInt32(RoomItem_0.uint_0);
         message.AppendString("");
         message.AppendInt32(2);
         if (!string.IsNullOrEmpty(RoomItem_0.string_3))
         {
             message.AppendInt32(int.Parse(RoomItem_0.string_3.Split(';')[0]));
             message.AppendInt32(int.Parse(RoomItem_0.string_3.Split(';')[1]));
         }
         else
         {
             message.AppendInt32(1);
             message.AppendInt32(50);
         }
         message.AppendBoolean(false);
         message.AppendInt32(0);
         message.AppendInt32(1290);
         Session.SendMessage(message);
     }
 }
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room class14_ = Session.GetHabbo().CurrentRoom;
			if (class14_ != null)
			{
				string string_ = Event.PopFixedString();
				RoomUser @class = class14_.method_56(string_);
				if (@class != null)
				{
					uint uint_ = @class.GetClient().GetHabbo().Id;
					if (Session.GetHabbo().list_2.Contains(uint_))
					{
						Session.GetHabbo().list_2.Remove(uint_);
						using (DatabaseClient class2 = Essential.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(Outgoing.UpdateIgnoreStatus); // Updated
						Message.AppendInt32(3);
                        Message.AppendString(string_);
						Session.SendMessage(Message);
					}
				}
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
            Room room = Essential.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();
                    /*if (num < 0 || num > 4 || (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && num > 1))
                    {
                        num = 0;
                    }*/
                    if (num > 0 && roomUserByHabbo.CarryItemID > 0)
                    {
                        roomUserByHabbo.CarryItem(0);
                    }
                    roomUserByHabbo.DanceId = num;
                    ServerMessage serverMessage = new ServerMessage(Outgoing.Dance);
                    serverMessage.AppendInt32(roomUserByHabbo.VirtualId);
                    serverMessage.AppendInt32(num);
                    room.SendMessage(serverMessage, null);
                    if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "DANCE")
                    {
                        Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                    }
                }
            }
		}
Example #28
0
 internal void Serialize(ServerMessage Message)
 {
     try
     {
         Message.AppendInt32(this.Id);
         Message.AppendString((this.itemType != PublicItemType.PUBLIC_FLAT) ? this.Caption : string.Empty);
         Message.AppendString(this.Description);
         Message.AppendInt32(this.Type);
         Message.AppendString((this.itemType == PublicItemType.PUBLIC_FLAT) ? this.Caption : string.Empty);
         Message.AppendString(this.Image);
         Message.AppendInt32((this.ParentId > 0) ? this.ParentId : 0);
         Message.AppendInt32((this.RoomInfo != null) ? this.RoomInfo.UsersNow : 0);
         Message.AppendInt32((this.itemType == PublicItemType.NONE) ? 0 : ((this.itemType == PublicItemType.TAG) ? 1 : ((this.itemType == PublicItemType.FLAT) ? 2 : ((this.itemType == PublicItemType.PUBLIC_FLAT) ? 2 : ((this.itemType == PublicItemType.CATEGORY) ? 4 : 0)))));
         if (this.itemType == PublicItemType.TAG)
         {
             Message.AppendString(this.TagsToSearch);
         }
         else if (this.itemType == PublicItemType.CATEGORY)
         {
             Message.AppendBoolean(false);
         }
         else if (this.itemType == PublicItemType.FLAT)
         {
             this.RoomInfo.Serialize(Message, false, false);
         }
         else if (this.itemType == PublicItemType.PUBLIC_FLAT)
         {
             this.RoomInfo.Serialize(Message, false, false);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine("Exception on publicitems composing: " + exception.ToString());
     }
 }
 public void Handle(HabboHotel.GameClients.GameClient Session, global::Essential.Messages.ClientMessage Event)
 {
     int num = Event.PopWiredInt32();
     int num2 = Event.PopWiredInt32();
     int num3 = Event.PopWiredInt32();
     if ((num2 == 1) && (num3 == 0))
     {
         Room room = Essential.GetGame().GetRoomManager().GetRoom((uint)num);
         if ((room != null) && (room.GetRoomUserByHabbo(Session.GetHabbo().Id) == null))
         {
         }
     }
     else if ((num2 != 0) || (num3 != 0))
     {
         RoomData data = Essential.GetGame().GetRoomManager().method_12((uint)num);
         if (data != null)
         {
             ServerMessage message = new ServerMessage(Outgoing.RoomData);
             message.AppendBoolean(false);
             data.Serialize(message, false, false);
             message.AppendBoolean(true);
             message.AppendBoolean(false);
             message.AppendBoolean(true);
             message.AppendBoolean(true);
             message.AppendInt32(0);
             message.AppendInt32(0);
             message.AppendInt32(0);
             message.AppendBoolean(true);
             Session.SendMessage(message);
             //Console.WriteLine("aa");
         }
     }
 }
Example #30
0
 internal void SerializeItem(ServerMessage Message)
 {
     Message.AppendString(this.Name);
     Message.AppendInt32(this.ItemId);
     Message.AppendInt32(this.X);
     Message.AppendInt32(this.Y);
     Message.AppendInt32(this.Rot);
     Message.AppendInt32(1);
     Message.AppendInt32(this.SpriteId);
     Message.AppendInt32(this.Name.Contains("background") ? 1 : 0);
     Message.AppendInt32(0);
     Message.AppendBoolean(true);
     if (this.Name.Contains("background"))
     {
         Message.AppendInt32(1);
         Message.AppendInt32(5);
         Message.AppendString("state");
         Message.AppendString("0");
         Message.AppendString("offsetZ");
         Message.AppendString("9920");
         Message.AppendString("offsetY");
         Message.AppendString("1520");
         Message.AppendString("imageUrl");
         Message.AppendString("http://localhost/r63B/c_images/DEV_tests/snst_bg_2_big.png");
         Message.AppendString("offsetX");
         Message.AppendString("-1070");
     }
     else
     {
         Message.AppendInt32(0);
         Message.AppendString(this.Extradata);
     }
 }