Donna Dionne wrote:


HI John,
Sorry to bother you with questions. I am new to second life protocol and noticed that you are an expert on this topic. I have a really basic question. How do I figure out the packet type for a packet that is not zero-encoded. I.e., the bytes 5, 6, or 7 and 8 for high, medium, or low packets respectively. I have seen message_template.txt and keywords.txt files, but still can't figure out the packet type. For example, the packet 40 00 00 01 ff ff 00 03 is a low packet of type 00 03, but what is the definition of low packet type 00 03 in message_template.txt? In general, how do I know what each definition in message_template.txt corresponds to in terms of packet types (byte 5, 6 or 7 and 8)? does the file keyword.txt help? Thanks so much for your time and help!
Best regards,
Donna
You are going to have to parse the entire message_template and keywords files ahead of time to know what packet id is what packet. You can look at the code in ProtocolManager.cs in libsecondlife to see how we do it, basically parse through the message_template and the first low packet you encounter goes in to a LowPackets[] array at position 1. the second low packet goes at position 2, third at 3, etc. The first medium packet goes in to an array MediumPackets[] at position 1, you are getting the picture. Now when you're building the layout for the packets, block and field ordering is important but it's also not stored in the message_template. All of the packets are in order but all of the fields and blocks are out of order; strange eh? So the keywords.txt file is an ordered list of all the keywords (names of either blocks or fields), so when you are building the packet template you need to sort the blocks and fields using the order in keywords.txt. It's fairly non-trivial, which makes me wonder if you might be able to take advantage of existing code that does this instead? libsecondlife is modular enough that you can use portions of it without having to use it to login.

John Hurliman


_______________________________________________
libsecondlife-dev mailing list
libsecondlife-dev@gna.org
https://mail.gna.org/listinfo/libsecondlife-dev
http://www.libsecondlife.org/

Reply via email to