示例#1
0
 public pack_position(float x, float y, float z)
 {
     this.hand = new packhand((int)HANDTYPE.PACK_TYPE_POSITION, 0);
     this.x    = x;
     this.y    = y;
     this.z    = z;
 }
示例#2
0
    public void make(byte[] buf)
    {
        int nowindex = 0;

        this.hand  = ProtocolBase.getHand(buf, ref nowindex);
        this.numid = ProtocolBase.getInt(buf, ref nowindex);
    }
示例#3
0
 public pack_login(int numid, string password)
 {
     this.hand     = new packhand((int)HANDTYPE.PACK_TYPE_LOGIN, 0);
     this.numid    = numid;
     this.len_pwd  = password.Length;
     this.password = password;
 }
示例#4
0
    public void make(byte[] buf)
    {
        int nowindex = 0;

        this.hand    = ProtocolBase.getHand(buf, ref nowindex);
        this.len_buf = ProtocolBase.getInt(buf, ref nowindex);
        this.buf     = ProtocolBase.getString(buf, ref nowindex, this.len_buf);
    }
示例#5
0
    public void make(byte[] buf)
    {
        int nowindex = 0;

        this.hand = ProtocolBase.getHand(buf, ref nowindex);
        this.x    = ProtocolBase.getFloat(buf, ref nowindex);
        this.y    = ProtocolBase.getFloat(buf, ref nowindex);
        this.z    = ProtocolBase.getFloat(buf, ref nowindex);
    }
示例#6
0
    public void make(byte[] buf)
    {
        int nowindex = 0;

        this.hand     = ProtocolBase.getHand(buf, ref nowindex);
        this.numid    = ProtocolBase.getInt(buf, ref nowindex);
        this.len_pwd  = ProtocolBase.getInt(buf, ref nowindex);
        this.password = ProtocolBase.getString(buf, ref nowindex, this.len_pwd);
    }
示例#7
0
    //-------------------------------------------------------------------------------recv byte
    public static packhand getHand(byte[] buf, ref int nowindex)
    {
        if (buf.Length < nowindex + 8)
        {
            throw new Exception("getHand len err");
        }
        int type = System.BitConverter.ToInt32(buf, 0);
        //type = IPAddress.NetworkToHostOrder(type);
        int packlen = System.BitConverter.ToInt32(buf, 4);
        //packlen = IPAddress.NetworkToHostOrder(packlen);
        packhand hand = new packhand(type, packlen);

        nowindex += 8;
        return(hand);
    }
示例#8
0
 public pack_action(string buf)
 {
     this.hand    = new packhand((int)HANDTYPE.PACK_TYPE_ACTION, 0);
     this.len_buf = buf.Length;
     this.buf     = buf;
 }