they may be being stored as signed bytes, but aren't they manipulated as
signed ints?
Joel Riedesel wrote:
Yeah, that's a good example of retrieving one byte when two are supposed
to be retrieved (Variable 2 specification in the message_template).
However there is also the problem of fields of packets defined as U8
that are being generated via the code to be a 'byte'. That won't work
as 'byte' is signed. Has to be shorts and so on...
Joel
Simon Whiteside wrote:
there is some work on the issue of unsigned bytes in Packet.java
The technique is to cast the value to an int and then and it with 0xFF
There's also work on this in the generated packet classes - look for
lines like:
length = (int)(bytes.get()) & 0xFFFF;
Joel Riedesel wrote:
Still working my way through getting the parsing of an ObjectUpdate
packet in java.
Most of the problems are in the mapgenerator code. For example, parsing
the length of a 2 byte Variable specification was only grabbing one
byte.
Making it grab two bytes and doing a bit shift, etc., to compute the
length isn't too bad, except... good old signed/unsigned in java
(or lack of unsigned in java).
Parsing 'ec 00' as a length should be a nice simple 236 and not a
65516 :-).
Ahh... Parsing the 'ec' byte gives us -20.
So it's looking to me that the java mapgenerator code is not dealing
with unsigned bytes at all (as far as I've checked so far). This means
that generated packets for unsigned byte fields really need to be shorts
with all the appropriate marshalling/demarshalling the network.
If I'm missing something or someone has already dealt with this (in
java) please yell :-)
Joel
_______________________________________________
libsl-dev mailing list
libsl-dev@opensecondlife.org
http://opensecondlife.org/cgi-bin/mailman/listinfo/libsl-dev
Regards,
Simon
Regards,
Simon
--
Simon Whiteside
Lateral Arts Limited
Clients include:
Sibelius, Tunetribe.com, The Times and Sunday Times Newspapers,
Alamy.com, Incisive Media, Wigmore Hall, Photobox.com, SOSplc.com
2a Royal Chase, Royal Tunbridge Wells, Kent TN4 8AY
Registered in England and Wales. Company Number: 3055039
http://www.larts.co.uk
Skype: callto://swhiteside
Second Life: Simon Hagoromo
_______________________________________________
libsl-dev mailing list
libsl-dev@opensecondlife.org
http://opensecondlife.org/cgi-bin/mailman/listinfo/libsl-dev