Advertisement
Guest User

userprofile fix

a guest
Jun 1st, 2014
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.69 KB | None | 0 0
  1. internal void LoadProfile()
  2.         {
  3.             uint userId = this.Request.PopWiredUInt();
  4.             this.Request.PopWiredBoolean();
  5.  
  6.  
  7.             Habbo Habbo = SilverwaveEnvironment.getHabboForId(userId);
  8.             if (Habbo == null)
  9.             {8
  10.                 this.Session.SendNotif("This user may not exist.");
  11.                 return;
  12.             }
  13.             DateTime CreateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Habbo.CreateDate);
  14.  
  15.  
  16.             this.Response.Init(Outgoing.ProfileInformation);
  17.             this.Response.AppendInt32(Habbo.Id);
  18.             this.Response.AppendString(Habbo.Username);
  19.             this.Response.AppendString(Habbo.Look);
  20.             this.Response.AppendString(Habbo.Motto);
  21.             this.Response.AppendString(CreateTime.ToString("dd/MM/yyyy"));
  22.             this.Response.AppendInt32(Habbo.AchievementPoints);
  23.             this.Response.AppendInt32(this.getFriendsCount(userId));
  24.             this.Response.AppendBoolean(Habbo.Id != this.Session.GetHabbo().Id && this.Session.GetHabbo().GetMessenger().FriendshipExists(Habbo.Id));
  25.             this.Response.AppendBoolean(Habbo.Id != this.Session.GetHabbo().Id && !this.Session.GetHabbo().GetMessenger().FriendshipExists(Habbo.Id) && this.Session.GetHabbo().GetMessenger().RequestExists(Habbo.Id));
  26.             this.Response.AppendBoolean(SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUserID(Habbo.Id) != null);
  27.             List<GroupUser> Groups = SilverwaveEnvironment.GetGame().GetGroupManager().GetUserGroups(Habbo.Id);
  28.             this.Response.AppendInt32(Groups.Count);
  29.             foreach (GroupUser GroupUs in Groups)
  30.             {
  31.                 Group Group = SilverwaveEnvironment.GetGame().GetGroupManager().GetGroup(GroupUs.GroupId);
  32.                 if (Group != null)
  33.                 {
  34.                     this.Response.AppendInt32(Group.Id);
  35.                     this.Response.AppendString(Group.Name);
  36.                     this.Response.AppendString(Group.Badge);
  37.                     this.Response.AppendString(SilverwaveEnvironment.GetGame().GetGroupManager().GetGroupColour(Group.Colour1, true));
  38.                     this.Response.AppendString(SilverwaveEnvironment.GetGame().GetGroupManager().GetGroupColour(Group.Colour2, false));
  39.                     this.Response.AppendBoolean(Group.Id == Habbo.FavouriteGroup);
  40.                     this.Response.AppendInt32(-1);
  41.                     this.Response.AppendBoolean(true);
  42.                 }
  43.                 else
  44.                 {
  45.                     this.Response.AppendInt32(1);
  46.                     this.Response.AppendString("");
  47.                     this.Response.AppendString("");
  48.                     this.Response.AppendString("");
  49.                     this.Response.AppendString("");
  50.                     this.Response.AppendBoolean(false);
  51.                     this.Response.AppendInt32(-1);
  52.                     this.Response.AppendBoolean(false);
  53.                 }
  54.             }
  55.             this.Response.AppendInt32(checked(SilverwaveEnvironment.GetUnixTimestamp() - Habbo.LastOnline));
  56.             this.Response.AppendBoolean(true);
  57.             this.SendResponse();
  58.            
  59.             this.Response.Init(Outgoing.GetUserBadges);
  60.             this.Response.AppendInt32(Habbo.Id);
  61.             this.Response.AppendInt32(Habbo.GetBadgeComponent().EquippedCount);
  62.  
  63.  
  64.             foreach (Badge Badge in Habbo.GetBadgeComponent().BadgeList.Values)
  65.             {
  66.                 if (Badge.Slot > 0)
  67.                 {
  68.                     this.Response.AppendInt32(Badge.Slot);
  69.                     this.Response.AppendString(Badge.Code);
  70.                 }
  71.             }
  72.             this.SendResponse();
  73.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement