[PlusEMU] Avatar Looks Update (Help) [Missing]

Status
Not open for further replies.

Rebel

Spilling the tea, can't you read?🍵
Dec 24, 2015
186
161
Hey Devbest members, I've managed to fix the avatar looks updating in the UI bar on the bottom left AKA the baby blue highlighted box SHOWN in Image, just didn't show it fixed in this specific Screenshot. I just can't figure out how to fix the one Highlighted in YELLOW so when a user updates their avatar looks it updates on the friends UI BAR. If anyone knows the fix to this please feel free to help me or comment the fix, Thanks in advance.

P.S
Just need the Yellow high lighted one to update I manage to fix the blue high lighted one.


andNN4HpQsWa4lZ5eqqBmw.png


 
@Core @Sledmore @Damien @JMG @HDN @Westyy @Jaden @Jerry
 
Last edited:

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Pretty sure it's a packet that needs adding, I think Westyy released it in an old help thread
Aye, I did.

You'll obviously need to edit the packet ID
add this to your ServerPacketHeader.cs
Code:
public const int AvatarAspectUpdateMessageComposer = 3283;

in Plus.Communication.Packets.Outgoing.Rooms.Engine Create a new file called AvatarAspectUpdateMessageComposer
insert this
Code:
using System;
using System.Linq;
using System.Text;

using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.GameClients;

namespace Plus.Communication.Packets.Outgoing.Rooms.Engine
{    
    class AvatarAspectUpdateMessageComposer : ServerPacket    
      {        
          public AvatarAspectUpdateMessageComposer(string Figure, string Gender)          
               : base(ServerPacketHeader.AvatarAspectUpdateMessageComposer)        
          {          
                base.WriteString(Figure);            
                base.WriteString(Gender);

        }    
    }
 }
then under this in UpdateFigureDataEvent
Code:
PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_AvatarLooks", 1);
insert this
Code:
Session.SendMessage(new AvatarAspectUpdateMessageComposer(Look, Gender));
 

CosmoPeak

PeakRP.com
May 15, 2016
271
268
I can't be bothered to do the code, but yeah, basically what Haid said. In FriendListUpdateComposer there's a bit commented out on line 44 (not sure if this is for any particular reason), you could try putting the comments bit back in the brackets - I assume it would work.

base.WriteString("");//Habbo.IsOnline ? Habbo.Look : "");

to

base.WriteString(Habbo.IsOnline ? Habbo.Look : "");

You'd then have to send this to all of the user's friends when their look changes.

The bits JMG/Westy posted are for the blue box you highlighted (which you said you already fixed).
 
Scratch what i said above, just do this (tested and works):

Add this to the bottom of UpdateFigureDataEvent:

Code:
            foreach (var buddy in Session.GetHabbo().GetMessenger().GetFriends())
            {
                if (buddy.client == null)
                    continue;
           
                buddy.client.GetHabbo().GetMessenger().UpdateFriend(Session.GetHabbo().Id, Session, true);
            }

Change MessengerBuddy.UpdateUser(GameClient) to this (starts at line 80):

Code:
        public void UpdateUser(GameClient client)
        {
            if (client?.GetHabbo() == null)
            {
                return;
            }

            this.client = client;

            currentRoom = client.GetHabbo().CurrentRoom;
            mLook = client.GetHabbo().Look;
        }

Edit: I'd recommend using the snippet from @Jerry below instead of the for loop:

Code:
if (Session.GetHabbo().GetMessenger() != null)
{
   Session.GetHabbo().GetMessenger().OnStatusChanged(true);
}
 
Last edited:

Jerry

not rly active lol
Jul 8, 2013
1,956
522
Or, instead of the foreach loop Luke mentioned, you can just put this at the bottom of the UpdateFigureDataEvent.cs file:
Code:
if (Session.GetHabbo().GetMessenger() != null)
    Session.GetHabbo().GetMessenger().OnStatusChanged(true);
 

Rebel

Spilling the tea, can't you read?🍵
Dec 24, 2015
186
161
I can't be bothered to do the code, but yeah, basically what Haid said. In FriendListUpdateComposer there's a bit commented out on line 44 (not sure if this is for any particular reason), you could try putting the comments bit back in the brackets - I assume it would work.

base.WriteString("");//Habbo.IsOnline ? Habbo.Look : "");

to

base.WriteString(Habbo.IsOnline ? Habbo.Look : "");

You'd then have to send this to all of the user's friends when their look changes.

The bits JMG/Westy posted are for the blue box you highlighted (which you said you already fixed).
 
Scratch what i said above, just do this (tested and works):

Add this to the bottom of UpdateFigureDataEvent:

Code:
            foreach (var buddy in Session.GetHabbo().GetMessenger().GetFriends())
            {
                if (buddy.client == null)
                    continue;
           
                buddy.client.GetHabbo().GetMessenger().UpdateFriend(Session.GetHabbo().Id, Session, true);
            }

Change MessengerBuddy.UpdateUser(GameClient) to this (starts at line 80):

Code:
        public void UpdateUser(GameClient client)
        {
            if (client?.GetHabbo() == null)
            {
                return;
            }

            this.client = client;

            currentRoom = client.GetHabbo().CurrentRoom;
            mLook = client.GetHabbo().Look;
        }
Thank you for the help I appreciate it, only ran into one problem I'll post the screenshot explaining what it is if you know why this is happening and can help I'd appreciate it thank you again.

D4jVZwPYRruoK0327FJOOQ.png
 

CosmoPeak

PeakRP.com
May 15, 2016
271
268
Thank you for the help I appreciate it, only ran into one problem I'll post the screenshot explaining what it is if you know why this is happening and can help I'd appreciate it thank you again.

D4jVZwPYRruoK0327FJOOQ.png
Looks like you found a bug in Plus.

Change the for loop starting at line 102 to this:

Code:
            foreach (GameClient client in onlineUsers.ToList())
            {
                try
                {
                    if (client?.GetHabbo()?.GetMessenger() == null)
                        continue;

                    client.GetHabbo().GetMessenger().UpdateFriend(_userId, GetClient(), true);

                    UpdateFriend(client.GetHabbo().Id, client, notification);
                }
                catch
                {
                    continue;
                }
            }
 

Rebel

Spilling the tea, can't you read?🍵
Dec 24, 2015
186
161
Looks like you found a bug in Plus.

Change the for loop starting at line 102 to this:

Code:
            foreach (GameClient client in onlineUsers.ToList())
            {
                try
                {
                    if (client?.GetHabbo()?.GetMessenger() == null)
                        continue;

                    client.GetHabbo().GetMessenger().UpdateFriend(_userId, GetClient(), true);

                    UpdateFriend(client.GetHabbo().Id, client, notification);
                }
                catch
                {
                    continue;
                }
            }
Never mind I figured it out, it was because I used Jerry's code in the UpdateFigureDataEvent and not the one you provided me. Yours fixed it tho, I thought maybe I'd try Jerry's since it mentioned a loop but I see why it has one now. Thank you all for the help appreciate it a lot.
P.S
Should I still change line 102, or just leave it since it's working fine?
 

CosmoPeak

PeakRP.com
May 15, 2016
271
268
Never mind I figured it out, it was because I used Jerry's code in the UpdateFigureDataEvent and not the one you provided me. Yours fixed it thought maybe I'd try Jerry's since it mentioned a loop but I see why it has one now. Thank you all for the help appreciate it a lot.
P.S
Should I still change line 102?
Yeah, my code had the same issue, it's a bug in the emulator unrelated to either piece of code. The method Jeremy posted does the same as my for loop, just in its own method. You can use either. If you join a room without my latest change, you'll probably see the look change back to your own on the other client.
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
I can't be bothered to do the code, but yeah, basically what Haid said. In FriendListUpdateComposer there's a bit commented out on line 44 (not sure if this is for any particular reason), you could try putting the comments bit back in the brackets - I assume it would work.

base.WriteString("");//Habbo.IsOnline ? Habbo.Look : "");

to

base.WriteString(Habbo.IsOnline ? Habbo.Look : "");

You'd then have to send this to all of the user's friends when their look changes.

The bits JMG/Westy posted are for the blue box you highlighted (which you said you already fixed).
 
Scratch what i said above, just do this (tested and works):

Add this to the bottom of UpdateFigureDataEvent:

Code:
            foreach (var buddy in Session.GetHabbo().GetMessenger().GetFriends())
            {
                if (buddy.client == null)
                    continue;
           
                buddy.client.GetHabbo().GetMessenger().UpdateFriend(Session.GetHabbo().Id, Session, true);
            }

Change MessengerBuddy.UpdateUser(GameClient) to this (starts at line 80):

Code:
        public void UpdateUser(GameClient client)
        {
            if (client?.GetHabbo() == null)
            {
                return;
            }

            this.client = client;

            currentRoom = client.GetHabbo().CurrentRoom;
            mLook = client.GetHabbo().Look;
        }
Code:
base.WriteString("");//Habbo.IsOnline ? Habbo.Look : "");

to

base.WriteString(Habbo.IsOnline ? Habbo.Look : "");

The above code is not valid. Habbo is a class. It needs to be this:
Code:
base.WriteString((Buddy.client.GetHabbo() != null) ? Buddy.client.GetHabbo().Look : "");//Habbo.IsOnline ? Habbo.Look : "");
 

CosmoPeak

PeakRP.com
May 15, 2016
271
268
Code:
base.WriteString("");//Habbo.IsOnline ? Habbo.Look : "");

to

base.WriteString(Habbo.IsOnline ? Habbo.Look : "");

The above code is not valid. Habbo is a class. It needs to be this:
Code:
base.WriteString((Buddy.client.GetHabbo() != null) ? Buddy.client.GetHabbo().Look : "");//Habbo.IsOnline ? Habbo.Look : "");
? This post is already resolved.

And my bad with that, I'm guessing Habbo used to be a variable in that class. I don't think that class is actually used anymore anyway, so no need to edit it. The working solution can be found above.
 
Last edited:

JayC

Always Learning
Aug 8, 2013
5,493
1,398
? This post is already resolved.

And my bad with that, I'm guessing Habbo used to be a variable in that class. I don't think that class is actually used anymore anyway, so no need to edit it. The working solution can be found above.
Oh i was just reviewing this code and adding it into my plus emu and found that so just posted the above incase anyone else follows it from Top of thread down
 
Status
Not open for further replies.

Users who are viewing this thread

Top