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

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