how find the value of the bytes

A place for plug-in authors to post and receive feedback on plug-ins still in development, or to discuss the development of plug-ins.

how find the value of the bytes

Postby chris78 on Fri Mar 05, 2010 3:19 am

I am trying to build my first plugin
But i cant figure out how find the value of the bytes (bytes + 10) and how to properly use them..
Please help..
chris78
Awesom-O Beta Tester
Awesom-O Beta Tester
 
Posts: 114
Joined: Thu Jun 21, 2007 6:38 pm

Re: how find the value of the bytes

Postby illmat on Fri Mar 05, 2010 11:21 am

be a little bit more specific
give us an example which byte/word/dword from which packet do you wanna read

if you wanna read a single byte then you're using an unsigned char because it can hold the values from 0-255 (1 byte)
an example would be:
Code: Select all
unsigned char onebyte = *reinterpret_cast<const unsigned char*>((bytes+1));

this would read the first byte after the packetid

for 2 bytes (word) you're using an unsigned short (0-65535)
Code: Select all
usigned short twobytes = *reinterpret_cast<const unsigned short*>((bytes+1));

for 4 bytes (dword) -> usigned int (0-4294967295)
Code: Select all
unsigned int fourbytes = *reinterpret_cast<const unsigned int*>((bytes+1));
illmat
Donor
Donor
 
Posts: 106
Joined: Wed Jan 02, 2008 5:33 pm


Return to Plug-in Development

Who is online

Users browsing this forum: No registered users and 1 guest