PlusEMU New Added Colours Don't Stick?

Bran

mediocre graphics artist
Mar 13, 2017
1,726
1,530
hey guys, so i've added about 10 new colours into my namecolours & they work and everything in-game, but they don't save/stick to a users username when they go offline and come back on it just resets to default black? but my other ones i already have save & stick (the ones an old friend did a year or so ago for me) i'm not sure what i'm doing wrong because i'm not a dev so???‍♂️
 

Joe

Well-Known Member
Jun 10, 2012
4,090
1,918
hey guys, so i've added about 10 new colours into my namecolours & they work and everything in-game, but they don't save/stick to a users username when they go offline and come back on it just resets to default black? but my other ones i already have save & stick (the ones an old friend did a year or so ago for me) i'm not sure what i'm doing wrong because i'm not a dev so???‍♂️
Would have a look into this but I’m on my phone, if it’s not resolved I’ll take a look when I’m back!
 

Hypothesis

Programmer
Jan 6, 2019
524
361
hey guys, so i've added about 10 new colours into my namecolours & they work and everything in-game, but they don't save/stick to a users username when they go offline and come back on it just resets to default black? but my other ones i already have save & stick (the ones an old friend did a year or so ago for me) i'm not sure what i'm doing wrong because i'm not a dev so???‍♂️
I thought name colors were just a session thing, I thought they reset when you go offline. What you can probably do is have it set the name color on disconnect.
Go into your Habbo.cs, search for OnDisconnect(), then replace the entire method with this.
Code:
public void OnDisconnect()
        {
            if (this._disconnected)
                return;

            try
            {
                if (this._process != null)
                    this._process.Dispose();
            }
            catch { }

            this._disconnected = true;

            PlusEnvironment.GetGame().GetClientManager().UnregisterClient(Id, Username);

            if (!this._habboSaved)
            {
                this._habboSaved = true;
                using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.RunQuery("UPDATE `users` SET `online` = '0', `namecolor` = '" + this.ChatColor + "'," + " `last_online` = '" + PlusEnvironment.GetUnixTimestamp() + "', `activity_points` = '" + this.Duckets + "', `credits` = '" + this.Credits + "', `vip_points` = '" + this.Diamonds + "', `home_room` = '" + this.HomeRoom + "', `gotw_points` = '" + this.GOTWPoints + "', `time_muted` = '" + this.TimeMuted + "',`friend_bar_state` = '" + FriendBarStateUtility.GetInt(this._friendbarState) + "' WHERE id = '" + Id + "' LIMIT 1;UPDATE `user_stats` SET `roomvisits` = '" + this._habboStats.RoomVisits + "', `onlineTime` = '" + (PlusEnvironment.GetUnixTimestamp() - this.SessionStart + this._habboStats.OnlineTime) + "', `respect` = '" + this._habboStats.Respect + "', `respectGiven` = '" + this._habboStats.RespectGiven + "', `giftsGiven` = '" + this._habboStats.GiftsGiven + "', `giftsReceived` = '" + this._habboStats.GiftsReceived + "', `dailyRespectPoints` = '" + this._habboStats.DailyRespectPoints + "', `dailyPetRespectPoints` = '" + this._habboStats.DailyPetRespectPoints + "', `AchievementScore` = '" + this._habboStats.AchievementPoints + "', `quest_id` = '" + this._habboStats.QuestID + "', `quest_progress` = '" + this._habboStats.QuestProgress + "', `groupid` = '" + this._habboStats.FavouriteGroupId + "',`forum_posts` = '" + this._habboStats.ForumPosts +"' WHERE `id` = '" + this.Id + "' LIMIT 1;");

                    if (GetPermissions().HasRight("mod_tickets"))
                        dbClient.RunQuery("UPDATE `moderation_tickets` SET `status` = 'open', `moderator_id` = '0' WHERE `status` ='picked' AND `moderator_id` = '" + Id + "'");
                }
            }

            this.Dispose();

            this._client = null;

        }

If you have issues with the code, let me know, or DM me on Discord.
 

Bran

mediocre graphics artist
Mar 13, 2017
1,726
1,530
I’ve done this previously by logging the colour (bubble as I did it) in the database.
it's in the database of the users table under color idk if i'm missing something when i added the new colours into the emu? can you add me on discord pls joe Bran#3021
 

Users who are viewing this thread

Top