Esempio 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);
    }
Esempio n. 2
0
    public void SetHeadLength()
    {
        int offset = 0;

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