4351 Login Issue.

01/25/2011 06:46 Santa#1
So I have decided to attempt my own custom server. I've decided on the patch 4351 because it has the new interface with the Cp slot for a second currency or w/e. For the last 5-6 hours or so i have tried to figure out the login sequence. Yes, I did check out CoFuture_Release for some help but that didn't help much at all.Also, looked at TheCOServer but that is so unorganized it confuses me but struggled my way through that sequence and that didn't work either.

AuthStuff - Then
I receive 1052
Send 1004 - "ANSWER_OK"
Send 1006 - Char Info
Receive 1010:74
Send 1010:74
Send 1010:104


Thats as far as I can get, I don't receive any packets after that and not sure if I have the sequence wrong, not sending the right packet, or have the packets structured wrong.

Any help would be very much appreciated.
Thanks.
01/25/2011 07:40 FuriousFang#2
Where the client gets stuck?
What does the screen look like when it gets stuck?
01/25/2011 10:15 © Haydz#3
Sounds like a packet splitting issue, I'll check my 4351 source when I get home from college though (3 1/2 Hours).
01/25/2011 13:44 _tao4229_#4
^
|

Split packets.
01/25/2011 15:37 © Haydz#5
Okay, yeah I was getting curious so I double checked.

[Only registered and activated users can see links. Click Here To Register...]

As you can see the 0x4B (Hotkeys) is sent in the same packet as the 0x72 (Get Surroundings).

Good Luck
01/25/2011 16:26 Santa#6
I do not receive the HotKey packet.

[Only registered and activated users can see links. Click Here To Register...]

I have got school now.

Fang,

"Logging into the Server..."
01/25/2011 16:38 © Haydz#7
Either you're Structure or Response (0x4A) for the 1010 packet is erroneous.

As generally, once you send the 0x4A, you appear in the conquer world and the login sequence continues.

I'll Post my Data Packet up if it's any help.

Code:
    struct DataPacket
    {
        public ushort Size, Type;
        public uint TimeStamp;
        public uint UID;
        public uint lParam;
        public ushort wParamA;
        public ushort wParamB;
        public ushort wParamC;
        public DataIDs SubType;

        //Properties used in the Jump Packet
        public ushort lParamX { get { return (ushort)(lParam & 0xFFFF); } }
        public ushort lParamY { get { return (ushort)(lParam >> 16); } }
    }
01/25/2011 20:57 FuriousFang#8
Quote:
Originally Posted by StarBucks View Post
I do not receive the HotKey packet.

[Only registered and activated users can see links. Click Here To Register...]

I have got school now.

Fang,

"Logging into the Server..."
K, so somewhere in that login sequence, a packet you sent is wrong.
You're probably trying to make the login more complicated than it is. I logged into it fine by just sending what the client requested. What did you say that the last packet sent was? Because that is probably the problem. The client requests everything for login. You shouldn't have to try to send it stuff that it doesn't request for.

Also, when you receive packet 1052: You check the pool for connections already tied to the character, send the message "ANSWER_OK" if the character exists, load the character and send the character info packet (1006), and then you wait for the client to respond.

The client responds to the message packet, NOT the character data. After that, you should get the general packet request (74) which sets the location (as I'm sure you already know). If you get a black screen with the Conquer GUI, then your offsets are wrong.

(There might be more to it depending on the patch - i can't remember right now)

Good luck!
Sincerely,
Fang
01/26/2011 03:15 Santa#9
This is my Gen data Packet

PHP Code:
public static byte[] GeneralData(uint IDushort ValueAushort ValueBushort ValueCushort Type)
        {
            
byte[] = new byte[24];
            
WriteUInt16((ushort)P.Length0P);
            
WriteUInt16(10102P);
            
WriteUInt32((uint)Environment.TickCount4P);
            
WriteUInt32(ID8P);
            
WriteUInt32(ValueA10P);
            
WriteUInt16(ValueB14P);
            
WriteUInt16(ValueC16P);
            
WriteUInt16(018P);
            
WriteUInt16(Type20P);
            return 
P;
        } 
C.Send(Packets.GeneralData(1002, 1002, 439, 386, 74));
Is that correct, or do i send the uid instead of the MapID twice?

I can't test atm, have to take dog to the clinic.
01/26/2011 03:49 © Haydz#10
There's a few problems

Code:
[php]public static byte[] GeneralData(uint ID, ushort ValueA, ushort ValueB, ushort ValueC, ushort Type)
        {
            byte[] P = new byte[24];
            WriteUInt16((ushort)P.Length, 0, P);
            WriteUInt16(1010, 2, P);
            WriteUInt32((uint)Environment.TickCount, 4, P);
            WriteUInt32(ID, 8, P);
            WriteUInt32(ValueA, [B]12[/B], P);
            WriteUInt16(ValueB, [B]16[/B], P);
            WriteUInt16(ValueC, [B]18[/B], P);
            WriteUInt16(0, [B]20[/B], P);
            WriteUInt16(Type, 22, P);
            return P;
        }
ID should be the characters unique ID, not the MapID.
ValueA = MapID.
ValueB = X;
ValueC = Y;

Try that packet and everything should be fine
01/26/2011 03:52 FuriousFang#11
Quote:
Originally Posted by StarBucks View Post
This is my Gen data Packet

PHP Code:
public static byte[] GeneralData(uint IDushort ValueAushort ValueBushort ValueCushort Type)
        {
            
byte[] = new byte[24];
            
WriteUInt16((ushort)P.Length0P);
            
WriteUInt16(10102P);
            
WriteUInt32((uint)Environment.TickCount4P);
            
WriteUInt32(ID8P);
            
WriteUInt32(ValueA10P);
            
WriteUInt16(ValueB14P);
            
WriteUInt16(ValueC16P);
            
WriteUInt16(018P);
            
WriteUInt16(Type20P);
            return 
P;
        } 
C.Send(Packets.GeneralData(1002, 1002, 439, 386, 74));
Is that correct, or do i send the uid instead of the MapID twice?

I can't test atm, have to take dog to the clinic.
Here's the one that I'm using for my 5016. It probably will work:
Code:
Buffer = new byte[36];
WriteUInt16(28, 0, Buffer);
WriteUInt16(1010, 2, Buffer);
WriteUInt32((uint)TimeStamp.GetHashCode(), 4, Buffer);
WriteUInt32(UID, 8, Buffer);
WriteUInt32(dwParam, 12, Buffer);
WriteUInt16(wParam1, 14, Buffer);
WriteUInt16(wParam2, 16, Buffer);
WriteUInt32(wParam3, 18, Buffer);
WriteUInt16(ID, 22, Buffer);
And this is what I'm doing for my general 1010+74:
Code:
generalData.dwParam = client.Entity.MapID;
generalData.wParam2 = client.Entity.X;
generalData.wParam3 = client.Entity.Y;
client.Send(generalData);
Good luck!
Sincerely,
Fang

EDIT: Hahaha, Haydz beat me to the punch.
01/26/2011 03:55 © Haydz#12
Quote:
Originally Posted by FuriousFang View Post
Here's the one that I'm using for my 5016. It probably will work:
Code:
snip
And this is what I'm doing for my general 1010+74:
Code:
snip
Good luck!
Sincerely,
Fang
You seem to be allocating a 36 byte buffer for a 28 byte packet?

Anyway that's different to 4351, which is only a 24 byte packet.

And yeah, I'm depriving myself of sleep for no reason so, need something to occupy my time :D
01/26/2011 04:27 FuriousFang#13
Quote:
Originally Posted by © Haydz View Post
You seem to be allocating a 36 byte buffer for a 28 byte packet?

Anyway that's different to 4351, which is only a 24 byte packet.

And yeah, I'm depriving myself of sleep for no reason so, need something to occupy my time :D
Yah. TQServer = 8 bytes.
01/26/2011 04:42 © Haydz#14
Quote:
Originally Posted by FuriousFang View Post
Yah. TQServer = 8 bytes.
I know that but you stated that it's 5016, which is before the TQServer padding came into effect.
01/26/2011 04:44 Arcо#15
Lol'd.