Ejemplo n.º 1
0
    public static bool ParseHeader(byte[] packetHeader, ref ushort msgType, ref ushort msgLength)
    {
        bool result;

        if (packetHeader.Length < WfPacket.GetHeaderLength())
        {
            result = false;
        }
        else
        {
            int offset = 0;
            msgLength = LBitConverter.ToUInt16(packetHeader, ref offset);
            msgType   = LBitConverter.ToUInt16(packetHeader, ref offset);
            uint server_use = LBitConverter.ToUInt32(packetHeader, ref offset);
            result = true;
        }
        return(result);
    }
Ejemplo n.º 2
0
    public void SetHeadLength()
    {
        int offset = 0;

        LBitConverter.GetBytes((ushort)GetOffset(), m_ReadBytes.GetBytes(), ref offset);
    }
Ejemplo n.º 3
0
 public void Write(double i)
 {
     LBitConverter.GetBytes(i, s_WriteBytes, ref m_Offset);
 }
Ejemplo n.º 4
0
 public void Write(String str)
 {
     LBitConverter.GetBytes(str, s_WriteBytes, ref m_Offset);
 }
Ejemplo n.º 5
0
 public double ReadDouble()
 {
     return(LBitConverter.ToDouble(m_ReadBytes.GetBytes(), ref m_Offset));
 }
Ejemplo n.º 6
0
 public string ReadString(int strLength)
 {
     return(LBitConverter.ToString(m_ReadBytes.GetBytes(), ref m_Offset, strLength));
 }
Ejemplo n.º 7
0
 public float ReadFloat()
 {
     return(LBitConverter.ToSingle(m_ReadBytes.GetBytes(), ref m_Offset));
 }
Ejemplo n.º 8
0
 public bool ReadBool()
 {
     return(LBitConverter.ToBoolean(m_ReadBytes.GetBytes(), ref m_Offset));
 }
Ejemplo n.º 9
0
 public short ReadShort()
 {
     return(LBitConverter.ToInt16(m_ReadBytes.GetBytes(), ref m_Offset));
 }
Ejemplo n.º 10
0
 public long ReadInt64()
 {
     return(LBitConverter.ToInt64(m_ReadBytes.GetBytes(), ref m_Offset));
 }
Ejemplo n.º 11
0
 public int ReadInt()
 {
     return(LBitConverter.ToInt32(m_ReadBytes.GetBytes(), ref m_Offset));
 }