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; }
public void make(byte[] buf) { int nowindex = 0; this.hand = ProtocolBase.getHand(buf, ref nowindex); this.numid = ProtocolBase.getInt(buf, ref nowindex); }
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; }
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); }
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); }
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); }
//-------------------------------------------------------------------------------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); }
public pack_action(string buf) { this.hand = new packhand((int)HANDTYPE.PACK_TYPE_ACTION, 0); this.len_buf = buf.Length; this.buf = buf; }