parse enumerate title further

This commit is contained in:
wish
2022-07-24 15:54:56 +10:00
parent b8f5aa87a2
commit d073a72826
2 changed files with 20 additions and 17 deletions

View File

@@ -1,17 +1,17 @@
package mhfpacket package mhfpacket
import ( import (
"errors" "errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
) )
// MsgMhfEnumerateTitle represents the MSG_MHF_ENUMERATE_TITLE // MsgMhfEnumerateTitle represents the MSG_MHF_ENUMERATE_TITLE
type MsgMhfEnumerateTitle struct { type MsgMhfEnumerateTitle struct {
AckHandle uint32 AckHandle uint32
Unk0 uint32 CharID uint32
} }
// Opcode returns the ID associated with this packet type. // Opcode returns the ID associated with this packet type.
@@ -21,9 +21,9 @@ func (m *MsgMhfEnumerateTitle) Opcode() network.PacketID {
// Parse parses the packet from binary // Parse parses the packet from binary
func (m *MsgMhfEnumerateTitle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { func (m *MsgMhfEnumerateTitle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32() m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32() m.CharID = bf.ReadUint32()
return nil return nil
} }
// Build builds a binary packet from the current data. // Build builds a binary packet from the current data.

View File

@@ -154,7 +154,6 @@ func handleMsgMhfLoadHouse(s *Session, p mhfpacket.MHFPacket) {
bf.WriteBytes(data) bf.WriteBytes(data)
case 4: // Bookshelf case 4: // Bookshelf
// Hunting log // Hunting log
// Street names/Aliases
bf.WriteBytes(make([]byte, 5576)) bf.WriteBytes(make([]byte, 5576))
case 5: // Gallery case 5: // Gallery
// Furniture placement // Furniture placement
@@ -279,14 +278,18 @@ func handleMsgMhfSaveDecoMyset(s *Session, p mhfpacket.MHFPacket) {
func handleMsgMhfEnumerateTitle(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfEnumerateTitle(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfEnumerateTitle) pkt := p.(*mhfpacket.MsgMhfEnumerateTitle)
bf := byteframe.NewByteFrame() bf := byteframe.NewByteFrame()
titleCount := 114 // all titles unlocked if pkt.CharID == s.charID {
bf.WriteUint16(uint16(titleCount)) // title count titleCount := 114 // all titles unlocked
bf.WriteUint16(0) // unk bf.WriteUint16(uint16(titleCount)) // title count
for i := 0; i < titleCount; i++ { bf.WriteUint16(0) // unk
bf.WriteUint16(uint16(i)) for i := 0; i < titleCount; i++ {
bf.WriteUint16(0) // unk bf.WriteUint16(uint16(i))
bf.WriteUint32(0) // timestamp acquired bf.WriteUint16(0) // unk
bf.WriteUint32(0) // timestamp updated bf.WriteUint32(0) // timestamp acquired
bf.WriteUint32(0) // timestamp updated
}
} else {
bf.WriteUint16(0)
} }
doAckBufSucceed(s, pkt.AckHandle, bf.Data()) doAckBufSucceed(s, pkt.AckHandle, bf.Data())
} }