MasterJiq
Member
- Jul 8, 2016
- 385
- 23
Hello,
Could someone please help me, I mean tell me which one I have to fix? When I clicked on user profile it appeared just like %count% & relationship seems not work.
On the emulator, I got this error message:
Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.OrderedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IComparer`1 comparer, Boolean descending)
at System.Linq.Enumerable.OrderBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at Plus.Communication.Packets.Incoming.Users.GetRelationshipsEvent.Parse(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\Incoming\Users\GetRelationshipsEvent.cs:line 20
at Plus.Communication.Packets.PacketManager.TryExecutePacket(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\PacketManager.cs:line 154
at Plus.HabboHotel.GameClients.GameClient.parser_onNewPacket(ClientPacket Message) in C:\Users\Haziq\Desktop\Emulator\HabboHotel\GameClients\GameClient.cs:line 73
Thanks. Hope someone could help me
GetRelationshipsEvent.cs
Could someone please help me, I mean tell me which one I have to fix? When I clicked on user profile it appeared just like %count% & relationship seems not work.
You must be registered for see images attach
You must be registered for see images attach
On the emulator, I got this error message:
Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.OrderedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IComparer`1 comparer, Boolean descending)
at System.Linq.Enumerable.OrderBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at Plus.Communication.Packets.Incoming.Users.GetRelationshipsEvent.Parse(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\Incoming\Users\GetRelationshipsEvent.cs:line 20
at Plus.Communication.Packets.PacketManager.TryExecutePacket(GameClient Session, ClientPacket Packet) in C:\Users\Haziq\Desktop\Emulator\Communication\Packets\PacketManager.cs:line 154
at Plus.HabboHotel.GameClients.GameClient.parser_onNewPacket(ClientPacket Message) in C:\Users\Haziq\Desktop\Emulator\HabboHotel\GameClients\GameClient.cs:line 73
Thanks. Hope someone could help me
Post automatically merged:
GetRelationshipsEvent.cs
C#:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.HabboHotel.Users;
using Plus.Communication.Packets.Outgoing.Users;
namespace Plus.Communication.Packets.Incoming.Users
{
class GetRelationshipsEvent : IPacketEvent
{
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
Habbo Habbo = PlusEnvironment.GetHabboById(Packet.PopInt());
if (Habbo == null)
return;
var rand = new Random();
Habbo.Relationships = Habbo.Relationships.OrderBy(x => rand.Next()).ToDictionary(item => item.Key, item => item.Value);
int Loves = Habbo.Relationships.Count(x => x.Value.Type == 1);
int Likes = Habbo.Relationships.Count(x => x.Value.Type == 2);
int Hates = Habbo.Relationships.Count(x => x.Value.Type == 3);
Session.SendPacket(new GetRelationshipsComposer(Habbo, Loves, Likes, Hates));
}
}
}