Esempio n. 1
0
		public TeleUserData(GameClientMessageHandler pHandler, Habbo pUserRefference, uint RoomId, uint TeleId)
		{
			this.class17_0 = pHandler;
			this.class11_0 = pUserRefference;
			this.uint_0 = RoomId;
			this.uint_1 = TeleId;
		}
Esempio n. 2
0
 public GuideTicket(Habbo creator, Habbo guide)
 {
     this.CreatorId = creator.Id;
     this.GuideId = guide.Id;
     this.CreatorLook = creator.Figure;
     this.CreatorName = creator.Username;
     this.GuideLook = guide.Figure;
     this.GuideName = guide.Username;
     this.Answered = false;
 }
Esempio n. 3
0
 internal SnowStorm(Habbo warowner)
 {
     WarsData stormWars = Essential.GetGame().GetStormWars();
     stormWars.LastWarId++;
     this.WarId = Essential.GetGame().GetStormWars().LastWarId;
     this.WarLevel = 9;
     this.WarOwner = warowner;
     this.WarUsers = new List<Habbo>();
     this.WarStarted = 0;
     this.MaxUsers = 10;
     this.Model = Essential.GetGame().GetStormWars().RoomModel[this.WarLevel];
     this.Kvalue = 0;
     Essential.GetGame().GetStormWars().Wars.Add(this.WarId, this);
     this.Countdown = 3;
     RoomData class2 = new RoomData();
     class2.FillNull((uint)WarId);
     class2.Owner = "Rootkit";
     class2.Name = "SnowStorm Level " + WarLevel;
     this.SnowRoom = new Room(class2.Id, class2.Name, class2.Description, class2.Type, class2.Owner, class2.Category, class2.State, class2.UsersMax,"model_a", class2.CCTs, class2.Score, class2.Tags, class2.AllowPet, class2.AllowPetsEating, class2.AllowWalkthrough, class2.Hidewall, class2.Icon, class2.Password, class2.Wallpaper, class2.Floor, class2.Landscape, class2, class2.bool_3, class2.Wallthick, class2.Floorthick, class2.Achievement, this.Model.HeightMap, class2.HideOwner,false);
 }
Esempio n. 4
0
 public void CreateTicket(Habbo Creator, Habbo Guide)
 {
     try
     {
         this.Tickets.Add(new GuideTicket(Creator, Guide));
         this.GuidesOnDuty.Values.Where(o => o.Id == Guide.Id).ToArray()[0].IsInUse = true;
     }
     catch { }
 }
Esempio n. 5
0
        internal void tryLogin(string AuthTicket)
		{
            try
            {
                UserDataFactory @class = new UserDataFactory(AuthTicket, this.GetConnection().String_0, true);
                if ([email protected])
                {
                    @class = new UserDataFactory(AuthTicket,this.GetConnection().String_0, true);
                }
                if ([email protected])
                {
                    string str = "";
                    if (ServerConfiguration.EnableSSO)
                    {
                        str = EssentialEnvironment.GetExternalText("emu_sso_wrong_secure") + "(" + this.GetConnection().String_0 + ")";
                    }
                    SendNotifWithScroll(EssentialEnvironment.GetExternalText("emu_sso_wrong") + str);
                    return;
                }
                Habbo class2 = Authenticator.CreateHabbo(AuthTicket, this, @class, @class);
                Essential.GetGame().GetClientManager().Disconnect(class2.Id,"New Session");
                this.Habbo = class2;
                this.Habbo.method_2(@class);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Logging login error because you are on alpha test!");
                Logging.LogException(ex.ToString());
                if (this != null)
                {
                    this.SendNotification(ex.ToString());
                    this.Disconnect("Login Error");
                }
                return;
            }

			try
			{
				Essential.GetGame().GetBanManager().method_1(this);
			}
			catch (ModerationBanException gException)
			{
				this.NotifyBan(gException.Message);
				this.Disconnect("Banned!");
				return;
            }
            #region "AKS"
            if (this.MachineId != "" && !Essential.StringToBoolean(this.GetHabbo().GetUserDataFactory().GetUserData()["staff_inacc"].ToString()))
            {
                using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                {
                    string oldMachineId = dbClient.SpecialString("SELECT machineId FROM user_machineids WHERE userid=" + this.GetHabbo().Id);

                    dbClient.AddParamWithValue("machineid", this.MachineId);
                    if ((oldMachineId == "" || oldMachineId != this.MachineId))
                    {
                        dbClient.AddParamWithValue("username", this.GetHabbo().Username);
                        dbClient.ExecuteQuery("INSERT INTO user_machineids (username,userid,timestamp,machineId) VALUES (@username," + this.GetHabbo().Id + ",'" + Convert.ToInt32(Essential.GetUnixTimestamp()) + "',@machineid)");
                    }
                   
                }
            }
            #endregion
            ServerMessage Message2 = new ServerMessage(Outgoing.Fuserights);
            if (this == null || this.GetHabbo() == null)
                return;
			if (this.GetHabbo().IsVIP || ServerConfiguration.HabboClubForClothes)
			{
				Message2.AppendInt32(2);
			}
			else
			{
                if (this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
				{
					Message2.AppendInt32(1);
				}
				else
				{
					Message2.AppendInt32(0);
				}
			}
			if (this.GetHabbo().HasFuse("acc_anyroomowner"))
			{
				Message2.AppendInt32(7);
			}
			else
			{
				if (this.GetHabbo().HasFuse("acc_anyroomrights"))
				{
					Message2.AppendInt32(5);
				}
				else
				{
					if (this.GetHabbo().HasFuse("acc_supporttool"))
					{
						Message2.AppendInt32(4);
					}
					else
					{
                        if (this.GetHabbo().IsVIP || ServerConfiguration.HabboClubForClothes || this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
						{
							Message2.AppendInt32(2);
						}
						else
						{
							Message2.AppendInt32(0);
						}
					}
				}
			}

			this.SendMessage(Message2);

            this.SendMessage(this.GetHabbo().GetEffectsInventoryComponent().method_6());
            
            ServerMessage Message3 = new ServerMessage(Outgoing.AvailabilityStatus);
			Message3.AppendBoolean(true);
			Message3.AppendBoolean(false);
			this.SendMessage(Message3);
            ServerMessage message = new ServerMessage(Outgoing.UniqueID);
            message.AppendString(this.MachineId);
            this.SendMessage(message);
            ServerMessage Message5_ = new ServerMessage(Outgoing.AuthenticationOK);
		    this.SendMessage(Message5_);
            
            if (GetHabbo().HomeRoomId <= 0)
                GetHabbo().HomeRoomId = 64259;
            ServerMessage Message5 = new ServerMessage(Outgoing.HomeRoom);
            Message5.AppendUInt(this.GetHabbo().HomeRoomId);
            Message5.AppendUInt(this.GetHabbo().HomeRoomId);
            this.SendMessage(Message5);
            Console.WriteLine("[" + this.GetConnection().UInt32_0 + "] [" + this.GetHabbo().Username + "] [" + this.GetHabbo().Id + "] [" + this.GetConnection().String_0 + "] [" + DateTime.Now.Hour + ":" + DateTime.Now.Minute + "]");
            GetHabbo().UpdateCredits(false);
            GetHabbo().UpdateActivityPoints(false);
            if (this.GetHabbo().HasFuse("acc_supporttool"))
            {
                this.SendMessage(Essential.GetGame().GetModerationTool().SerializeTool());
             Essential.GetGame().GetModerationTool().method_4(this);
            }
			if (Essential.GetGame().GetPixelManager().CanHaveReward(this))
			{
				Essential.GetGame().GetPixelManager().UpdateNeeded(this);
			}

            ServerMessage Message6 = new ServerMessage(Outgoing.FavouriteRooms);
			Message6.AppendInt32(30);
			Message6.AppendInt32(this.GetHabbo().list_1.Count);
			foreach (uint current in this.GetHabbo().list_1)
			{
				Message6.AppendUInt(current);
			}
			this.SendMessage(Message6);
            try
            {
                this.GetHabbo().CheckTotalTimeOnlineAchievements();
                this.GetHabbo().CheckHappyHourAchievements();
                this.GetHabbo().CheckTrueHabboAchievements();
                this.GetHabbo().CheckRegularVisitorAchievements();
                this.GetHabbo().CheckFootballGoalHostScoreAchievements();
                this.GetHabbo().CheckStaffPicksAchievement();
            }
            catch { }
			if (ServerConfiguration.MOTD != "")
			{
				this.SendNotification(ServerConfiguration.MOTD, 2);
			}
            for (uint num = (uint)Essential.GetGame().GetRoleManager().GetRankCount(); num > 1u; num -= 1u)
			{
                if (Essential.GetGame().GetRoleManager().GetBadgeByRank(num).Length > 0)
				{
                    if (!this.GetHabbo().GetBadgeComponent().HasBadge(Essential.GetGame().GetRoleManager().GetBadgeByRank(num)) && this.GetHabbo().Rank == num)
					{
                        this.GetHabbo().GetBadgeComponent().SendBadge(this, Essential.GetGame().GetRoleManager().GetBadgeByRank(num), true);
					}
					else
					{
                        if (this.GetHabbo().GetBadgeComponent().HasBadge(Essential.GetGame().GetRoleManager().GetBadgeByRank(num)) && this.GetHabbo().Rank < num)
						{
                            this.GetHabbo().GetBadgeComponent().RemoveBadge(Essential.GetGame().GetRoleManager().GetBadgeByRank(num));
						}
					}
				}
			}
            if (this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
			{
                this.GetHabbo().CheckHCAchievements();
			}
			if (this.GetHabbo().IsVIP && !this.GetHabbo().GetBadgeComponent().HasBadge("VIP"))
			{
				this.GetHabbo().GetBadgeComponent().SendBadge(this, "VIP", true);
			}
			else
			{
				if (!this.GetHabbo().IsVIP && this.GetHabbo().GetBadgeComponent().HasBadge("VIP"))
				{
					this.GetHabbo().GetBadgeComponent().RemoveBadge("VIP");
				}
			}
			if (this.GetHabbo().CurrentQuestId > 0u)
			{
				Essential.GetGame().GetQuestManager().ActivateQuest(this.GetHabbo().CurrentQuestId, this);
			}
			if (!Regex.IsMatch(this.GetHabbo().Username, "^[-a-zA-Z0-9._:,]+$"))
			{
                ServerMessage Message5_2 = new ServerMessage(Outgoing.Disconnect);
				this.SendMessage(Message5_2);
			}
			this.GetHabbo().Motto = Essential.FilterString(this.GetHabbo().Motto);
			DataTable dataTable = null;
			using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
			{
				dataTable = class3.ReadDataTable("SELECT achievement,achlevel FROM achievements_owed WHERE user = '******'");
			}
			if (dataTable != null)
			{
				foreach (DataRow dataRow in dataTable.Rows)
				{
					Essential.GetGame().GetAchievementManager().addAchievement(this, (uint)dataRow["achievement"], (int)dataRow["achlevel"]);
					using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
					{
						class3.ExecuteQuery(string.Concat(new object[]
						{
							"DELETE FROM achievements_owed WHERE achievement = '",
							(uint)dataRow["achievement"],
							"' AND user = '******' LIMIT 1"
						}));
					}
				}
			}
            if(this.GetHabbo().list_2 != null && this.GetHabbo().list_2.Count > 0)
            {
                ServerMessage IgnoringList = new ServerMessage(Outgoing.IgnoringList);
                IgnoringList.AppendInt32(this.GetHabbo().list_2.Count);
                foreach(uint userId in this.GetHabbo().list_2)
                {
                    IgnoringList.AppendString(Essential.GetGame().GetClientManager().GetNameById(userId));
                }
                this.SendMessage(IgnoringList);
            }
            //this.GetClientMessageHandler().method_5(this.GetHabbo().HomeRoomId, "");
		}
Esempio n. 6
0
		public void Dispose()
		{
			if (this.Connection != null)
			{
				this.Connection.Close();
				this.Connection = null;
			}
			if (this.GetHabbo() != null)
			{
				this.Habbo.Dispose();
				this.Habbo = null;
			}
			if (this.GetClientMessageHandler() != null)
			{
				this.ClientMessageHandler.Destroy();
				this.ClientMessageHandler = null;
			}
		}