Greetings!
I am working in Javascript with the Lidgren networking library, but can't get a solid grasp of the different numerical variable types available for my use and the corresponding functions to call to read them from a stream.
Here's a couple pages which seem relevant, but which I haven't yet quite been able to make sense of:
http://msdn.microsoft.com/en-us/library/system.aspx (See the Structures section). The pages of each of the Structs states that "JScript supports the use of structures, but not the declaration of new ones."...
http://msdn.microsoft.com/en-us/library/exx3b86w.aspx This page looks quite promising, but only seems to be useful for C#...
http://code.google.com/p/lidgren-network/wiki/MessageCompression This would be perfect, if it included a couple more examples to show how to use it in all cases...
I created the following list of functions by browsing the Lidgren assembly in MonoDevelop:
public bool ReadBoolean();
public byte ReadByte();
public sbyte ReadSByte();
public byte ReadByte(int numberOfBits);
public byte[] ReadBytes(int numberOfBytes);
public void ReadBytes(byte[] into, int offset, int numberOfBytes);
public short ReadInt16();
public ushort ReadUInt16();
public int ReadInt32();
public int ReadInt32(int numberOfBits);
public uint ReadUInt32();
public uint ReadUInt32(int numberOfBits);
public ulong ReadUInt64();
public long ReadInt64();
public ulong ReadUInt64(int numberOfBits);
public long ReadInt64(int numberOfBits);
public float ReadFloat();
public float ReadSingle();
public double ReadDouble();
public uint ReadVariableUInt32();
public int ReadVariableInt32();
public ulong ReadVariableUInt64();
public float ReadSignedSingle(int numberOfBits);
public float ReadUnitSingle(int numberOfBits);
public float ReadRangedSingle(float min, float max, int numberOfBits);
public int ReadRangedInteger(int min, int max);
public string ReadString();
What I need is a list of variable types to declare for different types of numerical data, along with the corresponding function to call in Lidgren to read that type of data once it has been written into a stream.
Many thanks!
-Aubrey