Alright, been working at this for a day now. Just to be clear I am NOT using NCS, I'm helping a friend out.
Anywho, I upgraded NCS to 5180 for him, and now I'm working on updating packets. Most are done, but erm one problem I'm having right now is nobility.
When I login the icon is showing up, but when I hover over the icon, its saying my donation is 0, I'm a commoner, and that my place is 0. When I breakpointed, my locals showed me donation at 81641289, my rank as a commoner, and my place as 2. Its confusing me.
And at that, the nobility list isn't filling up. I updated the packets thanks to Jose's 5180 he worked on ages ago. But yeah, anyone know what the problem could be. Here's my structure for the Icon sending.
Icon Sending
Code:
public static COPacket Donators(Game.Character C)
{
string str = C.EntityID.ToString() + " " + C.Nobility.Donation.ToString() + " " + ((byte)C.Nobility.Rank).ToString() + " " + C.Nobility.ListPlace.ToString();
byte[] Packet = new byte[8 + 33 + str.Length];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)2064);
P.WriteInt32(3);
P.WriteInt32(C.EntityID);
P.Set(32);//Sets the writers position to 32
P.WriteByte(1);
P.WriteByte((byte)str.Length);
P.WriteString(str);
return P;
}
SendTopDonators
Code:
public static COPacket SendTopDonaters(uint Page)
{
string Str = "";
for (int i = (int)(Page * 10); i < Page * 10 + 10; i++)
{
if (Game.World.EmpireBoard[i].Donation != 0)
{
int PotGet = 7;
if (i < 15) PotGet = 9;
if (i < 3) PotGet = 12;
string nStr = Game.World.EmpireBoard[i].ID + " 1 0 " + Game.World.EmpireBoard[i].Name + " " + Game.World.EmpireBoard[i].Donation + " " + PotGet + " " + i;
nStr = Convert.ToChar((byte)nStr.Length) + nStr;
Str += nStr;
}
}
byte[] Packet = new byte[33 + Str.Length + 8];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));//0 1
P.WriteInt16(2064);//2 3
P.WriteInt32(2);//4 7
P.WriteInt16((ushort)Page);//8 9
P.WriteInt32(5);//10 13
P.Set(32);
P.WriteByte(10);//32
P.WriteByte((byte)Str.Length);
P.WriteString(Str);//33+string.length
return P;
}