public RoomData CreateRoom(GameClient Session, string Name, string Description, string Model, int Category, int MaxVisitors, int TradeSettings,
                                   string wallpaper = "0.0", string floor = "0.0", string landscape = "0.0", int wallthick = 0, int floorthick = 0)
        {
            if (!_roomModels.ContainsKey(Model))
            {
                Session.SendNotification(BiosEmuThiago.GetGame().GetLanguageManager().TryGetValue("room.creation.model.not_found"));
                return(null);
            }

            if (Name.Length < 3)
            {
                Session.SendNotification(BiosEmuThiago.GetGame().GetLanguageManager().TryGetValue("room.creation.name.too_short"));
                return(null);
            }

            int RoomId = 0;

            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("INSERT INTO `rooms` (`roomtype`,`caption`,`description`,`owner`,`model_name`,`category`,`users_max`,`trade_settings`,`wallpaper`,`floor`,`landscape`,`floorthick`,`wallthick`) VALUES ('private',@caption,@description,@UserId,@model,@category,@usersmax,@tradesettings,@wallpaper,@floor,@landscape,@floorthick,@wallthick)");
                dbClient.AddParameter("caption", Name);
                dbClient.AddParameter("description", Description);
                dbClient.AddParameter("UserId", Session.GetHabbo().Id);
                dbClient.AddParameter("model", Model);
                dbClient.AddParameter("category", Category);
                dbClient.AddParameter("usersmax", MaxVisitors);
                dbClient.AddParameter("tradesettings", TradeSettings);
                dbClient.AddParameter("wallpaper", wallpaper);
                dbClient.AddParameter("floor", floor);
                dbClient.AddParameter("landscape", landscape);
                dbClient.AddParameter("floorthick", floorthick);
                dbClient.AddParameter("wallthick", wallthick);

                RoomId = Convert.ToInt32(dbClient.InsertQuery());
            }

            RoomData newRoomData = GenerateRoomData(RoomId);

            Session.GetHabbo().UsersRooms.Add(newRoomData);
            return(newRoomData);
        }
Exemple #2
0
        public void OnTrigger(GameClients.GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (Session == null || Session.GetHabbo() == null || Item == null)
            {
                return;
            }

            Room Room = Session.GetHabbo().CurrentRoom;

            if (Room == null)
            {
                return;
            }

            RoomUser Actor = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (Actor == null)
            {
                return;
            }

            var tick = int.Parse(Item.ExtraData);

            if (tick < 1)
            {
                if (Gamemap.TileDistance(Actor.X, Actor.Y, Item.GetX, Item.GetY) < 2)
                {
                    tick++;
                    Item.ExtraData = tick.ToString();
                    Item.UpdateState(true, true);
                    int    X = Item.GetX, Y = Item.GetY, Rot = Item.Rotation;
                    Double Z = Item.GetZ;
                    if (tick == 1)
                    {
                        BiosEmuThiago.GetGame().GetPinataManager().ReceiveCrackableReward(Actor, Room, Item);
                        BiosEmuThiago.GetGame().GetAchievementManager().ProgressAchievement(Actor.GetClient(), "ACH_PinataWhacker", 1);
                        BiosEmuThiago.GetGame().GetAchievementManager().ProgressAchievement(Actor.GetClient(), "ACH_PinataBreaker", 1);
                    }
                }
            }
        }
Exemple #3
0
        public override void OnUserEnterRoom(RoomUser User)
        {
            if (GetBotData() == null)
            {
                return;
            }

            RoomUser Bot = GetRoomUser();

            if (User.GetClient().GetHabbo().CurrentRoom.OwnerId == User.GetClient().GetHabbo().Id)
            {
                DataTable getUsername;
                using (IQueryAdapter query = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                {
                    query.SetQuery("SELECT username FROM room_visits WHERE roomid = @id");
                    query.AddParameter("id", User.RoomId);
                    getUsername = query.getTable();
                }

                foreach (DataRow Row in getUsername.Rows)
                {
                    GetRoomUser().Chat("Fico feliz em te ver, Senhor!Diga 'Sim', se você quer saber quem visitou o quarto na sua ausência.", false);
                    return;
                }
                GetRoomUser().Chat("Fui muito atento(a) e afirmo que ninguém visitou este quarto enquanto você não estava.", false);
            }
            else
            {
                GetRoomUser().Chat("Olá " + User.GetClient().GetHabbo().Username + ", Vou contar ao proprietário sobre você.", false);

                using (IQueryAdapter query = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                {
                    query.SetQuery("INSERT INTO room_visits (roomid, username, gone) VALUE (@roomid, @username, @gone)");
                    query.AddParameter("roomid", User.RoomId);
                    query.AddParameter("username", User.GetClient().GetHabbo().Username);
                    query.AddParameter("gone", "ainda está na sala.");
                    query.RunQuery();
                }
                return;
            }
        }
Exemple #4
0
        public void Parse(HabboHotel.GameClients.GameClient session, ClientPacket packet)
        {
            if (!session.GetHabbo().InRoom)
            {
                return;
            }

            Room Room = session.GetHabbo().CurrentRoom;

            if (Room == null)
            {
                return;
            }

            string Username = packet.PopString();

            Habbo Player = BiosEmuThiago.GetHabboByUsername(Username);

            if (Player == null)
            {
                return;
            }

            if (!session.GetHabbo().GetIgnores().TryGet(Player.Id))
            {
                return;
            }

            if (session.GetHabbo().GetIgnores().TryRemove(Player.Id))
            {
                using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery("DELETE FROM `user_ignores` WHERE `user_id` = @uid AND `ignore_id` = @ignoreId");
                    dbClient.AddParameter("uid", session.GetHabbo().Id);
                    dbClient.AddParameter("ignoreId", Player.Id);
                    dbClient.RunQuery();
                }

                session.SendMessage(new IgnoreStatusComposer(3, Player.Username));
            }
        }
Exemple #5
0
        public bool TryGetGroup(int id, out Group Group)
        {
            Group = null;

            if (this._groups.ContainsKey(id))
            {
                return(this._groups.TryGetValue(id, out Group));
            }

            lock (this._groupLoadingSync)
            {
                if (this._groups.ContainsKey(id))
                {
                    return(this._groups.TryGetValue(id, out Group));
                }

                DataRow Row = null;
                using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery("SELECT * FROM `groups` WHERE `id` = @id LIMIT 1");
                    dbClient.AddParameter("id", id);
                    Row = dbClient.getRow();

                    if (Row != null)
                    {
                        int created;
                        try
                        {
                            int.TryParse(Row["created"].ToString(), out created);
                        }
                        catch { created = BiosEmuThiago.GetIUnixTimestamp(); }
                        Group = new Group(
                            Convert.ToInt32(Row["id"]), Convert.ToString(Row["name"]), Convert.ToString(Row["desc"]), Convert.ToString(Row["badge"]), Convert.ToInt32(Row["room_id"]), Convert.ToInt32(Row["owner_id"]),
                            Convert.ToInt32(Row["created"]), Convert.ToInt32(Row["state"]), Convert.ToInt32(Row["colour1"]), Convert.ToInt32(Row["colour2"]), Convert.ToInt32(Row["admindeco"]), Convert.ToInt32(Row["forum_enabled"]) == 1, Convert.ToInt32(Row["has_chat"]) == 1);
                        this._groups.TryAdd(Group.Id, Group);
                        return(true);
                    }
                }
            }
            return(false);
        }
        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null || User.GetClient() == null)
            {
                return;
            }

            string[] headParts;
            string[] figureParts = Session.GetHabbo().Look.Split('.');
            foreach (string Part in figureParts)
            {
                if (Part.StartsWith("hd"))
                {
                    headParts = Part.Split('-');
                    if (!headParts[1].Equals("99999"))
                    {
                        headParts[1] = "99999";
                    }
                    else
                    {
                        return;
                    }

                    Session.GetHabbo().Look = Session.GetHabbo().Look.Replace(Part, "hd-" + headParts[1] + "-" + headParts[2]);
                    break;
                }
            }
            Session.GetHabbo().Look = BiosEmuThiago.GetGame().GetFigureManager().ProcessFigure(Session.GetHabbo().Look, Session.GetHabbo().Gender, Session.GetHabbo().GetClothing().GetClothingParts, true);
            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE `users` SET `look` = @Look WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                dbClient.AddParameter("look", Session.GetHabbo().Look);
                dbClient.RunQuery();
            }

            Session.SendMessage(new UserChangeComposer(User, true));
            Session.GetHabbo().CurrentRoom.SendMessage(new UserChangeComposer(User, false));
            return;
        }
Exemple #7
0
        public void Parse(GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
            {
                return;
            }

            int Result   = Packet.PopInt(); // 1 = useless, 2 = abusive, 3 = resolved
            int Junk     = Packet.PopInt();
            int TicketId = Packet.PopInt();

            ModerationTicket Ticket = null;

            if (!BiosEmuThiago.GetGame().GetModerationManager().TryGetTicket(TicketId, out Ticket))
            {
                return;
            }

            if (Ticket.Moderator.Id != Session.GetHabbo().Id)
            {
                return;
            }

            GameClient Client = BiosEmuThiago.GetGame().GetClientManager().GetClientByUserID(Ticket.Sender.Id);

            if (Client != null)
            {
                Client.SendMessage(new ModeratorSupportTicketResponseComposer(Result));
            }

            if (Result == 2)
            {
                using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.runFastQuery("UPDATE `user_info` SET `cfhs_abusive` = `cfhs_abusive` + 1 WHERE `user_id` = '" + Ticket.Sender.Id + "' LIMIT 1");
                }
            }

            Ticket.Answered = true;
            BiosEmuThiago.GetGame().GetClientManager().SendMessage(new ModeratorSupportTicketComposer(Session.GetHabbo().Id, Ticket), "mod_tool");
        }
Exemple #8
0
        public void Init()
        {
            DataTable Table = null;

            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT * FROM `questions`");
                Table = dbClient.getTable();
            }

            if (Table != null)
            {
                foreach (DataRow Row in Table.Rows)
                {
                    if (!this._questions.ContainsKey(Convert.ToInt32(Row["id"])))
                    {
                        this._questions.TryAdd(Convert.ToInt32(Row["id"]), new Question());
                    }
                }
            }
        }
Exemple #9
0
        public void Init()
        {
            if (_responses.Count > 0)
            {
                _responses.Clear();
            }

            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT `bot_ai`,`chat_keywords`,`response_text`,`response_mode`,`response_beverage` FROM `bots_responses`");
                DataTable BotResponses = dbClient.getTable();

                if (BotResponses != null)
                {
                    foreach (DataRow Response in BotResponses.Rows)
                    {
                        _responses.Add(new BotResponse(Convert.ToString(Response["bot_ai"]), Convert.ToString(Response["chat_keywords"]), Convert.ToString(Response["response_text"]), Response["response_mode"].ToString(), Convert.ToString(Response["response_beverage"])));
                    }
                }
            }
        }
Exemple #10
0
        public RoomRightsListComposer(Room Instance)
            : base(ServerPacketHeader.RoomRightsListMessageComposer)
        {
            WriteInteger(Instance.Id);

            WriteInteger(Instance.UsersWithRights.Count);
            foreach (int Id in Instance.UsersWithRights.ToList())
            {
                UserCache Data = BiosEmuThiago.GetGame().GetCacheManager().GenerateUser(Id);
                if (Data == null)
                {
                    WriteInteger(0);
                    WriteString("Unknown Error");
                }
                else
                {
                    WriteInteger(Data.Id);
                    WriteString(Data.Username);
                }
            }
        }
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
            {
                return;
            }

            int Amount = Packet.PopInt();

            for (int i = 0; i < Amount; i++)
            {
                ModerationTicket Ticket = null;
                if (!BiosEmuThiago.GetGame().GetModerationManager().TryGetTicket(Packet.PopInt(), out Ticket))
                {
                    continue;
                }

                Ticket.Moderator = null;
                BiosEmuThiago.GetGame().GetClientManager().SendMessage(new ModeratorSupportTicketComposer(Session.GetHabbo().Id, Ticket), "mod_tool");
            }
        }
Exemple #12
0
        public static Bot CreateBot(ItemData Data, int OwnerId)
        {
            DataRow    BotData = null;
            CatalogBot CataBot = null;

            if (!BiosEmuThiago.GetGame().GetCatalog().TryGetBot(Data.Id, out CataBot))
            {
                return(null);
            }

            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("INSERT INTO bots (`user_id`,`name`,`motto`,`look`,`gender`,`ai_type`) VALUES ('" + OwnerId + "', '" + CataBot.Name + "', '" + CataBot.Motto + "', '" + CataBot.Figure + "', '" + CataBot.Gender + "', '" + CataBot.AIType + "')");
                int Id = Convert.ToInt32(dbClient.InsertQuery());

                dbClient.SetQuery("SELECT `id`,`user_id`,`name`,`motto`,`look`,`gender` FROM `bots` WHERE `user_id` = '" + OwnerId + "' AND `id` = '" + Id + "' LIMIT 1");
                BotData = dbClient.getRow();
            }

            return(new Bot(Convert.ToInt32(BotData["id"]), Convert.ToInt32(BotData["user_id"]), Convert.ToString(BotData["name"]), Convert.ToString(BotData["motto"]), Convert.ToString(BotData["look"]), Convert.ToString(BotData["gender"])));
        }
Exemple #13
0
        public bool CheckMute(GameClient Session)
        {
            if (MutedUsers.ContainsKey(Session.GetHabbo().Id))
            {
                if (MutedUsers[Session.GetHabbo().Id] < BiosEmuThiago.GetUnixTimestamp())
                {
                    MutedUsers.Remove(Session.GetHabbo().Id);
                }
                else
                {
                    return(true);
                }
            }

            if (Session.GetHabbo().TimeMuted > 0 || (RoomMuted && Session.GetHabbo().Username != OwnerName))
            {
                return(true);
            }

            return(false);
        }
Exemple #14
0
        private void CountTeamPoints()
        {
            this._room.GetGameManager().Reset();

            foreach (RoomUser User in this._room.GetRoomUserManager().GetUserList().ToList())
            {
                if (User.IsBot || User.Team == TEAM.NONE || User.GetClient() == null)
                {
                    continue;
                }

                User.banzaiPowerUp = FreezePowerUp.NONE;
                User.FreezeLives   = 3;
                User.shieldActive  = false;
                User.shieldCounter = 11;

                _room.GetGameManager().AddPointToTeam(User.Team, 30);
                User.GetClient().SendMessage(new UpdateFreezeLivesComposer(User.InternalRoomID, User.FreezeLives));
                BiosEmuThiago.GetGame().GetAchievementManager().ProgressAchievement(User.GetClient(), "ACH_FreezePlayer", 1);
            }
        }
        public void Execute(GameClient Session, Room Room, string[] Params)
        {
            TimeSpan Uptime      = DateTime.Now - BiosEmuThiago.ServerStarted;
            int      OnlineUsers = BiosEmuThiago.GetGame().GetClientManager().Count;
            int      RoomCount   = BiosEmuThiago.GetGame().GetRoomManager().Count;

            Session.SendMessage(new RoomNotificationComposer("BiosEmulador O melhor da tecnologia:",
                                                             "<font color=\"#0653b4\"><b>Infomações do BiosEmulador:</b></font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">BiosEmulador para " + BiosEmuThiago.HotelName + " </font>" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">BiosEmulador 1.0 contém todas as características necessárias para um hotel estável. A edição 1.0 foi editada com o que há de melhor para este emulador.</font>\n\n" +
                                                             "<font color=\"#0653b4\" size=\"13\"><b>Informações:</b></font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">  <b> · Usuários: </b> " + OnlineUsers + "</font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">  <b> · Quartos: </b> " + RoomCount + "</font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">  <b> · Tempo On: </b> " + Uptime.Days + " día(s), " + Uptime.Hours + " horas é " + Uptime.Minutes + " minutos.</font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">  <b> · Update: </b> " + DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt") + "</font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">  <b> · Recorde da ultima atualização: </b>  " + Game.SessionUserRecord + "</font>\n\n" +
                                                             "<font color=\"#0653b4\" size=\"13\"><b>Créditos:</b></font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">  <b> · Happy - </b> Thiago Araujo (DEVEMU)</font>\n" +
                                                             "<font size=\"11\" color=\"#1C1C1C\">  <b> · Sain - </b> Messias (DEVSWF) </font>\n\n" +
                                                             "<font color=\"#0077d2\">Licencia:  <b>" + BiosEmuThiago.Licenseto + "</b></font>\n\n", "biostecthiago", ""));
        }
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom)
            {
                return;
            }

            Room Room;

            if (!BiosEmuThiago.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
            {
                return;
            }

            if (!Room.CanTradeInRoom)
            {
                return;
            }

            Room.TryStopTrade(Session.GetHabbo().Id);
        }
Exemple #17
0
        public PostQuizAnswersMessageComposer(GameClient Session) : base(ServerPacketHeader.PostQuizAnswersMessageComposer)
        {
            Random rnd       = new Random();
            int    risposta1 = rnd.Next(0, 3);
            int    risposta2 = rnd.Next(0, 3);
            int    risposta3 = rnd.Next(0, 3);
            int    risposta4 = rnd.Next(0, 3);
            int    risposta5 = rnd.Next(0, 3);

            WriteString("HabboWay1");
            WriteInteger(5);
            WriteInteger(risposta1);
            WriteInteger(risposta2);
            WriteInteger(risposta3);
            WriteInteger(risposta4);
            WriteInteger(risposta5);
            if (risposta5 > rnd.Next(0, 3))
            {
                BiosEmuThiago.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_SafetyQuizGraduate", 1, false);
            }
        }
        public void Parse(GameClient Session, ClientPacket Packet)
        {
            var pic = HabboCameraManager.GetUserPurchasePic(Session);

            if (pic == null)
            {
                return;
            }

            int InsetId;

            using (var Adap = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                Adap.SetQuery("INSERT INTO server_pictures_publish (picture_id, usuariothiago) VALUES (@pic, @thiago)");
                Adap.AddParameter("pic", pic.Id);
                Adap.AddParameter("thiago", Session.GetHabbo().Username);
                InsetId = (int)Adap.InsertQuery();
            }

            Session.SendMessage(new CameraFinishPublishComposer(InsetId));
        }
Exemple #19
0
        public void InitWords()
        {
            if (this._filteredWords.Count > 0)
            {
                this._filteredWords.Clear();
            }
            DataTable Data = null;

            using (var dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT word FROM `wordfilter`");
                Data = dbClient.getTable();
                if (Data != null)
                {
                    foreach (DataRow Row in Data.Rows)
                    {
                        this._filteredWords.Add(Convert.ToString(Row["word"]));
                    }
                }
            }
        }
        public void TryProgressLoginAchievements(GameClient Session)
        {
            if (Session.GetHabbo() == null)
            {
                return;
            }
            UserAchievement loginACH = Session.GetHabbo().GetAchievementData("ACH_Login");

            if (loginACH == null)
            {
                ProgressAchievement(Session, "ACH_Login", 1, true);
                return;
            }

            Double daysBtwLastLogin = BiosEmuThiago.GetUnixTimestamp() - Session.GetHabbo().LastOnline;

            if (daysBtwLastLogin >= 51840 && daysBtwLastLogin <= 112320)
            {
                ProgressAchievement(Session, "ACH_Login", 1, true);
            }
        }
Exemple #21
0
        public void Init()
        {
            this._bases.Clear();
            this._symbols.Clear();
            this._baseColours.Clear();
            this._symbolColours.Clear();
            this._backgroundColours.Clear();

            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT `id`,`type`,`firstvalue`,`secondvalue` FROM `groups_items` WHERE `enabled` = '1'");
                DataTable dItems = dbClient.getTable();

                foreach (DataRow dRow in dItems.Rows)
                {
                    switch (dRow["type"].ToString())
                    {
                    case "base":
                        this._bases.Add(new GroupBadgeParts(Convert.ToInt32(dRow["id"]), dRow["firstvalue"].ToString(), dRow["secondvalue"].ToString()));
                        break;

                    case "symbol":
                        this._symbols.Add(new GroupBadgeParts(Convert.ToInt32(dRow["id"]), dRow["firstvalue"].ToString(), dRow["secondvalue"].ToString()));
                        break;

                    case "color":
                        this._baseColours.Add(new GroupColours(Convert.ToInt32(dRow["id"]), dRow["firstvalue"].ToString()));
                        break;

                    case "color2":
                        this._symbolColours.Add(Convert.ToInt32(dRow["id"]), new GroupColours(Convert.ToInt32(dRow["id"]), dRow["firstvalue"].ToString()));
                        break;

                    case "color3":
                        this._backgroundColours.Add(Convert.ToInt32(dRow["id"]), new GroupColours(Convert.ToInt32(dRow["id"]), dRow["firstvalue"].ToString()));
                        break;
                    }
                }
            }
        }
        public void Execute(GameClient Session, Room Room, string[] Params)
        {
            if (ExtraSettings.STAFF_EFFECT_ENABLED_ROOM)
            {
                if (Session.GetHabbo().isLoggedIn&& Session.GetHabbo().Rank > Convert.ToInt32(BiosEmuThiago.GetConfig().data["MineRankStaff"]))
                {
                }
                else
                {
                    Session.SendWhisper("Você precisa estar logado como staff para usar este comando.");
                    return;
                }
            }
            Dictionary <Habbo, UInt32> clients = new Dictionary <Habbo, UInt32>();

            StringBuilder content = new StringBuilder();

            content.Append("Status da Equipe Iniciada " + BiosEmuThiago.HotelName + ":\r\n");

            foreach (var client in BiosEmuThiago.GetGame().GetClientManager()._clients.Values)
            {
                if (client != null && client.GetHabbo() != null && client.GetHabbo().Rank > 3)
                {
                    clients.Add(client.GetHabbo(), (Convert.ToUInt16(client.GetHabbo().Rank)));
                }
            }

            foreach (KeyValuePair <Habbo, UInt32> client in clients.OrderBy(key => key.Value))
            {
                if (client.Key == null)
                {
                    continue;
                }

                content.Append("¥ " + client.Key.Username + " [Rank: " + client.Key.Rank + "] » Se na sala: " + ((client.Key.CurrentRoom == null) ? "em nenhuma sala." : client.Key.CurrentRoom.RoomData.Name) + "\r\n");
            }

            Session.SendMessage(new MOTDNotificationComposer(content.ToString()));
            return;
        }
Exemple #23
0
        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (ExtraSettings.STAFF_EFFECT_ENABLED_ROOM)
            {
                if (Session.GetHabbo().isLoggedIn&& Session.GetHabbo().Rank > Convert.ToInt32(BiosEmuThiago.GetConfig().data["MineRankStaff"]))
                {
                }
                else
                {
                    Session.SendWhisper("Você precisa estar logado como staff para usar este comando.");
                    return;
                }
            }
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            if (Params.Length == 1)
            {
                Session.SendWhisper("Oh, não se esqueça de inserir o nome do bot!");
                return;
            }

            if (Params.Length == 2)
            {
                Session.SendWhisper("Oh, esqueceu-se de introduzir um ID!");
                return;
            }
            string BotName = CommandManager.MergeParams(Params, 1);
            string Bubble  = CommandManager.MergeParams(Params, 2);

            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.runFastQuery("UPDATE `bots` SET `chat_bubble` =  '" + Params[2] + "' WHERE `name` =  '" + Params[1] + "' AND  `room_id` =  '" + Session.GetHabbo().CurrentRoomId + "'");
                Session.LogsNotif("Você mudou a fala do bot: " + Params[1] + "!", "command_notification");
            }
        }
Exemple #24
0
        public void Execute(GameClient Session, Room Room, string[] Params)
        {
            if (ExtraSettings.STAFF_EFFECT_ENABLED_ROOM)
            {
                if (Session.GetHabbo().isLoggedIn&& Session.GetHabbo().Rank > Convert.ToInt32(BiosEmuThiago.GetConfig().data["MineRankStaff"]))
                {
                }
                else
                {
                    Session.SendWhisper("Você precisa estar logado como staff para usar este comando.");
                    return;
                }
            }
            if (Params.Length != 3)
            {
                Session.SendWhisper("Digite um nome de usuário e um código de emblema que você gostaria de tira!");
                return;
            }

            GameClient client = BiosEmuThiago.GetGame().GetClientManager().GetClientByUsername(Params[1]);

            if (client == null || client.GetHabbo() == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(Convert.ToString(Params[2])))
            {
                return;
            }

            string badge = Convert.ToString(Params[2]);

            if (client.GetHabbo().GetBadgeComponent().HasBadge(badge))
            {
                client.GetHabbo().GetBadgeComponent().RemoveBadge(badge);
                Session.SendMessage(new BroadcastMessageAlertComposer(BiosEmuThiago.GetGame().GetLanguageManager().TryGetValue("server.console.alert") + "\n\n" + "O emblema <b>" + badge + " foi removido de " + client.GetHabbo().Username + " com exito!"));
            }
            return;
        }
        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (Item == null || Item.GetRoom() == null || Session == null || Session.GetHabbo() == null)
            {
                return;
            }

            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            User.LastInteraction = BiosEmuThiago.GetUnixTimestamp();

            // Alright. But is this user in the right position?
            if (User.Coordinate == Item.Coordinate || User.Coordinate == Item.SquareInFront)
            {
                // Fine. But is this tele even free?
                if (Item.InteractingUser != 0)
                {
                    return;
                }

                if (!User.CanWalk || Session.GetHabbo().IsTeleporting || Session.GetHabbo().TeleporterId != 0 ||
                    (User.LastInteraction + 2) - BiosEmuThiago.GetUnixTimestamp() < 0)
                {
                    return;
                }

                User.TeleDelay = 2;

                Item.InteractingUser = User.GetClient().GetHabbo().Id;
            }
            else if (User.CanWalk)
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
        public void SendNameColourPacket()
        {
            if (IsBot || GetClient() == null || GetClient().GetHabbo() == null)
            {
                return;
            }

            if (GetClient().GetHabbo().ChatPreference)
            {
                return;
            }

            string Username;

            if (GetClient().GetHabbo()._NamePrefix == "off" || GetClient().GetHabbo()._NamePrefix == "")
            {
                Username = "******" + GetClient().GetHabbo().chatHTMLColour + "'>" + GetClient().GetHabbo().Username + "</font>";

                if (GetRoom() != null)
                {
                    GetRoom().SendMessage(new UserNameChangeComposer(RoomId, VirtualId, Username));
                }
            }
            else
            {
                if (GetClient().GetHabbo()._NamePrefixColor == "rainbow")
                {
                    Username = "******" + BiosEmuThiago.RainbowT() + "'>[" + GetClient().GetHabbo()._NamePrefix + "]</font> <font color='" + GetClient().GetHabbo().chatHTMLColour + "'>" + GetClient().GetHabbo().Username + "</font>";
                }
                else
                {
                    Username = "******" + GetClient().GetHabbo()._NamePrefixColor + "'>[" + GetClient().GetHabbo()._NamePrefix + "]</font> <font color='" + GetClient().GetHabbo().chatHTMLColour + "'>" + GetClient().GetHabbo().Username + "</font>";
                }

                if (GetRoom() != null)
                {
                    GetRoom().SendMessage(new UserNameChangeComposer(RoomId, VirtualId, Username));
                }
            }
        }
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (!Session.GetHabbo().InRoom)
            {
                return;
            }

            Room Room = null;

            if (!BiosEmuThiago.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
            {
                return;
            }

            int PetId = Packet.PopInt();

            RoomUser Pet = null;

            if (!Room.GetRoomUserManager().TryGetPet(PetId, out Pet))
            {
                return;
            }

            if (Pet.PetData.AnyoneCanRide == 1)
            {
                Pet.PetData.AnyoneCanRide = 0;
            }
            else
            {
                Pet.PetData.AnyoneCanRide = 1;
            }


            using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.runFastQuery("UPDATE `bots_petdata` SET `anyone_ride` = '" + Pet.PetData.AnyoneCanRide + "' WHERE `id` = '" + PetId + "' LIMIT 1");
            }

            Room.SendMessage(new PetInformationComposer(Pet.PetData));
        }
        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (ExtraSettings.STAFF_EFFECT_ENABLED_ROOM)
            {
                if (Session.GetHabbo().isLoggedIn&& Session.GetHabbo().Rank > Convert.ToInt32(BiosEmuThiago.GetConfig().data["MineRankStaff"]))
                {
                }
                else
                {
                    Session.SendWhisper("Você precisa estar logado como staff para usar este comando.");
                    return;
                }
            }
            if (Params.Length == 1)
            {
                Session.SendWhisper("Digite o nome de usuário que deseja alterar.");
                return;
            }

            GameClient TargetClient = BiosEmuThiago.GetGame().GetClientManager().GetClientByUsername(Params[1]);

            if (TargetClient == null)
            {
                Session.SendWhisper("Ocorreu um erro ao procurar o usuário, talvez eles não estejam online.");
                return;
            }

            if (TargetClient.GetHabbo().GetPermissions().HasRight("mod_tool"))
            {
                Session.SendWhisper("O usuário não tem permissão para marcá-lo.");
                return;
            }
            else
            {
                TargetClient.GetHabbo().LastNameChange = 0;
                TargetClient.GetHabbo().ChangingName   = true;
                TargetClient.SendNotification("Por favor, note que, se seu nome de usuário for considerado inapropriado, você será banido sem dúvida. \r\rObserve também que a equipe não permitirá que você altere seu nome de usuário novamente caso tenha um problema com o que você tem escolhido.\r\rFeche esta janela e clique em você mesmo para começar a escolher um novo nome de usuário!");
                TargetClient.SendMessage(new UserObjectComposer(TargetClient.GetHabbo()));
            }
        }
        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            foreach (GameClient Client in BiosEmuThiago.GetGame().GetClientManager().GetClients.ToList())
            {
                if (Client == null || Client.GetHabbo() == null || Client.GetHabbo().Username == Session.GetHabbo().Username)
                {
                    continue;
                }

                Client.SendNotification("¡Acabas de ser atraído por " + Session.GetHabbo().Username + "!");
                if (!Client.GetHabbo().InRoom)
                {
                    Client.SendMessage(new RoomForwardComposer(Session.GetHabbo().CurrentRoomId));
                }
                else if (Client.GetHabbo().InRoom)
                {
                    Client.SendMessage(new RoomForwardComposer(Session.GetHabbo().CurrentRoomId));
                }
            }

            Session.SendWhisper("Acabas de atraer a todo el puto hotel men.");
        }
Exemple #30
0
        public void InitCharacters()
        {
            if (this._filterReplacements.Count > 0)
            {
                this._filterReplacements.Clear();
            }
            DataTable Data = null;

            using (var dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT * FROM `wordfilter_characters`");
                Data = dbClient.getTable();
                if (Data != null)
                {
                    foreach (DataRow Row in Data.Rows)
                    {
                        this._filterReplacements.Add(new WordFilterReplacements(Convert.ToString(Row["character"]),
                                                                                Convert.ToString(Row["replacement"])));
                    }
                }
            }
        }