ReadShort() public method

2字节读出
public ReadShort ( ) : ushort
return ushort
Ejemplo n.º 1
0
    void OnReceivedInternal(MemoryStream ms)
    {
        BinaryReader br = new BinaryReader(ms);

        byte[] message = br.ReadBytes((int)(ms.Length - ms.Position));
        br.Close();
        ms.Close();
        ms.Dispose();

        NetBuffer temp = new NetBuffer(message);
        ushort    cmd  = temp.ReadShort();

        byte[] buf = temp.ReadRemaining();
        SocketClientManager.AddEvent(cmd.ToString(), new NetBuffer(buf));
    }
Ejemplo n.º 2
0
 public override void ReadFromBuffer(NetBuffer buffer)
 {
     value = buffer.ReadShort();
 }
Ejemplo n.º 3
0
    void OnReceivedInternal(MemoryStream ms)
    {
        BinaryReader br = new BinaryReader(ms);
        byte[] message = br.ReadBytes((int)(ms.Length - ms.Position));
        br.Close();
        ms.Close();
        ms.Dispose();

        NetBuffer temp = new NetBuffer(message);
        ushort cmd = temp.ReadShort();
        byte[] buf = temp.ReadRemaining();
        SocketClientManager.AddEvent(cmd.ToString(), new NetBuffer(buf));
    }