Static Sprocket wrote:
So I've got the new C# version of the library compiling and was looking at embarking on some experiments of my own.

In the Packet.cs file I see that there are some little Packet helper functions, such as the DirFindQuery() function that helps build the packet to be sent to the SL Grid. I assume that was built with the assistence of the output of the Snowcrash program.

I haven't worked with C/C++ in quite some time and really didn't want to mess with trying to get a buid environment working for it. Is there someone that could perhaps share the output for the latest SL Client protocal file?
Thanks!
http://labs.highenergychemistry.com/secondlife/decode.txt

(Apologies for a lot of you getting this message twice, it was worth CCing to the dev list though. I should probably merge the lists until there is independent traffic on both)

I'm working on a generic packet builder but if there are any specific packets you want made I'd recommend building them how the rest are built right now, with a helper function. Some generic rules when building packets, Low packets have a header length of 8: two flag bytes, two sequence bytes, two 0xFF bytes to identify it as a low packet, and a two byte id number. Medium packets have a header length of six, only using a single 0xFF byte to identify it followed by a single byte for the id number. High packets have a header length of five, using a single byte for the id and no 0xFF bytes. You have to take the header length in to account when calling the packet constructor and passing the total packet length, and you will want to use those numbers as the starting offset in to the actual payload.

Low 00003 - UseCircuitCode - Untrusted - Zerocoded
        0799 CircuitCode (01)
                0030 ID (LLUUID / 1)
                0402 SessionID (LLUUID / 1)
                0561 Code (U32 / 1)

This packet will have a header length of 8, and id number of 3 (although you don't need to worry about this, the Packet constructor will build the header for you except for setting the packet flags), a 16 byte uuid followed by another 16 byte uuid followed by a four byte unsigned integer in little endian format. All the data in the payload is little endian. Since this is an important packet we'll request an ACK from the server by setting the MSG_RELIABLE flag, and the protocol shows it ought to be zerocoded as well so add the MSG_ZEROCODED flag to the first byte as well.

packet.Data[0] = Helpers.MSG_RELIABLE + Helpers.MSG_ZEROCODED;

Variable data fields are prepended with a size that is either one or two bytes long, take this packet for example:

Low 00059 - ClassifiedInfoReply - Trusted - Zerocoded
        0527 Data (01)
                0115 ClassifiedFlags (U8 / 1)
                0159 CreationDate (U32 / 1)
                0191 SimName (Variable / 1)
                0285 ClassifiedID (LLUUID / 1)
                0381 PosGlobal (LLVector3d / 1)
                0434 ParcelID (LLUUID / 1)
                0506 Name (Variable / 1)
                0547 Desc (Variable / 2)
                0664 ParcelName (Variable / 1)
                0686 Category (U32 / 1)
                0736 CreatorID (LLUUID / 1)
                1076 SnapshotID (LLUUID / 1)
                1127 PriceForListing (S32 / 1)
                1341 ExpirationDate (U32 / 1)
                1390 ParentEstate (U32 / 1)
        1297 AgentData (01)
                0219 AgentID (LLUUID / 1)

ParcelName will be prepended with a single length byte that takes in to account the null terminator at the end of the string, since ParcelName is a string. Desc is prepended with two bytes (little endian, a ushort in C#) designating the length of the string, followed by the null terminated description string.

John Hurliman

_______________________________________________
libsecondlife-dev mailing list
[email protected]
https://mail.gna.org/listinfo/libsecondlife-dev

Reply via email to