fix parsing and handling of DistItem packets

This commit is contained in:
wish
2023-10-24 21:24:35 +11:00
parent 94f9174afa
commit ba50dc419a
3 changed files with 37 additions and 24 deletions

View File

@@ -67,10 +67,28 @@ func handleMsgMhfEnumerateDistItem(s *Session, p mhfpacket.MHFPacket) {
bf.WriteUint16(distData.MaxSR)
bf.WriteUint16(distData.MinGR)
bf.WriteUint16(distData.MaxGR)
bf.WriteUint32(0) // Unk
bf.WriteUint32(0) // Unk
ps.Uint16(bf, distData.EventName, true)
bf.WriteBytes(make([]byte, 391))
bf.WriteUint8(0)
bf.WriteUint16(0)
bf.WriteUint8(0)
bf.WriteUint16(0)
bf.WriteUint16(0)
bf.WriteUint8(0)
ps.Uint8(bf, distData.EventName, true)
for i := 0; i < 6; i++ {
for j := 0; j < 13; j++ {
bf.WriteUint8(0)
bf.WriteUint32(0)
}
}
i := uint8(0)
bf.WriteUint8(i)
if i <= 10 {
for j := uint8(0); j < i; j++ {
bf.WriteUint32(0)
bf.WriteUint32(0)
bf.WriteUint32(0)
}
}
}
resp := byteframe.NewByteFrame()
resp.WriteUint16(uint16(distCount))