[sldev] [Question] TCP/UDP Sim connection

Tateru Nino tateru.nino at gmail.com
Fri Oct 12 02:41:19 PDT 2007


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.

alexander treptow wrote:
> Aidan Thornton schrieb:
>> Hi,
>>
>> Did you remember to put in the circuit code? I assume you did, since
>> the message size matches, but you don't mention it. If you didn't,
>> it's in the login server response, and I think it should go before the
>> session ID as a little-endian 32-bit signed int - I still don't know
>> why LL couldn't just pick one endianness and stick to it, but that's
>> Second Life.
>>
>> Aidan
>>   
>
> Hi,
> Hmm, i think i missed it.
>
> but i tried it with circuit_code as it was and converted to little
> endian and it doesn't work.
> packet structure:
> struct login_packet {
>    char priority;
>    char counter[5];
>    unsigned int id;
>    char anotherid[4];
>    char agent_id[16];
>    char session_id[16];
> };
>
> fill the packet:
> packet.priority = 0x40;
> packet.counter[0] = 0x00;
> packet.counter[1] = 0x00;
> packet.counter[2] = 0x00;
> packet.counter[3] = counter++;
> packet.counter[4] = 0x00;
> packet.id = 0x0300FFFF;
> 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);
>
> whats wrong with it?
>
> Thanks for help
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>

-- 
Tateru Nino
http://dwellonit.blogspot.com/



More information about the SLDev mailing list