[Conquer 1.0 Question] Client Issues with Chat?

11/13/2010 20:17 FuriousFang#1
Hey everyone,

I've been having problems with my chat from Conquer 1.0. I'm using the 4267 client. Is it my coding or is there something wrong with the way the client handles chat input? Is there a way to even fix it?

I'll type something in and it'll add crap to it afterwords like this:
[Only registered and activated users can see links. Click Here To Register...]

It's probably the client but let me know...
Sincerely,
Fang
11/13/2010 21:03 pro4never#2
are you sure you aren't reading into the seal of the packet?.... only thing that comes to mind.
11/13/2010 23:49 FuriousFang#3
The message is spawned to the game before it's sent to my message packet. So... it's either a spawning problem (if that's how chat messages are spawned) OR a client problem.
11/14/2010 00:11 _tao4229_#4
client problem for me too
11/14/2010 00:21 Korvacs#5
Theres nothing wrong with the 4267 client...they wouldnt have been able to use it otherwise would they x.x
11/14/2010 00:21 FuriousFang#6
Quote:
Originally Posted by _tao4229_ View Post
client problem for me too
How are the chat windows spawned? Maybe it's adding extra offsets.
11/14/2010 00:25 Korvacs#7
Post your chat handler please, and packet structure. :)
11/14/2010 00:35 FuriousFang#8
Quote:
Originally Posted by Korvacs View Post
Post your chat handler please, and packet structure. :)
It's the same as impulse's.
Here's the packet structure for Chat:

Length [2] ushort
Color [4] Uint32
ChatType [8] Uint32
From [18] String with Length
To [19] String with Length
Message [21] String with Length

The offsets are correct. It doesn't have to do with the message packet (I don't think)
11/14/2010 02:33 bone-you#9
This was actually a problem on official for some people. I forget how it was fixed, but I too had the problem for a short while. But.. I'm not sure if it was because of my proxy bot or not at the time. I mostly only passed packet through and didn't touch them. Don't remember :)
11/14/2010 02:38 FuriousFang#10
Quote:
Originally Posted by bone-you View Post
This was actually a problem on official for some people. I forget how it was fixed, but I too had the problem for a short while. But.. I'm not sure if it was because of my proxy bot or not at the time. I mostly only passed packet through and didn't touch them. Don't remember :)
I'm using an official client now... same problem =\
11/14/2010 16:03 Korvacs#11
Quote:
Originally Posted by FuriousFang View Post
It's the same as impulse's.
Here's the packet structure for Chat:

Length [2] ushort
Color [4] Uint32
ChatType [8] Uint32
From [18] String with Length
To [19] String with Length
Message [21] String with Length

The offsets are correct. It doesn't have to do with the message packet (I don't think)
Your offsets are incorrect for the 4267 client.

Should be, 17, 18, 19, 20 your off by 1 byte.
11/14/2010 20:19 FuriousFang#12
Quote:
Originally Posted by Korvacs View Post
Your offsets are incorrect for the 4267 client.

Should be, 17, 18, 19, 20 your off by 1 byte.
If I use those offsets, it doesn't work. Those offsets I use for the serialize version of the packet (for login and such). Here's my Deserialize Message packet:

Code:
public void Deserialize(byte[] Bytes)
        {
            this.Color = BitConverter.ToUInt32(Bytes, 4);
            this.ChatType = BitConverter.ToUInt32(Bytes, 8);
            this._From = Encoding.ASCII.GetString(Bytes, 18, Bytes[17]);
            this._To = Encoding.ASCII.GetString(Bytes, 19 + this._From.Length, Bytes[18 + this._From.Length]);
            this.Message = Encoding.ASCII.GetString(Bytes, (21 + this._From.Length) + this._To.Length, Bytes[(20 + this._From.Length) + this._To.Length]);
      // I took this from Hybrid's source xP      
        }
Here's my Serialize Message Packet:
Code:
public byte[] Serialize()
        {
            byte[] Packet = new byte[(((25 + this._From.Length) + this._To.Length) + this.Message.Length)];
            PacketBuilder.WriteUInt16((ushort)Packet.Length, Packet, 0);
            PacketBuilder.WriteUInt16(1004, Packet, 2);
            PacketBuilder.WriteUInt32(this.Color, Packet, 4);
            PacketBuilder.WriteUInt32(this.ChatType, Packet, 8);
            Packet[16] = 4;
            PacketBuilder.WriteStringWithLength(this._From, Packet, 17);
            PacketBuilder.WriteStringWithLength(this._To, Packet, (ushort)(18 + this._From.Length));
            PacketBuilder.WriteStringWithLength(this.Message, Packet, (ushort)((20 + this._From.Length) + this._To.Length));
            return Packet;
        }
11/14/2010 21:25 Korvacs#13
Ok well, turns out you are using the offsets i told you to use, dunno how you managed that one but oh well.

Also you not sending the players UID in the packet, it should go directly after the chattype, and if that doesnt fix it then its something you have done in your source, since i have the chat packet working perfectly on an official 4267 client.
11/14/2010 22:15 FuriousFang#14
Quote:
Originally Posted by Korvacs View Post
Ok well, turns out you are using the offsets i told you to use, dunno how you managed that one but oh well.
I know how to code packets... Saint taught me that when I was helping Tommy develop Elite CoEmu.

Quote:
Originally Posted by Korvacs View Post
Also you not sending the players UID in the packet, it should go directly after the chattype, and if that doesnt fix it then its something you have done in your source, since i have the chat packet working perfectly on an official 4267 client.
I should have thought of that... it's in the other patches. Thanks.
I put it at offset 12... still not working. =\ It still sends random characters.
[Only registered and activated users can see links. Click Here To Register...]
Here's the new one now:

Code:
public void Deserialize(byte[] Bytes)
        {
            this.Color = BitConverter.ToUInt32(Bytes, 4);
            this.ChatType = BitConverter.ToUInt32(Bytes, 8);
            this.ClientUID = BitConverter.ToUInt32(Bytes, 12);
            this._From = Encoding.ASCII.GetString(Bytes, 18, Bytes[17]);
            this._To = Encoding.ASCII.GetString(Bytes, 19 + this._From.Length, Bytes[18 + this._From.Length]);
            this.Message = Encoding.ASCII.GetString(Bytes, (21 + this._From.Length) + this._To.Length, Bytes[(20 + this._From.Length) + this._To.Length]);
            
        }

        public byte[] Serialize()
        {
            byte[] Packet = new byte[(((25 + this._From.Length) + this._To.Length) + this.Message.Length)];
            PacketBuilder.WriteUInt16((ushort)Packet.Length, Packet, 0);
            PacketBuilder.WriteUInt16(1004, Packet, 2);
            PacketBuilder.WriteUInt32(this.Color, Packet, 4);
            PacketBuilder.WriteUInt32(this.ChatType, Packet, 8);
            PacketBuilder.WriteUInt32(this.ClientUID, Packet, 12);
            Packet[16] = 4;
            PacketBuilder.WriteStringWithLength(this._From, Packet, 17);
            PacketBuilder.WriteStringWithLength(this._To, Packet, (ushort)(18 + this._From.Length));
            PacketBuilder.WriteStringWithLength(this.Message, Packet, (ushort)((20 + this._From.Length) + this._To.Length));
            return Packet;
        }
11/15/2010 00:01 Korvacs#15
Are you resending the chat packet after the server receives it?