Esempio n. 1
0
        public void method_46(GameClient Session, bool bool_13)
        {
            RoomUser @class = new RoomUser(Session.GetHabbo().Id, this.Id, this.int_7++, Session.GetHabbo().isVisible);
            if (@class != null && @class.GetClient() != null && @class.GetClient().GetHabbo() != null)
            {
                if (bool_13 || [email protected]_12)
                {
                    @class.bool_11 = true;
                }
                else
                {
                    @class.method_7(this.Class28_0.int_0, this.Class28_0.int_1, this.Class28_0.double_0);
                    @class.method_9(this.Class28_0.int_2);
                    if (this.CheckRights(Session, true))
                    {
                        @class.AddStatus("flatctrl", "useradmin");
                    }
                    else
                    {
                        if (this.method_26(Session))
                        {
                            @class.AddStatus("flatctrl", "");
                        }
                    }
                    if ([email protected] && @class.GetClient().GetHabbo().bool_7)
                    {
                        RoomItem class2 = this.method_28(@class.GetClient().GetHabbo().uint_5);
                        if (class2 != null)
                        {
                            @class.method_7(class2.Int32_0, class2.Int32_1, class2.Double_0);
                            @class.method_9(class2.int_3);
                            class2.uint_4 = Session.GetHabbo().Id;
                            class2.ExtraData = "2";
                            class2.UpdateState(false, true);
                        }
                    }
                    @class.GetClient().GetHabbo().bool_7 = false;
                    @class.GetClient().GetHabbo().uint_5 = 0u;
                    ServerMessage Message = new ServerMessage(28u);
                    Message.AppendInt32(1);
                    @class.method_14(Message);
                    this.SendMessage(Message, null);
                }
                int num = this.method_5();
                @class.int_20 = num;
                this.RoomUser_0[num] = @class;
                if (!bool_13)
                {
                    this.bool_10 = true;
                }
                Session.GetHabbo().CurrentRoomId = this.uint_0;
                Session.GetHabbo().GetMessenger().method_5(false);
                Session.GetHabbo().RoomVisits++;
                Session.GetHabbo().CheckRoomEntryAchievements();
                Session.GetHabbo().method_10(this.uint_0);
                if (Session.GetHabbo().int_0 > 0)
                {
                    GroupsManager class3 = Groups.smethod_2(Session.GetHabbo().int_0);
                    if (class3 != null && !this.list_17.Contains(class3))
                    {
                        this.list_17.Add(class3);
                        ServerMessage Message2 = new ServerMessage(309u);
                        Message2.AppendInt32(this.list_17.Count);
                        foreach (GroupsManager current in this.list_17)
                        {
                            Message2.AppendInt32(current.int_0);
                            Message2.AppendStringWithBreak(current.string_2);
                        }
                        this.SendMessage(Message2, null);
                    }
                }
                if (!bool_13)
                {
                    this.method_51();
                    for (int i = 0; i < this.RoomUser_0.Length; i++)
                    {
                        RoomUser class4 = this.RoomUser_0[i];
                        if (class4 != null && class4.IsBot)
                        {
                            class4.BotAI.OnUserEnterRoom(@class);
                        }
                    }
                }

                bool RoomHasPoll = false;
                bool UserFilledPoll = false;
                using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient())
                {
                    if (dbClient.ReadDataRow("SELECT null FROM room_polls WHERE room_id = '" + Session.GetHabbo().CurrentRoomId + "' LIMIT 1") != null)
                    {
                        RoomHasPoll = true;
                    }
                }

                if (RoomHasPoll == true)
                {

                    int PollId;
                    string PollDetails;

                    using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient())
                    {
                        PollId = dbClient.ReadInt32("SELECT id FROM room_polls WHERE room_id = '" + Session.GetHabbo().CurrentRoomId + "' LIMIT 1");
                        PollDetails = dbClient.ReadString("SELECT details FROM room_polls WHERE id = '" + PollId + "' LIMIT 1");

                        if (dbClient.ReadDataRow("SELECT null FROM room_poll_results WHERE user_id = '" + Session.GetHabbo().Id + "' AND poll_id = '" + PollId + "' LIMIT 1") != null)
                        {
                            UserFilledPoll = true;
                        }

                    }

                    if (UserFilledPoll == false)
                    {
                        Thread ShowPoll = new Thread(delegate() { Room.ShowPoll(Session, PollId, PollDetails); });
                        ShowPoll.Start();

                    }

                }
            }
        }
Esempio n. 2
0
 public RoomUser method_4(RoomBot Bot, Pet PetData)
 {
     int num = this.method_5();
     RoomUser user = new RoomUser(Convert.ToUInt32(num + 100000), this.Id, this.int_7++, true);
     user.int_20 = num;
     this.RoomUser_0[num] = user;
     if (Bot.x > 0 && Bot.y > 0 && Bot.x < this.Class28_0.int_4 && Bot.y < this.Class28_0.int_5)
     {
         user.method_7(Bot.x, Bot.y, Bot.z);
         user.method_9(Bot.Rotation);
     }
     else
     {
         Bot.x = this.Class28_0.int_0;
         Bot.y = this.Class28_0.int_1;
         user.method_7(this.Class28_0.int_0, this.Class28_0.int_1, this.Class28_0.double_0);
         user.method_9(this.Class28_0.int_2);
     }
     user.class34_0 = Bot;
     user.BotAI = Bot.method_4(user.VirtualId);
     if (user.isPet)
     {
         user.BotAI.Init((int)Bot.Id, user.VirtualId, this.Id);
         user.PetData = PetData;
         user.PetData.VirtualId = user.VirtualId;
     }
     else
     {
         user.BotAI.Init(-1, user.VirtualId, this.Id);
     }
     this.method_87(user, true, true);
     user.UpdateNeeded = true;
     ServerMessage Message = new ServerMessage(28u);
     Message.AppendInt32(1);
     user.method_14(Message);
     this.SendMessage(Message, null);
     user.BotAI.OnSelfEnterRoom();
     return user;
 }