The online racing simulator
Searching in All forums
(1 results)
karl
S2 licensed
Quote from repeat83 :
public IS_NCN(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
UCID = reader.ReadByte();
UName = reader.ReadString(24);
PName = reader.ReadString(24);
Admin = reader.ReadBoolean();
Total = reader.ReadByte();
Remote = (reader.ReadByte() & [B][SIZE="7"]2[/SIZE][/B]) > 0; // bit 2: remote

Is it correct? May be we must put it value.
Remote = (reader.ReadByte() & [B]4[/B]) > 0; // bit 2: remote


Yup, I just found this exact same bug. You're correct, it should be 4.

There's a very similar bug in the PlayerTypes enum, PLT_REMOTE = 3 should be PLT_REMOTE = 4, as it's another bit flag.

Great library though, just started using it, but working nicely.
FGED GREDG RDFGDR GSFDG