Graves Rewrite

Rewrote graves from scratch using new systems and abundant unit testing
Fixed a race condition bug that would prevent classes implementing PersistWorld from properly... persisting
Fixed a bug where graves were (still) too generous
Fixed a bug where graves would not persist across server reboots
Fixed a bug where graves would not recognize a relogged player
Fixed numerous other bugs with graves, see the unit tests for complete coverage
Grave system now supports quest requirements
This commit is contained in:
Ceikry
2022-09-17 14:40:25 +00:00
committed by Ryan
parent 95bd5ab4b7
commit f406b8aa98
23 changed files with 948 additions and 797 deletions
+6 -1
View File
@@ -3,6 +3,7 @@ import core.cache.crypto.ISAACCipher
import core.cache.crypto.ISAACPair
import core.game.node.entity.player.Player
import core.game.node.entity.player.info.PlayerDetails
import core.game.node.entity.player.info.Rights
import core.game.node.entity.player.link.IronmanMode
import core.game.node.item.Item
import core.net.IoSession
@@ -20,12 +21,16 @@ import rs09.game.world.update.UpdateSequence
import java.nio.ByteBuffer
object TestUtils {
fun getMockPlayer(name: String, ironman: IronmanMode = IronmanMode.NONE): Player {
var uidCounter = 0
fun getMockPlayer(name: String, ironman: IronmanMode = IronmanMode.NONE, rights: Rights = Rights.ADMINISTRATOR): Player {
val p = MockPlayer(name)
p.ironmanManager.mode = ironman
p.details.accountInfo.uid = uidCounter++
Repository.addPlayer(p)
//Update sequence has a separate list of players for some reason...
UpdateSequence.renderablePlayers.add(p)
p.details.rights = rights
return p
}