[sldev] [Question] TCP/UDP Sim connection

alexander treptow alexander.treptow at zweitgeist.com
Fri Oct 12 03:17:32 PDT 2007


So i only got a wrong "UseCircuitCode" id when i use 0x0300FFFF
but i cant find any wrong in the other bytes.

packet.priority = 0x40;
 packet.counter[0] = 0x00;
 packet.counter[1] = 0x00;
 packet.counter[2] = 0x00;
 packet.counter[3] = 0x01;
 packet.spacer = 0x00;
 packet.id[0] = 0xFF;
 packet.id[1] = 0xFF;
 packet.id[2] = 0x00;
 packet.id[3] = 0x03;
 for(int i = 0, j = 3; (i <= 3) && (j >= 0); i++, j--)
    packet.anotherid[i] = ((char *)(&login.circuit_code))[j];
 hexstr2bin(packed_uuid(login.session_id).c_str(), packet.session_id, 16);
 hexstr2bin(packed_uuid(login.agent_id).c_str(), packet.agent_id, 16);

generates: 40 00 00 00 01 00 FF FF 00 03 (circuit code) (session id) 
(agent id)

Tateru Nino schrieb:
> Your packet should look like this:
> U8 (set to 0x40 - 'reliable')
> U32 (big endian sequence number)
> U8 (set to 0x00)
> U32 (big endian: 0xffff0003 - 'UseCircuitCode')
> U32 (LITTLE endian - circuit_code you got from the HTTP request to the
> login servers)
> U8[16] (big endian - session_id from the same HTTP transaction)
> U8[16] (big endian - agent_id from the same HTTP transaction)
>
> That's 46 bytes. Send via UDP to sim_ip:sim_port
> You should recieve a 12 byte packet in response which contains a single
> acknowledgement.
>   



More information about the SLDev mailing list