Fix stability issues and a various assortment of other bugs
This commit is contained in:
@@ -3,6 +3,7 @@ package rs09.game.system
|
||||
import com.github.ajalt.mordant.rendering.TextColors
|
||||
import com.github.ajalt.mordant.terminal.Terminal
|
||||
import gui.GuiEvent
|
||||
import gui.ServerMonitor
|
||||
import rs09.ServerConstants
|
||||
import java.io.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -46,7 +47,7 @@ object SystemLogger {
|
||||
val msg = "${getTime()}: [INFO] $m"
|
||||
if(m.isNotBlank()) {
|
||||
t.println(msg)
|
||||
//ServerMonitor.eventQueue.add(GuiEvent.AddDefaultMessage(msg))
|
||||
ServerMonitor.eventQueue.add(GuiEvent.AddDefaultMessage(msg))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +57,7 @@ object SystemLogger {
|
||||
val msg = "${getTime()}: [ ERR] $message"
|
||||
if(message.isNotBlank()) {
|
||||
t.println(msg)
|
||||
//ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
|
||||
ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +66,7 @@ object SystemLogger {
|
||||
val msg = "${getTime()}: [WARN] $message"
|
||||
if(message.isNotBlank()) {
|
||||
t.println(msg)
|
||||
//ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
|
||||
ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +75,7 @@ object SystemLogger {
|
||||
val msg = "${getTime()}: [ALRT] $message"
|
||||
if(message.isNotBlank()) {
|
||||
t.println(msg)
|
||||
//ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
|
||||
ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +84,7 @@ object SystemLogger {
|
||||
val msg = "${getTime()}: [AIPL] $message"
|
||||
if(message.isNotBlank()) {
|
||||
t.println(msg)
|
||||
//ServerMonitor.eventQueue.add(GuiEvent.AddAIPMessage(msg))
|
||||
ServerMonitor.eventQueue.add(GuiEvent.AddAIPMessage(msg))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package rs09.game.system.command
|
||||
|
||||
import core.game.node.entity.player.Player
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
|
||||
/**
|
||||
* Base class for Commands in the new system. Can pass a lambda as part of the constructor or after the constructor.
|
||||
@@ -10,7 +10,7 @@ import rs09.game.world.World
|
||||
class Command(val name: String, val privilege: Privilege, val handle: (Player, Array<String>) -> Unit) {
|
||||
fun attemptHandling(player: Player, args: Array<String>?){
|
||||
args ?: return
|
||||
if(player.rights.ordinal >= privilege.ordinal || World.settings?.isDevMode == true){
|
||||
if(player.rights.ordinal >= privilege.ordinal || GameWorld.settings?.isDevMode == true){
|
||||
handle(player,args)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import core.game.node.entity.skill.Skills
|
||||
import rs09.game.system.command.CommandPlugin
|
||||
import core.game.system.command.CommandSet
|
||||
import core.game.system.task.Pulse
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
import rs09.game.world.ImmerseWorld
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.RegionManager
|
||||
@@ -119,7 +119,7 @@ class AIPCommandPlugin : CommandPlugin() {
|
||||
player.communication.clan.clanWar.fireEvent("join", aip)
|
||||
}
|
||||
}
|
||||
World.Pulser.submit(object : Pulse(1) {
|
||||
GameWorld.Pulser.submit(object : Pulse(1) {
|
||||
override fun pulse(): Boolean {
|
||||
aip.follow(l)
|
||||
return true
|
||||
|
||||
@@ -24,7 +24,7 @@ import core.net.packet.out.Varbit
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import rs09.game.system.command.CommandPlugin
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
import java.awt.Toolkit
|
||||
import java.awt.datatransfer.StringSelection
|
||||
|
||||
@@ -293,7 +293,7 @@ class VisualCommand : CommandPlugin() {
|
||||
"loop_inter" -> {
|
||||
val st = toInteger(args!![1]!!)
|
||||
val en = if (args.size > 2) toInteger(args[2]!!) else 740
|
||||
World.Pulser.submit(object : Pulse(3, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(3, player) {
|
||||
var id = st
|
||||
override fun pulse(): Boolean {
|
||||
// PacketRepository.send(Interface.class, new InterfaceContext(player, 548, 77, id, false));
|
||||
@@ -307,7 +307,7 @@ class VisualCommand : CommandPlugin() {
|
||||
"loop_iconfig" -> {
|
||||
val st = toInteger(args!![1]!!)
|
||||
val en = if (args.size > 2) toInteger(args[2]!!) else 740
|
||||
World.Pulser.submit(object : Pulse(3, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(3, player) {
|
||||
var id = 0
|
||||
override fun pulse(): Boolean {
|
||||
// PacketRepository.send(Interface.class, new InterfaceContext(player, 548, 77, id, false));
|
||||
@@ -321,7 +321,7 @@ class VisualCommand : CommandPlugin() {
|
||||
"loop_itemoni" -> {
|
||||
val st = toInteger(args!![1]!!)
|
||||
val en = if (args.size > 2) toInteger(args[2]!!) else 740
|
||||
World.Pulser.submit(object : Pulse(1, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(1, player) {
|
||||
var id = 0
|
||||
override fun pulse(): Boolean {
|
||||
// PacketRepository.send(Interface.class, new InterfaceContext(player, 548, 77, id, false));
|
||||
@@ -371,7 +371,7 @@ class VisualCommand : CommandPlugin() {
|
||||
"loop_oa" -> {
|
||||
val startId = toInteger(args!![1]!!)
|
||||
val endId = if (args.size > 2) toInteger(args[2]!!) else 11000
|
||||
World.Pulser.submit(object : Pulse(3, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(3, player) {
|
||||
var id = startId
|
||||
override fun pulse(): Boolean {
|
||||
val `object` = RegionManager.getObject(player!!.location)
|
||||
@@ -389,7 +389,7 @@ class VisualCommand : CommandPlugin() {
|
||||
"loop_anim" -> {
|
||||
val start = toInteger(args!![1]!!)
|
||||
val end = if (args.size > 2) toInteger(args[2]!!) else 11000
|
||||
World.Pulser.submit(object : Pulse(3, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(3, player) {
|
||||
var id = start
|
||||
override fun pulse(): Boolean {
|
||||
player!!.animate(Animation.create(id))
|
||||
@@ -402,7 +402,7 @@ class VisualCommand : CommandPlugin() {
|
||||
"loop_gfx" -> {
|
||||
val s = toInteger(args!![1]!!)
|
||||
val e = if (args.size > 2) toInteger(args[2]!!) else 11000
|
||||
World.Pulser.submit(object : Pulse(3, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(3, player) {
|
||||
var id = s
|
||||
override fun pulse(): Boolean {
|
||||
Projectile.create(player!!.location, player.location.transform(0, 3, 0), id, 42, 36, 46, 75, 5, 11).send()
|
||||
|
||||
@@ -6,7 +6,7 @@ import core.game.world.update.flag.context.Animation
|
||||
import core.plugin.Initializable
|
||||
import rs09.game.system.command.Command
|
||||
import rs09.game.system.command.CommandPlugin.Companion.toInteger
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
import java.util.*
|
||||
|
||||
@Initializable
|
||||
@@ -40,7 +40,7 @@ class AnimationCommandSet : CommandSet(Command.Privilege.ADMIN) {
|
||||
notify(player, "Really...? $end times...? Looping 25 times instead.")
|
||||
end = 25
|
||||
}
|
||||
World.Pulser.submit(object : Pulse(3, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(3, player) {
|
||||
var id = start
|
||||
override fun pulse(): Boolean {
|
||||
player.animate(Animation.create(id))
|
||||
|
||||
@@ -7,14 +7,14 @@ import rs09.game.ai.general.GeneralBotCreator
|
||||
import rs09.game.ai.general.scriptrepository.PlayerScripts
|
||||
import rs09.game.ai.general.scriptrepository.Script
|
||||
import rs09.game.system.command.Command
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
import rs09.tools.stringtools.colorize
|
||||
|
||||
@Initializable
|
||||
class BottingCommandSet : CommandSet(Command.Privilege.STANDARD) {
|
||||
override fun defineCommands() {
|
||||
define("scripts"){player, _ ->
|
||||
if(World.settings?.enabled_botting != true){
|
||||
if(GameWorld.settings?.enabled_botting != true){
|
||||
player.sendChat("I just tried to do something silly!")
|
||||
return@define
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class BottingCommandSet : CommandSet(Command.Privilege.STANDARD) {
|
||||
player.interfaceManager.open(Component(Components.QUESTJOURNAL_SCROLL_275))
|
||||
}
|
||||
define("script"){player,args ->
|
||||
if(World.settings?.enabled_botting != true){
|
||||
if(GameWorld.settings?.enabled_botting != true){
|
||||
player.sendChat("I just tried to do something very silly!")
|
||||
return@define
|
||||
}
|
||||
|
||||
@@ -10,9 +10,10 @@ import core.game.world.map.RegionManager
|
||||
import core.game.world.update.flag.context.Animation
|
||||
import core.plugin.Initializable
|
||||
import rs09.game.content.dialogue.DialogueFile
|
||||
import rs09.game.interaction.InteractionListeners
|
||||
import rs09.game.interaction.SpadeDigListener
|
||||
import rs09.game.system.command.Command
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
import rs09.tools.END_DIALOGUE
|
||||
import java.util.*
|
||||
|
||||
@@ -105,7 +106,7 @@ class FunCommandSet : CommandSet(Command.Privilege.ADMIN) {
|
||||
player.appearance.rideCart(boneMode)
|
||||
if (player.appearance.isRidingMinecart) {
|
||||
var i = 0
|
||||
World.Pulser.submit(object : Pulse(1, player) {
|
||||
GameWorld.Pulser.submit(object : Pulse(1, player) {
|
||||
override fun pulse(): Boolean {
|
||||
if (i++ % 12 == 0) player.sendChat("I want to get off Mr. Bones Wild Ride.")
|
||||
player.moveStep()
|
||||
|
||||
@@ -4,7 +4,7 @@ import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.info.Rights
|
||||
import rs09.game.system.command.Command
|
||||
import core.game.system.task.Pulse
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
import core.game.world.map.Location
|
||||
import rs09.game.world.repository.Repository
|
||||
import core.plugin.Initializable
|
||||
@@ -66,7 +66,7 @@ class ModerationCommandSet : CommandSet(Command.Privilege.MODERATOR){
|
||||
|
||||
notify(player, "Jailing ${otherPlayer!!.username} for $timeSeconds seconds.")
|
||||
notify(otherPlayer, "${player.username} has jailed you for $timeSeconds seconds.")
|
||||
World.Pulser.submit(object : Pulse(3){
|
||||
GameWorld.Pulser.submit(object : Pulse(3){
|
||||
val originalLoc = otherPlayer.location
|
||||
val releaseTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(timeSeconds.toLong())
|
||||
override fun pulse(): Boolean {
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.json.simple.JSONObject
|
||||
import org.json.simple.parser.JSONParser
|
||||
import rs09.ServerConstants
|
||||
import rs09.game.system.SystemLogger
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameWorld
|
||||
import rs09.game.world.repository.Repository
|
||||
import java.io.FileReader
|
||||
import java.nio.ByteBuffer
|
||||
@@ -86,7 +86,7 @@ class GroundSpawnLoader {
|
||||
}
|
||||
|
||||
override fun respawn() {
|
||||
World.Pulser.submit(object : Pulse(respawnDuration) {
|
||||
GameWorld.Pulser.submit(object : Pulse(respawnDuration) {
|
||||
override fun pulse(): Boolean {
|
||||
GroundItemManager.create(this@GroundSpawn)
|
||||
return true
|
||||
|
||||
@@ -2,11 +2,13 @@ package rs09.game.system.config
|
||||
|
||||
import com.moandjiezana.toml.Toml
|
||||
import core.game.world.map.Location
|
||||
import core.tools.StringUtils
|
||||
import core.tools.mysql.Database
|
||||
import rs09.JSONUtils.Companion.parsePath
|
||||
import rs09.ServerConstants
|
||||
import rs09.game.system.SystemLogger
|
||||
import rs09.game.world.WorldSettings
|
||||
import rs09.game.world.World
|
||||
import rs09.game.world.GameSettings
|
||||
import rs09.game.world.GameWorld
|
||||
import java.io.File
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
@@ -42,7 +44,7 @@ object ServerConfigParser {
|
||||
tomlData ?: return
|
||||
val data = tomlData!!
|
||||
|
||||
World.settings = WorldSettings(
|
||||
GameWorld.settings = GameSettings(
|
||||
name = ServerConstants.SERVER_NAME,
|
||||
isBeta = data.getBoolean("world.debug"),
|
||||
isDevMode = data.getBoolean("world.dev"),
|
||||
@@ -96,8 +98,6 @@ object ServerConfigParser {
|
||||
ServerConstants.HOME_LOCATION = parseLocation(data.getString("world.home_location"))
|
||||
ServerConstants.START_LOCATION = parseLocation(data.getString("world.new_player_location"))
|
||||
ServerConstants.DAILY_RESTART = data.getBoolean("world.daily_restart")
|
||||
ServerConstants.ALLOW_GUI = data.getBoolean("world.start_gui")
|
||||
ServerConstants.GRAND_EXCHANGE_DATA_PATH = data.getPath("paths.eco_data")
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user