diff --git a/network/mhfpacket/msg_mhf_enumerate_guild_member.go b/network/mhfpacket/msg_mhf_enumerate_guild_member.go index f30f24319..3167ca951 100644 --- a/network/mhfpacket/msg_mhf_enumerate_guild_member.go +++ b/network/mhfpacket/msg_mhf_enumerate_guild_member.go @@ -6,7 +6,12 @@ import ( ) // MsgMhfEnumerateGuildMember represents the MSG_MHF_ENUMERATE_GUILD_MEMBER -type MsgMhfEnumerateGuildMember struct{} +type MsgMhfEnumerateGuildMember struct { + AckHandle uint32 + Unk0 uint16 // Hardcoed 00 01 in the binary + Unk1 uint32 + Unk2 uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfEnumerateGuildMember) Opcode() network.PacketID { @@ -15,10 +20,14 @@ func (m *MsgMhfEnumerateGuildMember) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfEnumerateGuildMember) Parse(bf *byteframe.ByteFrame) error { - panic("Not implemented") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint16() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. func (m *MsgMhfEnumerateGuildMember) Build(bf *byteframe.ByteFrame) error { panic("Not implemented") -} \ No newline at end of file +} diff --git a/network/mhfpacket/msg_mhf_info_guild.go b/network/mhfpacket/msg_mhf_info_guild.go index dad8df62a..111831cac 100644 --- a/network/mhfpacket/msg_mhf_info_guild.go +++ b/network/mhfpacket/msg_mhf_info_guild.go @@ -6,7 +6,10 @@ import ( ) // MsgMhfInfoGuild represents the MSG_MHF_INFO_GUILD -type MsgMhfInfoGuild struct{} +type MsgMhfInfoGuild struct { + AckHandle uint32 + Unk0 uint32 // Probably a guild ID, but unverified. +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfInfoGuild) Opcode() network.PacketID { @@ -15,10 +18,12 @@ func (m *MsgMhfInfoGuild) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfInfoGuild) Parse(bf *byteframe.ByteFrame) error { - panic("Not implemented") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. func (m *MsgMhfInfoGuild) Build(bf *byteframe.ByteFrame) error { panic("Not implemented") -} \ No newline at end of file +} diff --git a/network/mhfpacket/msg_mhf_list_member.go b/network/mhfpacket/msg_mhf_list_member.go index 1d1023bdf..d4759378d 100644 --- a/network/mhfpacket/msg_mhf_list_member.go +++ b/network/mhfpacket/msg_mhf_list_member.go @@ -6,7 +6,10 @@ import ( ) // MsgMhfListMember represents the MSG_MHF_LIST_MEMBER -type MsgMhfListMember struct{} +type MsgMhfListMember struct{ + AckHandle uint32 + Unk0 uint16 // Hardcoded 01 00 in the JP client. +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfListMember) Opcode() network.PacketID { @@ -15,7 +18,9 @@ func (m *MsgMhfListMember) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfListMember) Parse(bf *byteframe.ByteFrame) error { - panic("Not implemented") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint16() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_state_festa_g.go b/network/mhfpacket/msg_mhf_state_festa_g.go index ba5d7158f..5651b611d 100644 --- a/network/mhfpacket/msg_mhf_state_festa_g.go +++ b/network/mhfpacket/msg_mhf_state_festa_g.go @@ -6,7 +6,12 @@ import ( ) // MsgMhfStateFestaG represents the MSG_MHF_STATE_FESTA_G -type MsgMhfStateFestaG struct{} +type MsgMhfStateFestaG struct{ + AckHandle uint32 + Unk0 uint32 // Shared ID of something. + Unk1 uint32 + Unk2 uint16 // Hardcoded 0 in the binary. +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfStateFestaG) Opcode() network.PacketID { @@ -15,7 +20,12 @@ func (m *MsgMhfStateFestaG) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfStateFestaG) Parse(bf *byteframe.ByteFrame) error { - panic("Not implemented") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadUint16() + + return nil } // Build builds a binary packet from the current data. diff --git a/server/channelserver/handlers.go b/server/channelserver/handlers.go index eae2f1a4c..7b1547247 100644 --- a/server/channelserver/handlers.go +++ b/server/channelserver/handlers.go @@ -655,7 +655,14 @@ func handleMsgMhfLoaddata(s *Session, p mhfpacket.MHFPacket) { doSizedAckResp(s, pkt.AckHandle, data) } -func handleMsgMhfListMember(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfListMember(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfListMember) + + resp := byteframe.NewByteFrame() + resp.WriteUint32(0) // Members count. (Unsure of what kind of members these actually are, guild, party, COG subscribers, etc.) + + doSizedAckResp(s, pkt.AckHandle, resp.Data()) +} func handleMsgMhfOprMember(s *Session, p mhfpacket.MHFPacket) {} @@ -757,7 +764,16 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfOperateGuildMember(s *Session, p mhfpacket.MHFPacket) {} -func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfInfoGuild) + + // REALLY large/complex format... stubbing it out here for simplicity. + resp := byteframe.NewByteFrame() + resp.WriteUint32(0) // Count + resp.WriteUint8(0) // Unk, read if count == 0. + + doSizedAckResp(s, pkt.AckHandle, resp.Data()) +} func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) {} @@ -765,7 +781,10 @@ func handleMsgMhfUpdateGuild(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfArrangeGuildMember(s *Session, p mhfpacket.MHFPacket) {} -func handleMsgMhfEnumerateGuildMember(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfEnumerateGuildMember(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfEnumerateGuildMember) + stubEnumerateNoResults(s, pkt.AckHandle) +} func handleMsgMhfEnumerateCampaign(s *Session, p mhfpacket.MHFPacket) {} @@ -868,9 +887,23 @@ func handleMsgMhfChargeFesta(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfAcquireFesta(s *Session, p mhfpacket.MHFPacket) {} +// state festa (U)ser func handleMsgMhfStateFestaU(s *Session, p mhfpacket.MHFPacket) {} -func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) {} +// state festa (G)uild +func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfStateFestaG) + + resp := byteframe.NewByteFrame() + resp.WriteUint32(0) + resp.WriteUint32(0) + resp.WriteUint32(0xFFFFFFFF) + resp.WriteUint32(0) + resp.WriteBytes([]byte{0x00, 0x00, 0x00}) // Not parsed. + resp.WriteUint8(0) + + doSizedAckResp(s, pkt.AckHandle, resp.Data()) +} func handleMsgMhfEnumerateFestaMember(s *Session, p mhfpacket.MHFPacket) {}