fix unneeded enumerations

This commit is contained in:
wish
2022-08-26 16:08:51 +10:00
parent 951c8e9c21
commit f80a807fb1
2 changed files with 18 additions and 3 deletions

View File

@@ -245,7 +245,11 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) {
func handleMsgMhfStateFestaU(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfStateFestaU(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfStateFestaU) pkt := p.(*mhfpacket.MsgMhfStateFestaU)
guild, err := GetGuildInfoByCharacterId(s, s.charID) guild, err := GetGuildInfoByCharacterId(s, s.charID)
if err != nil || guild == nil { applicant := false
if guild != nil {
applicant, _ = guild.HasApplicationForCharID(s, s.charID)
}
if err != nil || guild == nil || applicant {
doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4)) doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4))
return return
} }
@@ -261,7 +265,10 @@ func handleMsgMhfStateFestaU(s *Session, p mhfpacket.MHFPacket) {
func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfStateFestaG) pkt := p.(*mhfpacket.MsgMhfStateFestaG)
guild, err := GetGuildInfoByCharacterId(s, s.charID) guild, err := GetGuildInfoByCharacterId(s, s.charID)
applicant, _ := guild.HasApplicationForCharID(s, s.charID) applicant := false
if guild != nil {
applicant, _ = guild.HasApplicationForCharID(s, s.charID)
}
resp := byteframe.NewByteFrame() resp := byteframe.NewByteFrame()
if err != nil || guild == nil || applicant { if err != nil || guild == nil || applicant {
resp.WriteUint32(0) resp.WriteUint32(0)
@@ -274,7 +281,7 @@ func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) {
} }
resp.WriteUint32(guild.Souls) resp.WriteUint32(guild.Souls)
resp.WriteUint32(0) // unk resp.WriteUint32(0) // unk
resp.WriteUint32(1) // unk, rank? resp.WriteUint32(0) // unk, rank?
resp.WriteUint32(0) // unk resp.WriteUint32(0) // unk
resp.WriteUint32(0) // unk resp.WriteUint32(0) // unk
doAckBufSucceed(s, pkt.AckHandle, resp.Data()) doAckBufSucceed(s, pkt.AckHandle, resp.Data())

View File

@@ -1276,6 +1276,14 @@ func handleMsgMhfEnumerateGuildMember(s *Session, p mhfpacket.MHFPacket) {
guild, err = GetGuildInfoByCharacterId(s, s.charID) guild, err = GetGuildInfoByCharacterId(s, s.charID)
} }
if guild != nil {
isApplicant, _ := guild.HasApplicationForCharID(s, s.charID)
if isApplicant {
doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4))
return
}
}
if guild == nil && s.prevGuildID > 0 { if guild == nil && s.prevGuildID > 0 {
guild, err = GetGuildInfoByID(s, s.prevGuildID) guild, err = GetGuildInfoByID(s, s.prevGuildID)
} }