mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
fix(jce): ToByes lost some fields of SvcReqRegisterNew (#217)
This commit is contained in:
parent
416a6c17be
commit
45692b75f8
@ -68,16 +68,16 @@ func writeObject(w io.Writer, v reflect.Value, tag byte, name string) {
|
||||
w.Write([]byte(fmt.Sprintf("\tw.WriteInt64(int64(pkt.%s), %d)\n", name, tag)))
|
||||
case reflect.String:
|
||||
w.Write([]byte(fmt.Sprintf("\tw.WriteString(pkt.%s, %d)\n", name, tag)))
|
||||
case reflect.Interface, reflect.Ptr:
|
||||
w.Write([]byte(fmt.Sprintf("\tw.writeHead(10, %d)\n", tag)))
|
||||
w.Write([]byte(fmt.Sprintf("\tw.buf.Write(pkt.%s.ToBytes())\n", name)))
|
||||
w.Write([]byte("\tw.writeHead(11, 0)\n"))
|
||||
default:
|
||||
switch v.Interface().(type) {
|
||||
case float32:
|
||||
w.Write([]byte(fmt.Sprintf("\tw.WriteFloat32(pkt.%s, %d)\n", name, tag)))
|
||||
case float64:
|
||||
w.Write([]byte(fmt.Sprintf("\tw.WriteFloat64(pkt.%s, %d)\n", name, tag)))
|
||||
case IJceStruct:
|
||||
w.Write([]byte(fmt.Sprintf("\tw.writeHead(10, %d)\n", tag)))
|
||||
w.Write([]byte(fmt.Sprintf("\tw.buf.Write(pkt.%s.ToBytes())\n", name)))
|
||||
w.Write([]byte("\tw.writeHead(11, 0)\n"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -229,6 +229,12 @@ func (pkt *SvcRespRegister) ToBytes() []byte {
|
||||
func (pkt *SvcReqRegisterNew) ToBytes() []byte {
|
||||
w := NewJceWriter()
|
||||
w.WriteInt64(pkt.RequestOptional, 0)
|
||||
w.writeHead(10, 1)
|
||||
w.buf.Write(pkt.C2CMsg.ToBytes())
|
||||
w.writeHead(11, 0)
|
||||
w.writeHead(10, 2)
|
||||
w.buf.Write(pkt.GroupMsg.ToBytes())
|
||||
w.writeHead(11, 0)
|
||||
w.WriteByte(pkt.DisGroupMsgFilter, 14)
|
||||
w.WriteByte(pkt.GroupMask, 15)
|
||||
w.WriteInt64(pkt.EndSeq, 16)
|
||||
|
Loading…
x
Reference in New Issue
Block a user