mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
fix alliance enumeration bugs
This commit is contained in:
@@ -1197,14 +1197,28 @@ func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case mhfpacket.ENUMERATE_ALLIANCE_TYPE_ORDER_MEMBERS:
|
case mhfpacket.ENUMERATE_ALLIANCE_TYPE_ORDER_MEMBERS:
|
||||||
sort.Slice(tempAlliances, func(i, j int) bool {
|
sorting := bf.ReadBool()
|
||||||
return tempAlliances[i].TotalMembers < tempAlliances[j].TotalMembers
|
if sorting {
|
||||||
})
|
sort.Slice(tempAlliances, func(i, j int) bool {
|
||||||
|
return tempAlliances[i].TotalMembers > tempAlliances[j].TotalMembers
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
sort.Slice(tempAlliances, func(i, j int) bool {
|
||||||
|
return tempAlliances[i].TotalMembers < tempAlliances[j].TotalMembers
|
||||||
|
})
|
||||||
|
}
|
||||||
alliances = tempAlliances
|
alliances = tempAlliances
|
||||||
case mhfpacket.ENUMERATE_ALLIANCE_TYPE_ORDER_REGISTRATION:
|
case mhfpacket.ENUMERATE_ALLIANCE_TYPE_ORDER_REGISTRATION:
|
||||||
sort.Slice(tempAlliances, func(i, j int) bool {
|
sorting := bf.ReadBool()
|
||||||
return tempAlliances[i].CreatedAt.Unix() < tempAlliances[j].CreatedAt.Unix()
|
if sorting {
|
||||||
})
|
sort.Slice(tempAlliances, func(i, j int) bool {
|
||||||
|
return tempAlliances[i].CreatedAt.Unix() > tempAlliances[j].CreatedAt.Unix()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
sort.Slice(tempAlliances, func(i, j int) bool {
|
||||||
|
return tempAlliances[i].CreatedAt.Unix() < tempAlliances[j].CreatedAt.Unix()
|
||||||
|
})
|
||||||
|
}
|
||||||
alliances = tempAlliances
|
alliances = tempAlliances
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1218,8 +1232,8 @@ func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
|
|
||||||
if pkt.Type > 8 {
|
if pkt.Type > 8 {
|
||||||
bf.WriteUint16(uint16(len(alliances)))
|
bf.WriteUint16(uint16(len(alliances)))
|
||||||
|
bf.WriteUint8(0x00) // Unk
|
||||||
for _, alliance := range alliances {
|
for _, alliance := range alliances {
|
||||||
bf.WriteUint8(0x00) // Unk
|
|
||||||
bf.WriteUint32(alliance.ID)
|
bf.WriteUint32(alliance.ID)
|
||||||
bf.WriteUint32(alliance.ParentGuild.LeaderCharID)
|
bf.WriteUint32(alliance.ParentGuild.LeaderCharID)
|
||||||
bf.WriteUint16(alliance.TotalMembers)
|
bf.WriteUint16(alliance.TotalMembers)
|
||||||
|
|||||||
Reference in New Issue
Block a user