mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
treasure expiration and prevent overflow
This commit is contained in:
@@ -27,7 +27,7 @@ func handleMsgMhfEnumerateGuildTresure(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
}
|
}
|
||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
hunts := 0
|
hunts := 0
|
||||||
rows, _ := s.server.db.Queryx("SELECT id, host_id, destination, level, return, acquired, claimed, hunters, treasure, hunt_data FROM guild_hunts WHERE guild_id=$1", guild.ID)
|
rows, _ := s.server.db.Queryx("SELECT id, host_id, destination, level, return, acquired, claimed, hunters, treasure, hunt_data FROM guild_hunts WHERE guild_id=$1 AND $2 < return+604800", guild.ID, Time_Current_Adjusted().Unix())
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
hunt := &TreasureHunt{}
|
hunt := &TreasureHunt{}
|
||||||
err = rows.StructScan(&hunt)
|
err = rows.StructScan(&hunt)
|
||||||
@@ -51,6 +51,9 @@ func handleMsgMhfEnumerateGuildTresure(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
bf.WriteBytes(hunt.HuntData)
|
bf.WriteBytes(hunt.HuntData)
|
||||||
break
|
break
|
||||||
} else if pkt.MaxHunts == 30 && hunt.Acquired && hunt.Level == 2 {
|
} else if pkt.MaxHunts == 30 && hunt.Acquired && hunt.Level == 2 {
|
||||||
|
if hunts == 30 {
|
||||||
|
break
|
||||||
|
}
|
||||||
hunts++
|
hunts++
|
||||||
bf.WriteUint32(hunt.HuntID)
|
bf.WriteUint32(hunt.HuntID)
|
||||||
bf.WriteUint32(hunt.Destination)
|
bf.WriteUint32(hunt.Destination)
|
||||||
|
|||||||
Reference in New Issue
Block a user