5180 CharacterInfo packet ( Impule's )

07/04/2010 01:38 MonstersAbroad#1
My packet appears to be wrong, the characternames are fucked up...and I cant see anybody else but can see other people talking/whispers along with them dropping things and doing things like @gm hey but if I whisper them using the name that appears when they talk its like E Speak to all: Hey but if I whisper there real name they get it and my names appears fucked. heres my packet with a few /* */ things
Code:
using System;

namespace Conquer_Online_Server.Network.GamePackets
{
    public class CharacterInfo : Writer, Interfaces.IPacket
    {
        Client.GameState client;
        public CharacterInfo(Client.GameState _client)
        {
            client=_client;
        }
        public void Deserialize(byte[] buffer)
        {
            throw new NotImplementedException();
        }
        public byte[] ToArray()
        {
            byte[] Packet = new byte[8 + 92 + client.Entity.Spouse.Length + client.Entity.Name.Length];
            WriteUInt16((ushort)(Packet.Length - 8), 0, Packet);
            WriteUInt16(0x3ee, 2, Packet);
            WriteUInt32(client.Entity.UID, 4, Packet);
            WriteUInt32(client.Entity.Mesh, 8, Packet);
            WriteUInt16(client.Entity.HairStyle, 12, Packet);
            WriteUInt32(client.Entity.Money, 14, Packet);
            WriteUInt32(client.Entity.ConquerPoints, 18, Packet);
            WriteUInt64(client.Entity.Experience, 22, Packet);
            WriteUInt16(client.Entity.Strength, 50, Packet);
            WriteUInt16(client.Entity.Agility, 52, Packet);
            WriteUInt16(client.Entity.Vitality, 54, Packet);
            WriteUInt16(client.Entity.Spirit, 56, Packet);
            WriteUInt16(client.Entity.Atributes, 58, Packet);
            WriteUInt16((ushort)client.Entity.Hitpoints, 60, Packet);
            WriteUInt16(client.Entity.Mana, 62, Packet);
            WriteUInt16(client.Entity.PKPoints, 64, Packet);
            Packet[66] = client.Entity.Level;
            Packet[67] = client.Entity.Class;
            Packet[69] = client.Entity.Reborn;
            Packet[70] = 1;
            WriteUInt32(client.Entity.QuizPoints, 71, Packet);
            Packet[81] = 1;
            Packet[89] = 2;
            Packet[90] = (byte)client.Entity.Name.Length;
            WriteStringWithLength(client.Entity.Name, 91, Packet);
            Packet[91 + Packet[90]] = (byte)client.Entity.Spouse.Length;
            WriteStringWithLength(client.Entity.Spouse, 92 + Packet[90], Packet);
            WriteUInt16((ushort)client.Entity.HonorPoints, 93, Packet);
            return Packet;
            
            /*(0, 75, buffer);
            Packet[81] = 1;
            Packet[89] = 2;
            Packet[87] = 2;
            Packet[90] = (byte)client.Entity.Name.Length;
            WriteStringWithLength(client.Entity.Name, Packet[90] + 92, Packet);
            WriteStringWithLength(client.Entity.Spouse, 92, Packet);
            return Packet;*/
        }
        public void Send(Client.GameState client)
        {
            client.Send(ToArray());
        }
    }
}
Any help im useless with packets btw if anyone want to put a few packets from hex to a structure pm me :P
07/04/2010 10:03 MonstersAbroad#2
Bump
07/04/2010 22:26 -impulse-#3
If your name looks fine, try updating the entity spawn packet (Entity.cs)
07/04/2010 22:32 MonstersAbroad#4
Thanks, I figured that out know my name is slighty screwed like like E^2 8mination[PM I take it thats whats causing me not being able to see others ?
Code:
public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
                SpawnPacket = new byte[8 + 168 + Name.Length];
                WriteUInt16((ushort)(168 + Name.Length), 0, SpawnPacket);
                WriteUInt16(10014, 2, SpawnPacket);
                SpawnPacket[136] = 1;
                SpawnPacket[137] = (byte)_Name.Length;
                WriteString(_Name, 138, SpawnPacket);
            }
        }
?
07/04/2010 22:44 -impulse-#5
Quote:
Originally Posted by MonstersAbroad View Post
Thanks, I figured that out know my name is slighty screwed like like E^2 8mination[PM I take it thats whats causing me not being able to see others ?
Code:
public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
                SpawnPacket = new byte[8 + 168 + Name.Length];
                WriteUInt16((ushort)(168 + Name.Length), 0, SpawnPacket);
                WriteUInt16(10014, 2, SpawnPacket);
                SpawnPacket[136] = 1;
                SpawnPacket[137] = (byte)_Name.Length;
                WriteString(_Name, 138, SpawnPacket);
            }
        }
?
The offsets has changed? LOL for X,Y (that's what mainly matters)
07/04/2010 22:54 MonstersAbroad#6
I'm kinda noob and have no idea what im doing with packets and im trying so what are the offsets ? SpawnPacket[136] = 1;
SpawnPacket[137] = (byte)_Name.Length;
?

Offtopic:
Anybody got that Jingle bell's song acidco had ? It's stuck in my head after watching a video and I REALLY need to listen to it :/
07/05/2010 00:29 kinshi88#7
Quote:
Originally Posted by MonstersAbroad View Post
I'm kinda noob and have no idea what im doing with packets and im trying so what are the offsets ? SpawnPacket[136] = 1;
SpawnPacket[137] = (byte)_Name.Length;
?
The number in the [] is the offset.
07/05/2010 02:08 MonstersAbroad#8
So like
Code:
_Name = value;
                SpawnPacket = new byte[8 + 168 + Name.Length];
                //WriteUInt16((ushort)(168 + Name.Length), 0, SpawnPacket);
                WriteUInt16((ushort)(ToArray().Length - 8), 0, SpawnPacket);
                WriteUInt16(10014, 2, SpawnPacket);
                SpawnPacket[71] = 1;
                //SpawnPacket[137] = (byte)_Name.Length;
                this.Name = Name;
                //WriteString(_Name, 138, SpawnPacket);
? -- Edited stright from Immune's source

edit done a ton of testing ive got this
Code:
set
            {
                _Name = value;
                SpawnPacket = new byte[8 + 168 + Name.Length];
                WriteUInt16((ushort)(168 + Name.Length), 0, SpawnPacket);
                //WriteUInt16((ushort)(TToArray().Length - 8), 0, SpawnPacket);
                WriteUInt16(10014, 2, SpawnPacket);
                SpawnPacket[71] = 1;
                //SpawnPacket[137] = (byte)_Name.Length;
                //this.Name = Name;
                WriteString(_Name, 72, SpawnPacket);
            }
Result
[Only registered and activated users can see links. Click Here To Register...]
View full size.
Been at this for over 3 hours now cmon help anyone?
07/05/2010 10:28 -impulse-#9
No dude, that means that your character info packet is not good.

07/05/2010 16:51 MonstersAbroad#10
Thanks!, Can anybody help me with my spawnpacket?
Code:
_Name = value;
                SpawnPacket = new byte[8 + 168 + Name.Length];
                WriteUInt16((ushort)(168 + Name.Length), 0, SpawnPacket);
                //WriteUInt16((ushort)(TToArray().Length - 8), 0, SpawnPacket);
                WriteUInt16(10014, 2, SpawnPacket);
                SpawnPacket[71] = 1;
                //SpawnPacket[137] = (byte)_Name.Length;
                WriteString(_Name, 72, SpawnPacket);
And the result is that I can see what other people say stuff and they can see what I say to, I can see them drop items vise versia etc, cant see them visually not even there name. They are just not there...
07/05/2010 17:29 ImmuneOne#11
Quote:
Originally Posted by MonstersAbroad View Post
Thanks!, Can anybody help me with my spawnpacket?
Code:
_Name = value;
                SpawnPacket = new byte[8 + 168 + Name.Length];
                WriteUInt16((ushort)(168 + Name.Length), 0, SpawnPacket);
                //WriteUInt16((ushort)(TToArray().Length - 8), 0, SpawnPacket);
                WriteUInt16(10014, 2, SpawnPacket);
                SpawnPacket[71] = 1;
                //SpawnPacket[137] = (byte)_Name.Length;
                WriteString(_Name, 72, SpawnPacket);
And the result is that I can see what other people say stuff and they can see what I say to, I can see them drop items vise versia etc, cant see them visually not even there name. They are just not there...
So I released the correct offsets, but however you fail to even recognize correct offsets? I'd say don't try to do such stuff untill you finally understand networking.
07/05/2010 17:43 -impulse-#12
Quote:
Originally Posted by ImmuneOne View Post
So I released the correct offsets, but however you fail to even recognize correct offsets? I'd say don't try to do such stuff untill you finally understand networking.
That's why people pay other people right?
07/05/2010 18:13 MonstersAbroad#13
So ali, your saying I just need to correct the offsets?

#edit:
I changed to your offsets:
Result:
[Only registered and activated users can see links. Click Here To Register...]
07/05/2010 21:00 Korvacs#14
Show us the spawn packet offsets.
07/05/2010 21:19 -impulse-#15
Quote:
Originally Posted by Korvacs View Post
Show us the spawn packet offsets.
It's kinda a whole class with lots of accessors