mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
parse enumerate title further
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateTitle represents the MSG_MHF_ENUMERATE_TITLE
|
||||
type MsgMhfEnumerateTitle struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
AckHandle uint32
|
||||
CharID uint32
|
||||
}
|
||||
|
||||
// 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
|
||||
func (m *MsgMhfEnumerateTitle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.CharID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -154,7 +154,6 @@ func handleMsgMhfLoadHouse(s *Session, p mhfpacket.MHFPacket) {
|
||||
bf.WriteBytes(data)
|
||||
case 4: // Bookshelf
|
||||
// Hunting log
|
||||
// Street names/Aliases
|
||||
bf.WriteBytes(make([]byte, 5576))
|
||||
case 5: // Gallery
|
||||
// Furniture placement
|
||||
@@ -279,14 +278,18 @@ func handleMsgMhfSaveDecoMyset(s *Session, p mhfpacket.MHFPacket) {
|
||||
func handleMsgMhfEnumerateTitle(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgMhfEnumerateTitle)
|
||||
bf := byteframe.NewByteFrame()
|
||||
titleCount := 114 // all titles unlocked
|
||||
bf.WriteUint16(uint16(titleCount)) // title count
|
||||
bf.WriteUint16(0) // unk
|
||||
for i := 0; i < titleCount; i++ {
|
||||
bf.WriteUint16(uint16(i))
|
||||
bf.WriteUint16(0) // unk
|
||||
bf.WriteUint32(0) // timestamp acquired
|
||||
bf.WriteUint32(0) // timestamp updated
|
||||
if pkt.CharID == s.charID {
|
||||
titleCount := 114 // all titles unlocked
|
||||
bf.WriteUint16(uint16(titleCount)) // title count
|
||||
bf.WriteUint16(0) // unk
|
||||
for i := 0; i < titleCount; i++ {
|
||||
bf.WriteUint16(uint16(i))
|
||||
bf.WriteUint16(0) // unk
|
||||
bf.WriteUint32(0) // timestamp acquired
|
||||
bf.WriteUint32(0) // timestamp updated
|
||||
}
|
||||
} else {
|
||||
bf.WriteUint16(0)
|
||||
}
|
||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user