diff --git a/network/mhfpacket/msg_mhf_guild_huntdata.go b/network/mhfpacket/msg_mhf_guild_huntdata.go index b744cce23..9e114c968 100644 --- a/network/mhfpacket/msg_mhf_guild_huntdata.go +++ b/network/mhfpacket/msg_mhf_guild_huntdata.go @@ -1,17 +1,18 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGuildHuntdata represents the MSG_MHF_GUILD_HUNTDATA -type MsgMhfGuildHuntdata struct{ - AckHandle uint32 - Unk0 uint8 +type MsgMhfGuildHuntdata struct { + AckHandle uint32 + Operation uint8 + GuildID uint32 } // Opcode returns the ID associated with this packet type. @@ -22,7 +23,10 @@ func (m *MsgMhfGuildHuntdata) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGuildHuntdata) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint8() + m.Operation = bf.ReadUint8() + if m.Operation == 1 { + m.GuildID = bf.ReadUint32() + } return nil } diff --git a/server/channelserver/handlers.go b/server/channelserver/handlers.go index b0c4d8d7d..a198933ad 100644 --- a/server/channelserver/handlers.go +++ b/server/channelserver/handlers.go @@ -1767,8 +1767,9 @@ func handleMsgMhfUpdateEquipSkinHist(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfGetUdShopCoin(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetUdShopCoin) - data, _ := hex.DecodeString("0000000000000001") - doAckBufSucceed(s, pkt.AckHandle, data) + bf := byteframe.NewByteFrame() + bf.WriteUint32(0) + doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfUseUdShopCoin(s *Session, p mhfpacket.MHFPacket) {} diff --git a/server/channelserver/handlers_guild.go b/server/channelserver/handlers_guild.go index c79fd9839..3a4b047fc 100644 --- a/server/channelserver/handlers_guild.go +++ b/server/channelserver/handlers_guild.go @@ -1260,9 +1260,16 @@ func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) { bf = byteframe.NewByteFrame() if pkt.Type > 8 { - bf.WriteUint16(uint16(len(alliances))) + if len(guilds) > 10 { + bf.WriteUint16(10) + } else { + bf.WriteUint16(uint16(len(alliances))) + } bf.WriteUint8(0x00) // Unk - for _, alliance := range alliances { + for i, alliance := range alliances { + if i == 10 { + break + } bf.WriteUint32(alliance.ID) bf.WriteUint32(alliance.ParentGuild.LeaderCharID) bf.WriteUint16(alliance.TotalMembers) @@ -1281,9 +1288,16 @@ func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) { bf.WriteBool(true) // TODO: Enable GuildAlliance applications } } else { - bf.WriteUint16(uint16(len(guilds))) + if len(guilds) > 10 { + bf.WriteUint16(10) + } else { + bf.WriteUint16(uint16(len(guilds))) + } bf.WriteUint8(0x01) // Unk - for _, guild := range guilds { + for i, guild := range guilds { + if i == 10 { + break + } bf.WriteUint32(guild.ID) bf.WriteUint32(guild.LeaderCharID) bf.WriteUint16(guild.MemberCount) @@ -1792,7 +1806,20 @@ func handleMsgMhfGetGuildWeeklyBonusActiveCount(s *Session, p mhfpacket.MHFPacke func handleMsgMhfGuildHuntdata(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGuildHuntdata) - doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) + bf := byteframe.NewByteFrame() + switch pkt.Operation { + case 0: // Unk + doAckBufSucceed(s, pkt.AckHandle, []byte{}) + case 1: // Get Huntdata + bf.WriteUint8(0) // Entries + /* Entry format + uint32 UnkID + uint32 MonID + */ + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + case 2: // Unk, controls glow + doAckBufSucceed(s, pkt.AckHandle, []byte{0x00, 0x00}) + } } type MessageBoardPost struct {