Get DC'd by packet offset.

10/05/2010 00:30 _DreadNought_#1
So,

(Impulses source) I am trying to workout an offset. For guild info but the offset is clearly over 50 but if I do 50+ for the offset I get dc'd with no error?
the packet is
Code:
 public static byte[] GuildInfo(Client.GameState client)
        {
            byte LeaLen = (byte)(client.Entity.MyGuild.GLeader.Length +[COLOR="Red"] 21[/COLOR]);
            PacketBuilder Packet = new PacketBuilder(1106, [COLOR="Red"]40[/COLOR]);
            Packet.Long(client.Entity.GuildId);
            Packet.Long(client.Entity.GDonation);
            Packet.Long(client.Entity.MyGuild.GFund);
            Packet.Long(client.Entity.MyGuild.GMems.Count);
            Packet.Int(client.Entity.GJob);//20
            Packet.Text(client.Entity.MyGuild.GLeader);
            for (byte ByLeft = LeaLen; ByLeft < [COLOR="Red"]40[/COLOR]; ByLeft++)
            {
                Packet.Int(0);
            }
            return Packet.getFinal();
        }
Why? Because I havn't structured it yet.

Any help?
10/05/2010 00:35 Korvacs#2
Wouldnt have thought you would need this:

Code:
            for (byte ByLeft = LeaLen; ByLeft < 40; ByLeft++)
            {
                Packet.Int(0);
            }
Un-assigned values default to 0, so really the buffer behind all of this has already had its existing bytes set to 0, theres no need to do it all again.

So after removing that if the problem still exists then it comes down to the size of the packet, and whether your setting it correctly.