mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Added support for varying log levels configurable in the server config (see log_level in default.conf)
Error logs now properly print to stderr when possible Colour-coded logs Addressed a scenario in which outgoing packet writes could get hung up Fixed interface incorrect definition message on server startup
This commit is contained in:
parent
e1faa64af7
commit
88a2f354b4
171 changed files with 723 additions and 475 deletions
|
|
@ -197,6 +197,12 @@
|
|||
"walkable": "true",
|
||||
"tabIndex": "6"
|
||||
},
|
||||
{
|
||||
"id": "195",
|
||||
"interfaceType": "1",
|
||||
"walkable": "true",
|
||||
"tabIndex": "-1"
|
||||
},
|
||||
{
|
||||
"id": "198",
|
||||
"interfaceType": "1",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ package content.data.tables;
|
|||
import core.api.StartupListener;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.item.WeightedChanceItem;
|
||||
import core.tools.Log;
|
||||
import core.tools.RandomFunction;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import core.ServerConstants;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
|
@ -18,7 +18,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.tools.SystemLogger.logInfo;
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the allotment seed drop table.
|
||||
|
|
@ -57,11 +57,11 @@ public final class AllotmentSeedDropTable implements StartupListener {
|
|||
@Override
|
||||
public void startup() {
|
||||
if(ServerConstants.ASDT_DATA_PATH != null && !new File(ServerConstants.ASDT_DATA_PATH).exists()){
|
||||
SystemLogger.logErr(this.getClass(), "Can't locate ASDT file at " + ServerConstants.ASDT_DATA_PATH);
|
||||
log(this.getClass(), Log.ERR, "Can't locate ASDT file at " + ServerConstants.ASDT_DATA_PATH);
|
||||
return;
|
||||
}
|
||||
parse(ServerConstants.ASDT_DATA_PATH);
|
||||
logInfo(this.getClass(), "Initialized Allotment Seed Drop Table from " + ServerConstants.ASDT_DATA_PATH);
|
||||
log(this.getClass(), Log.FINE, "Initialized Allotment Seed Drop Table from " + ServerConstants.ASDT_DATA_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import core.api.StartupListener;
|
|||
import core.ServerConstants;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.item.WeightedChanceItem;
|
||||
import core.tools.SystemLogger;
|
||||
import core.tools.Log;
|
||||
import core.tools.RandomFunction;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
|
@ -18,7 +18,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.tools.SystemLogger.logInfo;
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the Chaos Elemental's minor drop table. It is supposed to roll this table alongside its standard major drops on the main table.
|
||||
|
|
@ -57,11 +57,11 @@ public final class CELEMinorTable implements StartupListener {
|
|||
@Override
|
||||
public void startup() {
|
||||
if(ServerConstants.CELEDT_DATA_PATH != null && !new File(ServerConstants.CELEDT_DATA_PATH).exists()){
|
||||
SystemLogger.logErr(this.getClass(), "Can't locate CELEDT file at " + ServerConstants.CELEDT_DATA_PATH);
|
||||
log(this.getClass(), Log.ERR, "Can't locate CELEDT file at " + ServerConstants.CELEDT_DATA_PATH);
|
||||
return;
|
||||
}
|
||||
parse(ServerConstants.CELEDT_DATA_PATH);
|
||||
logInfo(this.getClass(), "Loaded up Chaos Elemental drop table from " + ServerConstants.CELEDT_DATA_PATH);
|
||||
log(this.getClass(), Log.FINE, "Loaded up Chaos Elemental drop table from " + ServerConstants.CELEDT_DATA_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ package content.data.tables;
|
|||
import core.api.StartupListener;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.item.WeightedChanceItem;
|
||||
import core.tools.Log;
|
||||
import core.tools.RandomFunction;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import core.ServerConstants;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
|
@ -18,7 +18,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.tools.SystemLogger.logInfo;
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the gem drop table.
|
||||
|
|
@ -57,11 +57,11 @@ public final class GemDropTable implements StartupListener {
|
|||
@Override
|
||||
public void startup() {
|
||||
if(ServerConstants.GDT_DATA_PATH != null && !new File(ServerConstants.GDT_DATA_PATH).exists()){
|
||||
SystemLogger.logErr(this.getClass(), "Can't locate GDT file at " + ServerConstants.GDT_DATA_PATH);
|
||||
log(this.getClass(), Log.ERR, "Can't locate GDT file at " + ServerConstants.GDT_DATA_PATH);
|
||||
return;
|
||||
}
|
||||
parse(ServerConstants.GDT_DATA_PATH);
|
||||
logInfo(this.getClass(), "Initialized Gem Drop Table from " + ServerConstants.GDT_DATA_PATH);
|
||||
log(this.getClass(), Log.FINE, "Initialized Gem Drop Table from " + ServerConstants.GDT_DATA_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ package content.data.tables;
|
|||
import core.api.StartupListener;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.item.WeightedChanceItem;
|
||||
import core.tools.Log;
|
||||
import core.tools.RandomFunction;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import core.ServerConstants;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
|
@ -18,7 +18,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.tools.SystemLogger.logInfo;
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the herb drop table.
|
||||
|
|
@ -57,11 +57,11 @@ public final class HerbDropTable implements StartupListener {
|
|||
@Override
|
||||
public void startup() {
|
||||
if(ServerConstants.HDT_DATA_PATH != null && !new File(ServerConstants.HDT_DATA_PATH).exists()){
|
||||
SystemLogger.logErr(this.getClass(), "Can't locate HDT file at " + ServerConstants.HDT_DATA_PATH);
|
||||
log(this.getClass(), Log.ERR, "Can't locate HDT file at " + ServerConstants.HDT_DATA_PATH);
|
||||
return;
|
||||
}
|
||||
parse(ServerConstants.HDT_DATA_PATH);
|
||||
logInfo(this.getClass(), "Initialized Herb Drop Table from " + ServerConstants.HDT_DATA_PATH);
|
||||
log(this.getClass(), Log.FINE, "Initialized Herb Drop Table from " + ServerConstants.HDT_DATA_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@ package content.data.tables
|
|||
|
||||
import core.ServerConstants
|
||||
import core.api.StartupListener
|
||||
import core.api.log
|
||||
import core.api.shouldRemoveNothings
|
||||
import core.api.utils.WeightBasedTable
|
||||
import core.api.utils.WeightedItem
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.tools.Log
|
||||
import core.tools.RandomFunction
|
||||
import core.tools.SystemLogger.logErr
|
||||
import core.tools.SystemLogger.logInfo
|
||||
import org.rs09.consts.Items
|
||||
import org.w3c.dom.Element
|
||||
import org.w3c.dom.Node
|
||||
|
|
@ -26,11 +26,11 @@ import javax.xml.parsers.ParserConfigurationException
|
|||
class RareDropTable : StartupListener {
|
||||
override fun startup() {
|
||||
if (ServerConstants.RDT_DATA_PATH != null && !File(ServerConstants.RDT_DATA_PATH).exists()) {
|
||||
logErr(this.javaClass, "Can't locate RDT file at " + ServerConstants.RDT_DATA_PATH)
|
||||
log(this::class.java, Log.ERR, "Can't locate RDT file at " + ServerConstants.RDT_DATA_PATH)
|
||||
return
|
||||
}
|
||||
parse(ServerConstants.RDT_DATA_PATH)
|
||||
logInfo(this.javaClass, "Initialized Rare Drop Table from " + ServerConstants.RDT_DATA_PATH)
|
||||
log(this::class.java, Log.FINE, "Initialized Rare Drop Table from " + ServerConstants.RDT_DATA_PATH)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ package content.data.tables;
|
|||
import core.api.StartupListener;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.item.WeightedChanceItem;
|
||||
import core.tools.Log;
|
||||
import core.tools.RandomFunction;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import core.ServerConstants;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
|
@ -18,7 +18,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.tools.SystemLogger.logInfo;
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the rare seed drop table.
|
||||
|
|
@ -57,11 +57,11 @@ public final class RareSeedDropTable implements StartupListener {
|
|||
@Override
|
||||
public void startup() {
|
||||
if(ServerConstants.RSDT_DATA_PATH != null && !new File(ServerConstants.RSDT_DATA_PATH).exists()){
|
||||
SystemLogger.logErr(this.getClass(), "Can't locate RSDT file at " + ServerConstants.RSDT_DATA_PATH);
|
||||
log(this.getClass(), Log.ERR, "Can't locate RSDT file at " + ServerConstants.RSDT_DATA_PATH);
|
||||
return;
|
||||
}
|
||||
parse(ServerConstants.RSDT_DATA_PATH);
|
||||
logInfo(this.getClass(), "Initialized Rare Seed Drop Table from " + ServerConstants.RSDT_DATA_PATH);
|
||||
log(this.getClass(), Log.FINE, "Initialized Rare Seed Drop Table from " + ServerConstants.RSDT_DATA_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ package content.data.tables;
|
|||
import core.api.StartupListener;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.item.WeightedChanceItem;
|
||||
import core.tools.Log;
|
||||
import core.tools.RandomFunction;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import core.ServerConstants;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
|
@ -18,7 +18,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.tools.SystemLogger.logInfo;
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the uncommon seed drop table.
|
||||
|
|
@ -57,11 +57,11 @@ public final class UncommonSeedDropTable implements StartupListener {
|
|||
@Override
|
||||
public void startup() {
|
||||
if(ServerConstants.USDT_DATA_PATH != null && !new File(ServerConstants.USDT_DATA_PATH).exists()){
|
||||
SystemLogger.logErr(this.getClass(), "Can't locate USDT file at " + ServerConstants.USDT_DATA_PATH);
|
||||
log(this.getClass(), Log.ERR, "Can't locate USDT file at " + ServerConstants.USDT_DATA_PATH);
|
||||
return;
|
||||
}
|
||||
parse(ServerConstants.USDT_DATA_PATH);
|
||||
logInfo(this.getClass(), "Initialized Uncommon Seed Drop Table from " + ServerConstants.USDT_DATA_PATH);
|
||||
log(this.getClass(), Log.FINE, "Initialized Uncommon Seed Drop Table from " + ServerConstants.USDT_DATA_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class LarryHandler(player: Player? = null) : core.game.dialogue.DialoguePlugin(p
|
|||
}
|
||||
|
||||
val level = getStatLevel(player, skill)
|
||||
System.out.println("Level: $level")
|
||||
|
||||
val expGained = points?.toDouble()?.times((level * 25))
|
||||
System.out.print("exp: $expGained")
|
||||
player.skills.addExperience(skill,expGained!!)
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@ package content.global.activity.penguinhns
|
|||
import org.json.simple.JSONObject
|
||||
import core.ServerStore
|
||||
import core.api.StartupListener
|
||||
import core.api.log
|
||||
import core.game.worldevents.PluginSet
|
||||
import core.game.worldevents.WorldEvent
|
||||
import core.game.world.GameWorld
|
||||
import core.plugin.ClassScanner
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
|
||||
class PenguinHNSEvent : StartupListener {
|
||||
|
|
@ -15,7 +17,7 @@ class PenguinHNSEvent : StartupListener {
|
|||
override fun startup() {
|
||||
manager.rebuildVars()
|
||||
ClassScanner.definePlugins(LarryHandler(), NotebookHandler())
|
||||
SystemLogger.logInfo(this::class.java, "Penguin HNS initialized.")
|
||||
log(this::class.java, Log.FINE, "Penguin HNS initialized.")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import core.game.world.map.Location
|
|||
import org.json.simple.JSONArray
|
||||
import org.json.simple.JSONObject
|
||||
import core.ServerStore.Companion.toJSONArray
|
||||
import core.api.log
|
||||
import core.tools.Log
|
||||
import java.util.*
|
||||
|
||||
class PenguinManager{
|
||||
|
|
@ -31,7 +33,7 @@ class PenguinManager{
|
|||
private fun updateStoreFile(){
|
||||
val jsonTags = JSONArray()
|
||||
tagMapping.filter { it.value.isNotEmpty() }.forEach { (ordinal,taggers) ->
|
||||
SystemLogger.logInfo(this::class.java, "$ordinal - ${taggers.first()}")
|
||||
log(this::class.java, Log.FINE, "$ordinal - ${taggers.first()}")
|
||||
val tag = JSONObject()
|
||||
tag["ordinal"] = ordinal
|
||||
tag["taggers"] = taggers
|
||||
|
|
@ -64,8 +66,4 @@ class PenguinManager{
|
|||
penguins = spawnedOrdinals.toMutableList()
|
||||
}
|
||||
}
|
||||
|
||||
fun log(message: String){
|
||||
SystemLogger.logInfo(this::class.java, "[Penguins] $message")
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ import core.game.interaction.IntType
|
|||
import core.tools.SystemLogger
|
||||
import core.game.system.command.Privilege
|
||||
import core.game.world.GameWorld
|
||||
import core.tools.Log
|
||||
import core.tools.secondsToTicks
|
||||
|
||||
class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Commands, StartupListener {
|
||||
|
|
@ -112,7 +113,7 @@ class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Com
|
|||
}
|
||||
|
||||
override fun startup() {
|
||||
SystemLogger.logInfo(this::class.java, "Shooting Stars initialized.")
|
||||
log(this::class.java, Log.FINE, "Shooting Stars initialized.")
|
||||
}
|
||||
|
||||
private data class ScoreboardEntry(val player: String, val time: Int)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package content.global.activity.ttrail;
|
|||
import core.game.component.Component;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.map.zone.MapZone;
|
||||
import core.game.world.map.zone.ZoneBorders;
|
||||
|
|
@ -15,6 +16,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Represents a clue scroll plugin.
|
||||
* @author Vexia
|
||||
|
|
@ -138,7 +141,7 @@ public abstract class ClueScrollPlugin extends MapZone implements Plugin<Object>
|
|||
if(clue.getClueId() == 2681)
|
||||
return;
|
||||
if (CLUE_SCROLLS.containsKey(clue.getClueId())) {
|
||||
SystemLogger.logErr(this.getClass(), "Error! Plugin already registered with clue id - " + clue.getClueId() + ", trying to register " + clue.getClass().getCanonicalName() + " the real plugin using the id is " + CLUE_SCROLLS.get(clue.getClueId()).getClass().getCanonicalName() + "!");
|
||||
log(this.getClass(), Log.ERR, "Error! Plugin already registered with clue id - " + clue.getClueId() + ", trying to register " + clue.getClass().getCanonicalName() + " the real plugin using the id is " + CLUE_SCROLLS.get(clue.getClueId()).getClass().getCanonicalName() + "!");
|
||||
return;
|
||||
}
|
||||
List<ClueScrollPlugin> organized = (List<ClueScrollPlugin>) ORGANIZED.get(clue.getLevel());
|
||||
|
|
@ -169,7 +172,7 @@ public abstract class ClueScrollPlugin extends MapZone implements Plugin<Object>
|
|||
public static Item getClue(ClueLevel clueLevel) {
|
||||
List<ClueScrollPlugin> clues = ORGANIZED.get(clueLevel);
|
||||
if (clues == null) {
|
||||
SystemLogger.logErr(ClueScrollPlugin.class, "Error! There are no clues for level " + clueLevel + "!");
|
||||
log(ClueScrollPlugin.class, Log.ERR, "Error! There are no clues for level " + clueLevel + "!");
|
||||
return null;
|
||||
}
|
||||
ClueScrollPlugin clue = clues.get(RandomFunction.random(clues.size()));
|
||||
|
|
|
|||
|
|
@ -1,20 +1,17 @@
|
|||
package content.global.ame
|
||||
|
||||
import core.api.Commands
|
||||
import core.api.LoginListener
|
||||
import core.api.*
|
||||
import core.game.event.EventHook
|
||||
import core.game.event.TickEvent
|
||||
import core.api.getAttribute
|
||||
import core.api.setAttribute
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.zone.ZoneRestriction
|
||||
import core.tools.RandomFunction
|
||||
import core.api.Event
|
||||
import core.tools.SystemLogger
|
||||
import core.game.system.command.Privilege
|
||||
import core.game.world.GameWorld
|
||||
import core.game.world.repository.Repository
|
||||
import core.tools.Log
|
||||
import kotlin.random.Random
|
||||
|
||||
class RandomEventManager(val player: Player? = null) : LoginListener, EventHook<TickEvent>, Commands {
|
||||
|
|
@ -30,7 +27,6 @@ class RandomEventManager(val player: Player? = null) : LoginListener, EventHook<
|
|||
setAttribute(player, "random-manager", instance)
|
||||
instance.rollNextSpawn()
|
||||
instance.enabled = true
|
||||
SystemLogger.logRE("Initialized REManager for ${player.username}.")
|
||||
}
|
||||
|
||||
override fun process(entity: Entity, event: TickEvent) {
|
||||
|
|
@ -62,12 +58,12 @@ class RandomEventManager(val player: Player? = null) : LoginListener, EventHook<
|
|||
event = ame.npc.create(player,ame.loot,ame.type)
|
||||
if (event!!.spawnLocation == null) {
|
||||
nextSpawn = GameWorld.ticks + 3000
|
||||
SystemLogger.logWarn(this::class.java, "Tried to spawn random event for ${player.username} but spawn location was null!")
|
||||
log(this::class.java, Log.WARN, "Tried to spawn random event for ${player.username} but spawn location was null!")
|
||||
return
|
||||
}
|
||||
event!!.init()
|
||||
rollNextSpawn()
|
||||
SystemLogger.logRE("Fired ${event!!.name} for ${player.username}")
|
||||
log(this::class.java, Log.FINE, "Fired ${event!!.name} for ${player.username}")
|
||||
}
|
||||
|
||||
private fun rollNextSpawn() {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import core.game.node.entity.player.link.audio.Audio
|
|||
import core.game.node.entity.skill.Skills
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
|
||||
/**
|
||||
|
|
@ -70,7 +71,7 @@ class ExperienceInterface() : ComponentPlugin() {
|
|||
46 -> Skills.WOODCUTTING
|
||||
40 -> Skills.FLETCHING
|
||||
51 -> Skills.CONSTRUCTION
|
||||
else -> Skills.SLAYER.also { SystemLogger.logWarn(this::class.java, "EXP_INTERFACE: Invalid SKILL CHOICE BUTTON: $button") }
|
||||
else -> Skills.SLAYER.also { log(this::class.java, Log.WARN, "EXP_INTERFACE: Invalid SKILL CHOICE BUTTON: $button") }
|
||||
}
|
||||
player.setAttribute("exp_interface:skill",skill)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class QuestTabInterface extends ComponentPlugin {
|
|||
break;
|
||||
default:
|
||||
// if (GameWorld.isEconomyWorld()) {
|
||||
//System.out.println("Quest button: " + button);
|
||||
|
||||
Quest quest = p.getQuestRepository().forButtonId(button);
|
||||
if (quest != null) {
|
||||
p.getInterfaceManager().open(new Component(275));
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public final class ShoppingPlugin extends ComponentPlugin {
|
|||
return true;
|
||||
}
|
||||
if (viewer == null) {
|
||||
System.out.println("shop is null");
|
||||
|
||||
return true;
|
||||
}
|
||||
final Container container = button == 0 ? player.getInventory() : viewer.getShop().getContainer(viewer.getTabIndex());
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public final class WorldMapInterface extends ComponentPlugin {
|
|||
player.updateSceneGraph(true);
|
||||
return true;
|
||||
default:
|
||||
//SystemLogger.logErr(this.getClass(), "World map: buttonid: " + button + ", opcode: " + opcode + ", slot: " + slot);
|
||||
//log(this.getClass(), Log.ERR, "World map: buttonid: " + button + ", opcode: " + opcode + ", slot: " + slot);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import core.game.ge.GrandExchangeOffer
|
|||
import core.game.ge.GrandExchangeRecords
|
||||
import core.game.ge.PriceIndex
|
||||
import core.game.interaction.InterfaceListener
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
|
||||
/**
|
||||
|
|
@ -199,7 +200,7 @@ class StockMarket : InterfaceListener {
|
|||
{
|
||||
if(offer == null)
|
||||
{
|
||||
SystemLogger.logWarn(this::class.java, "Opened offer was null and was attempted to be aborted!")
|
||||
log(this::class.java, Log.WARN, "Opened offer was null and was attempted to be aborted!")
|
||||
return
|
||||
}
|
||||
sendMessage(player, "Abort request acknowledged. Please be aware that your offer may")
|
||||
|
|
@ -207,7 +208,7 @@ class StockMarket : InterfaceListener {
|
|||
|
||||
if(!offer.isActive)
|
||||
{
|
||||
SystemLogger.logWarn(this::class.java, "Offer ${offer.uid}[${offer.index}]: ${if(offer.sell) "s" else "b"} ${offer.itemID}x ${offer.amount} was NO LONGER active when abort attempted")
|
||||
log(this::class.java, Log.WARN, "Offer ${offer.uid}[${offer.index}]: ${if(offer.sell) "s" else "b"} ${offer.itemID}x ${offer.amount} was NO LONGER active when abort attempted")
|
||||
return
|
||||
}
|
||||
offer.offerState = OfferState.ABORTED
|
||||
|
|
@ -341,7 +342,7 @@ class StockMarket : InterfaceListener {
|
|||
val item = offer.withdraw[index]
|
||||
if(item == null)
|
||||
{
|
||||
SystemLogger.logWarn(this::class.java, "Offer withdraw[$index] is null!")
|
||||
log(this::class.java, Log.WARN, "Offer withdraw[$index] is null!")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package content.global.handlers.item
|
||||
|
||||
import core.api.log
|
||||
import core.cache.def.impl.ItemDefinition
|
||||
import core.game.interaction.OptionHandler
|
||||
import core.game.node.Node
|
||||
|
|
@ -8,6 +9,7 @@ import core.game.node.item.Item
|
|||
import core.game.world.update.flag.context.Animation
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import core.tools.Log
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.rs09.consts.Items
|
||||
|
|
@ -63,7 +65,7 @@ class EnchantJewelleryTabOption : OptionHandler(){
|
|||
}
|
||||
|
||||
if(items == null){
|
||||
SystemLogger.logWarn(this::class.java, "UNHANDLED ENCHANT ITEM TABLET [ID: ${node?.id}")
|
||||
log(this::class.java, Log.WARN, "UNHANDLED ENCHANT ITEM TABLET [ID: ${node?.id}")
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import content.global.skill.agility.AgilityHandler;
|
|||
public class RopeSwing extends UseWithHandler {
|
||||
@Override
|
||||
public boolean handle(NodeUsageEvent event) {
|
||||
System.out.println("Trying to handle.");
|
||||
|
||||
if(event.getUsedWith() instanceof Scenery){
|
||||
Scenery object = event.getUsedWith().asScenery();
|
||||
int objId = object.getId();
|
||||
|
|
|
|||
|
|
@ -11,9 +11,12 @@ import core.game.node.entity.player.Player;
|
|||
import core.game.node.scenery.Scenery;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.plugin.ClassScanner;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* The build option handling plugin.
|
||||
* @author Emperor
|
||||
|
|
@ -63,8 +66,8 @@ public final class BuildOptionPlugin extends OptionHandler {
|
|||
}
|
||||
Hotspot hotspot = player.getHouseManager().getHotspot(object);
|
||||
if (hotspot == null || !isBuildable(player, object, hotspot)) {
|
||||
System.out.println(hotspot == null);
|
||||
SystemLogger.logErr(this.getClass(), "Construction (building): " + hotspot + " : " + object + " chunkX = " + object.getLocation().getChunkX() + ", chunkY = " + object.getLocation().getChunkY());
|
||||
|
||||
log(this.getClass(), Log.ERR, "Construction (building): " + hotspot + " : " + object + " chunkX = " + object.getLocation().getChunkX() + ", chunkY = " + object.getLocation().getChunkY());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,12 +16,15 @@ import core.game.world.update.flag.context.Animation;
|
|||
import core.net.packet.PacketRepository;
|
||||
import core.net.packet.context.ContainerContext;
|
||||
import core.net.packet.out.ContainerPacket;
|
||||
import core.tools.Log;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Utility class for building.
|
||||
* @author Emperor
|
||||
|
|
@ -135,7 +138,7 @@ public final class BuildingUtils {
|
|||
player.getPacketDispatch().sendString("Level " + decoration.getLevel(), 396, 140 + menuIndex);
|
||||
//player.getPacketDispatch().sendItemZoomOnInterface(items[i].protocol(), 50000, 396, 49 + i);
|
||||
}
|
||||
System.out.println(c261Value);
|
||||
|
||||
player.getConfigManager().set(261, c261Value);
|
||||
PacketRepository.send(ContainerPacket.class, new ContainerContext(player, 396, 132, 8, items, false));
|
||||
}
|
||||
|
|
@ -287,7 +290,7 @@ public final class BuildingUtils {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
SystemLogger.logErr(BuildingUtils.class, "Couldn't find stairs! " + plane);
|
||||
log(BuildingUtils.class, Log.ERR, "Couldn't find stairs! " + plane);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -407,7 +410,7 @@ public final class BuildingUtils {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
SystemLogger.logErr(BuildingUtils.class, "Couldn't find stairs! " + plane);
|
||||
log(BuildingUtils.class, Log.ERR, "Couldn't find stairs! " + plane);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -549,7 +552,7 @@ public final class BuildingUtils {
|
|||
}
|
||||
}
|
||||
//(0=east, 1=south, 2=west, 3=north).
|
||||
// System.out.println("Roof information: index=" + index + ", exit count=" + count + "; array=" + Arrays.toString(exits));
|
||||
|
||||
if (count == 4) {
|
||||
room = Room.create(player, RoomProperties.ROOF_4_EXIT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,11 @@ import core.game.node.entity.skill.Skills;
|
|||
import core.game.node.scenery.Scenery;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the creating of a decoration object.
|
||||
* @author Emperor
|
||||
|
|
@ -38,12 +41,12 @@ public final class ConstructionInterface extends ComponentPlugin {
|
|||
Hotspot hotspot = player.getAttribute("con:hotspot");
|
||||
Scenery object = player.getAttribute("con:hsobject");
|
||||
if (hotspot == null || object == null) {
|
||||
SystemLogger.logErr(this.getClass(), "Failed building decoration " + hotspot + " : " + object);
|
||||
log(this.getClass(), Log.ERR, "Failed building decoration " + hotspot + " : " + object);
|
||||
break;
|
||||
}
|
||||
slot = ((slot % 2 != 0) ? 4 : 0) + (slot >> 1);
|
||||
if (slot >= hotspot.getHotspot().getDecorations().length) {
|
||||
SystemLogger.logErr(this.getClass(), "Failed building decoration " + slot + "/" + hotspot.getHotspot().getDecorations().length);
|
||||
log(this.getClass(), Log.ERR, "Failed building decoration " + slot + "/" + hotspot.getHotspot().getDecorations().length);
|
||||
break;
|
||||
}
|
||||
boolean debug = player.isStaff();
|
||||
|
|
@ -104,7 +107,7 @@ public final class ConstructionInterface extends ComponentPlugin {
|
|||
break;
|
||||
case 402:
|
||||
int index = button - 160;
|
||||
SystemLogger.logErr(this.getClass(), "BuildRoom Interface Index: " + index);
|
||||
log(this.getClass(), Log.FINE, "BuildRoom Interface Index: " + index);
|
||||
if (index > -1 && index < RoomProperties.values().length) {
|
||||
player.getDialogueInterpreter().open("con:room", RoomProperties.values()[index]);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import core.game.world.map.build.DynamicRegion;
|
|||
import core.game.world.map.zone.ZoneBorders;
|
||||
import core.game.world.map.zone.ZoneBuilder;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.tools.Log;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.json.simple.JSONArray;
|
||||
|
|
@ -27,6 +28,7 @@ import core.game.world.GameWorld;
|
|||
import java.awt.*;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
import static core.api.regionspec.RegionSpecificationKt.fillWith;
|
||||
import static core.api.regionspec.RegionSpecificationKt.using;
|
||||
|
||||
|
|
@ -323,7 +325,7 @@ public final class HouseManager {
|
|||
*/
|
||||
public Location getEnterLocation() {
|
||||
if (houseRegion == null) {
|
||||
SystemLogger.logErr(this.getClass(), "House wasn't constructed yet!");
|
||||
log(this.getClass(), Log.ERR, "House wasn't constructed yet!");
|
||||
return null;
|
||||
}
|
||||
for (int x = 0; x < 8; x++) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package content.global.skill.crafting.lightsources
|
||||
|
||||
import core.api.log
|
||||
import core.cache.def.impl.ItemDefinition
|
||||
import core.game.container.Container
|
||||
import core.game.interaction.OptionHandler
|
||||
|
|
@ -9,6 +10,7 @@ import core.game.node.item.Item
|
|||
import core.tools.SystemLogger
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import core.tools.Log
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +30,7 @@ class LightSourceExtinguisher : OptionHandler(){
|
|||
|
||||
val lightSource = LightSources.forId(node.id)
|
||||
|
||||
lightSource ?: return false.also { SystemLogger.logWarn(this::class.java, "UNHANDLED EXTINGUISH OPTION: ID = ${node.id}") }
|
||||
lightSource ?: return false.also { log(this::class.java, Log.WARN, "UNHANDLED EXTINGUISH OPTION: ID = ${node.id}") }
|
||||
|
||||
player.inventory.replace(node.asItem(), Item(lightSource.fullID))
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ class FarmingState(player: Player? = null) : State(player) {
|
|||
val cBin = CompostBins.values()[binOrdinal]
|
||||
val b = cBin.getBinForPlayer(player)
|
||||
b.parse(bin["binData"] as JSONObject)
|
||||
SystemLogger.logErr(this::class.java, "bin size " + binMap.size)
|
||||
}
|
||||
}
|
||||
if(_data.containsKey("farming-patches")){
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package content.global.skill.farming
|
||||
|
||||
import core.api.log
|
||||
import core.cache.def.impl.SceneryDefinition
|
||||
import core.game.interaction.OptionHandler
|
||||
import core.game.node.Node
|
||||
|
|
@ -8,6 +9,7 @@ import core.game.node.entity.skill.Skills
|
|||
import core.tools.SystemLogger
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import core.tools.Log
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@Initializable
|
||||
|
|
@ -39,7 +41,7 @@ class HealthChecker : OptionHandler(){
|
|||
PatchType.FRUIT_TREE -> patch.setCurrentState(patch.getCurrentState() - 14)
|
||||
PatchType.BUSH -> patch.setCurrentState(patch.plantable!!.value + patch.plantable!!.stages + 4)
|
||||
PatchType.CACTUS -> patch.setCurrentState(patch.plantable!!.value + patch.plantable!!.stages + 3)
|
||||
else -> SystemLogger.logErr(this::class.java,"Unreachable patch type from when(type) switch in HealthChecker.kt line 36")
|
||||
else -> log(this::class.java, Log.ERR, "Unreachable patch type from when(type) switch in HealthChecker.kt line 36")
|
||||
}
|
||||
|
||||
if(type == PatchType.FRUIT_TREE){
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package content.global.skill.farming
|
||||
|
||||
import core.api.log
|
||||
import core.game.node.entity.player.Player
|
||||
import core.tools.Log
|
||||
import core.tools.RandomFunction
|
||||
import org.rs09.consts.Items
|
||||
import core.tools.SystemLogger
|
||||
|
|
@ -110,7 +112,7 @@ class Patch(val player: Player, val patch: FarmingPatch, var plantable: Plantabl
|
|||
PatchType.FRUIT_TREE -> player.varpManager.get(patch.varpIndex).setVarbit(patch.varpOffset,plantable!!.value + plantable!!.stages + 20)
|
||||
PatchType.BUSH -> player.varpManager.get(patch.varpIndex).setVarbit(patch.varpOffset,250 + (plantable!!.ordinal - Plantable.REDBERRY_SEED.ordinal))
|
||||
PatchType.CACTUS -> player.varpManager.get(patch.varpIndex).setVarbit(patch.varpOffset, 31)
|
||||
else -> SystemLogger.logWarn(this::class.java, "Invalid setting of isCheckHealth for patch type: " + patch.type.name)
|
||||
else -> log(this::class.java, Log.WARN, "Invalid setting of isCheckHealth for patch type: " + patch.type.name)
|
||||
}
|
||||
} else {
|
||||
when(patch.type){
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public enum FishingSpot {
|
|||
for(FishingOption o : this.options){
|
||||
if(o.getName().equals(name)){return o;}
|
||||
}
|
||||
System.out.println("Unhandled fishing spot option, spot id: " + this.ids[0] + " desired fishing option: " + name);
|
||||
|
||||
return FishingOption.SMALL_NET; //safe, default return.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -645,7 +645,6 @@ public enum SkillingResource {
|
|||
static {
|
||||
for (SkillingResource resource : SkillingResource.values()) {
|
||||
if (RESOURCES.containsKey(resource.id)) {
|
||||
SystemLogger.logErr(SkillingResource.class, "Already contained resource " + resource.getId() + " - " + resource.name());
|
||||
}
|
||||
RESOURCES.put(resource.id, resource);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class FishingPulse(player: Player?, npc: NPC, private val option: FishingOption?
|
|||
}
|
||||
player.debug(player.inventory.containsItem(option.tool).toString())
|
||||
if (!player.inventory.containsItem(option.tool) && !hasBarbTail()) {
|
||||
//System.out.println(isBareHanded(player));
|
||||
|
||||
player.dialogueInterpreter.sendDialogue("You need a " + option.tool.name.toLowerCase() + " to catch these fish.")
|
||||
stop()
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import core.game.node.entity.npc.NPC;
|
|||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.scenery.Scenery;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.map.Location;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
|
|
@ -12,6 +13,8 @@ import core.game.world.update.flag.context.Animation;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Represents a trap type.
|
||||
* @author Vexia
|
||||
|
|
@ -101,7 +104,7 @@ public enum Traps {
|
|||
return;
|
||||
}
|
||||
if (instance.getWrapper(object) == null) {
|
||||
SystemLogger.logErr(this.getClass(), "NO WRAPPER (HUNTER DISMANTLE)");
|
||||
log(this.getClass(), Log.ERR, "NO WRAPPER (HUNTER DISMANTLE)");
|
||||
return;
|
||||
}
|
||||
player.faceLocation(object.getLocation());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package content.global.skill.hunter.tracking
|
||||
|
||||
import core.api.log
|
||||
import core.game.interaction.OptionHandler
|
||||
import core.game.node.Node
|
||||
import core.game.node.scenery.Scenery
|
||||
|
|
@ -14,6 +15,7 @@ import core.tools.RandomFunction
|
|||
import org.rs09.consts.Items
|
||||
import core.tools.SystemLogger
|
||||
import core.game.world.GameWorld
|
||||
import core.tools.Log
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
|
|
@ -50,7 +52,7 @@ abstract class HunterTracking : OptionHandler(){
|
|||
val trail = player.getAttribute(attribute, ArrayList<TrailDefinition>())
|
||||
val initialTrail = getInitialTrail(startobj)
|
||||
if(initialTrail == null) {
|
||||
SystemLogger.logWarn(this::class.java, "UNHANDLED STARTING OBJECT FOR HUNTER TRACKING $startobj")
|
||||
log(this::class.java, Log.WARN, "UNHANDLED STARTING OBJECT FOR HUNTER TRACKING $startobj")
|
||||
return
|
||||
}
|
||||
trail.add(initialTrail)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package content.global.skill.magic
|
||||
|
||||
import core.api.log
|
||||
import core.game.node.Node
|
||||
import core.game.node.entity.player.Player
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
|
||||
object SpellListeners {
|
||||
|
|
@ -18,12 +20,12 @@ object SpellListeners {
|
|||
}
|
||||
|
||||
fun get(spellID: Int, type: Int, book: String): ((Player,Node?) -> Unit)?{
|
||||
SystemLogger.logInfo(this::class.java, "Getting $book:$spellID:$type")
|
||||
log(this::class.java, Log.FINE, "Getting $book:$spellID:$type")
|
||||
return castMap["$book:$spellID:$type"]
|
||||
}
|
||||
|
||||
fun get(spellID: Int, type: Int, id: Int, book: String): ((Player,Node?) -> Unit)?{
|
||||
SystemLogger.logInfo(this::class.java, "Getting $book:$spellID:$type:$id")
|
||||
log(this::class.java, Log.FINE, "Getting $book:$spellID:$type:$id")
|
||||
return castMap["$book:$spellID:$type:$id"]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ public final class ChargeOrbSpells extends MagicSpell {
|
|||
&& objectId == 2151
|
||||
&& p.getInventory().containsItems(Runes.COSMIC_RUNE.getItem(15), Runes.WATER_RUNE.getItem(150), new Item(UNPOWERED_ORB.getId(), 5))) {
|
||||
p.setAttribute("/save:diary:seers:water-orb-can-earn", true);
|
||||
System.out.println("can_earn_true");
|
||||
|
||||
p.setAttribute("/save:diary:seers:water-orb", 1);
|
||||
}
|
||||
if (!meetsRequirements(entity, true, true)) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import core.api.*
|
|||
import core.game.node.Node
|
||||
import core.plugin.ClassScanner.definePlugin
|
||||
import core.tools.colorize
|
||||
import core.tools.SystemLogger.logInfo
|
||||
import core.game.node.scenery.Scenery
|
||||
import core.game.node.entity.impl.Animator
|
||||
import core.game.node.entity.npc.NPC
|
||||
|
|
@ -28,6 +27,7 @@ import org.rs09.consts.Scenery as Sceneries
|
|||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.IntType
|
||||
import core.game.world.GameWorld
|
||||
import core.tools.Log
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
import kotlin.random.Random
|
||||
|
|
@ -255,7 +255,7 @@ class AbyssPlugin : InteractionListener {
|
|||
const val BURN_PROGRESS = 16
|
||||
const val DISTRACT_PROGRESS = 18
|
||||
fun handleObstacle(obstacle: Node, player: Player, skill: Int, varbitVal: Int?, animation: Animation, messages: Array<String>): Boolean {
|
||||
logInfo(this::class.java, "handled abyss ${obstacle.name}")
|
||||
log(this::class.java, Log.FINE, "handled abyss ${obstacle.name}")
|
||||
player.lock()
|
||||
player.animate(animation)
|
||||
GameWorld.Pulser.submit(object : Pulse(1, player) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import core.game.world.map.zone.ZoneRestriction;
|
|||
import core.game.world.update.flag.context.Animation;
|
||||
import core.game.world.update.flag.context.Graphics;
|
||||
import core.plugin.Plugin;
|
||||
import core.tools.Log;
|
||||
import core.tools.RandomFunction;
|
||||
import core.game.node.entity.combat.CombatPulse;
|
||||
import core.game.node.entity.combat.CombatSwingHandler;
|
||||
|
|
@ -33,6 +34,8 @@ import content.global.skill.summoning.SummoningPouch;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Represents a familiar.
|
||||
* @author Emperor
|
||||
|
|
@ -579,7 +582,7 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
face(owner);
|
||||
}
|
||||
if (!isRenderable() && owner.isActive()) {
|
||||
// SystemLogger.logErr(this.getClass(), "Familiar in inactive region!");
|
||||
// log(this.getClass(), Log.ERR, "Familiar in inactive region!");
|
||||
getWalkingQueue().update();
|
||||
getUpdateMasks().prepare(this);
|
||||
}
|
||||
|
|
@ -628,7 +631,7 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||
for (int id : getIds()) {
|
||||
if (FamiliarManager.getFamiliars().containsKey(id)) {
|
||||
SystemLogger.logErr(this.getClass(), "Familiar " + id + " was already registered!");
|
||||
log(this.getClass(), Log.ERR, "Familiar " + id + " was already registered!");
|
||||
return null;
|
||||
}
|
||||
FamiliarManager.getFamiliars().put(id, this);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class PickableDoorHandler extends OptionHandler {
|
|||
door.pickLock(player, (Scenery) node);
|
||||
return true;
|
||||
}
|
||||
System.out.println("Unhandled door: " + node.getId());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package content.minigame.allfiredup
|
||||
|
||||
import core.api.log
|
||||
import core.game.node.entity.player.Player
|
||||
import core.tools.SystemLogger
|
||||
import core.game.world.map.Location
|
||||
import core.tools.Log
|
||||
|
||||
/**
|
||||
* Various data for beacons, such as varp and offset, required FM level, etc
|
||||
|
|
@ -29,7 +31,7 @@ enum class AFUBeacon(val title: String, val fmLevel: Int, val varpId: Int, val o
|
|||
for (beacon in values()) {
|
||||
if (beacon.location.equals(location)) return beacon
|
||||
}
|
||||
return content.minigame.allfiredup.AFUBeacon.RIVER_SALVE.also { SystemLogger.logWarn(this::class.java, "Unhandled Beacon Location ${location.toString()}") }
|
||||
return content.minigame.allfiredup.AFUBeacon.RIVER_SALVE.also { log(this::class.java, Log.WARN, "Unhandled Beacon Location ${location.toString()}") }
|
||||
}
|
||||
|
||||
fun resetAllBeacons(player: Player){
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public final class BarrowsActivityPlugin extends ActivityPlugin {
|
|||
}
|
||||
}
|
||||
int drain = 8;
|
||||
System.out.println(getWorldTicks() % 30);
|
||||
|
||||
//if (p.getLocks().isLocked("barrow:drain") || RandomFunction.random(100) % 2 == 0) {
|
||||
// continue;
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package content.minigame.fishingtrawler
|
|||
import core.api.LogoutListener
|
||||
import core.api.MapArea
|
||||
import core.api.getRegionBorders
|
||||
import core.api.log
|
||||
import core.game.component.Component
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.scenery.Scenery
|
||||
|
|
@ -294,11 +295,11 @@ class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : Logo
|
|||
|
||||
override fun areaEnter(entity: Entity) {
|
||||
super.areaEnter(entity)
|
||||
SystemLogger.logInfo(this::class.java, "ENTERED FTZ")
|
||||
log(this::class.java, Log.FINE, "ENTERED FTZ")
|
||||
}
|
||||
|
||||
override fun areaLeave(entity: Entity, logout: Boolean) {
|
||||
super.areaLeave(entity, logout)
|
||||
SystemLogger.logInfo(this::class.java, "EXITED FTZ")
|
||||
log(this::class.java, Log.FINE, "EXITED FTZ")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package content.minigame.fog
|
||||
|
||||
import core.api.log
|
||||
import core.cache.def.impl.ItemDefinition
|
||||
import core.game.component.Component
|
||||
import core.game.component.ComponentDefinition
|
||||
|
|
@ -8,6 +9,7 @@ import core.game.node.entity.player.Player
|
|||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
|
||||
@Initializable
|
||||
|
|
@ -52,7 +54,7 @@ class FOGRewardsInterface : ComponentPlugin(){
|
|||
176 -> choice = Air_Gloves
|
||||
181 -> choice = Water_Gloves
|
||||
186 -> choice = Earth_Gloves
|
||||
else -> SystemLogger.logWarn(this::class.java, "Unhandled button ID for FOG interface: $button").also { return true }
|
||||
else -> log(this::class.java, Log.WARN, "Unhandled button ID for FOG interface: $button").also { return true }
|
||||
}
|
||||
handleOpcode(choice,opcode,player!!)
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public final class PCIslandZone extends MapZone {
|
|||
@Override
|
||||
public boolean death(Entity e, Entity killer) {
|
||||
if (e instanceof Player) { // Ensure players can't die on the island.
|
||||
// System.out.println("[PCIslandZone] Saved player from death!");
|
||||
|
||||
e.getProperties().setTeleportLocation(e.getLocation());
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import core.game.node.entity.player.info.Rights;
|
|||
import core.game.node.item.Item;
|
||||
import core.game.node.scenery.Scenery;
|
||||
import core.game.system.task.Pulse;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.GameWorld;
|
||||
import core.game.world.map.Direction;
|
||||
|
|
@ -34,6 +35,8 @@ import core.plugin.Plugin;
|
|||
import core.tools.StringUtils;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the god wars map zone.
|
||||
* @author Emperor
|
||||
|
|
@ -368,7 +371,7 @@ public final class GodwarsMapzone extends MapZone implements Plugin<Object> {
|
|||
}
|
||||
|
||||
if (DoorActionHandler.handleAutowalkDoor(player, object)) {
|
||||
SystemLogger.logInfo(this.getClass(), player.getUsername() + " entered " + faction.name() + " gwd boss room");
|
||||
log(this.getClass(), Log.FINE, player.getUsername() + " entered " + faction.name() + " gwd boss room");
|
||||
increaseKillcount(player, faction, -required);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ class TheGolemListeners : InteractionListener {
|
|||
}
|
||||
|
||||
fun placeStatuette(player: Player): Boolean {
|
||||
System.out.println("Hello from placeStatuette")
|
||||
|
||||
if(player.inventory.remove(Item(4618))) {
|
||||
player.sendMessage("You insert the statuette into the alcove.")
|
||||
player.setAttribute("/save:the-golem:placed-statuette", true)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import core.game.node.entity.npc.NPC;
|
|||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.quest.Quest;
|
||||
import core.game.node.item.Item;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.system.task.Pulse;
|
||||
import core.game.world.GameWorld;
|
||||
|
|
@ -24,6 +25,8 @@ import core.game.world.update.flag.context.Animation;
|
|||
import core.plugin.Plugin;
|
||||
import core.tools.RandomFunction;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the dwarf cannon quest interactions.
|
||||
* @author Vexia
|
||||
|
|
@ -289,7 +292,7 @@ public class DwarfCannonPlugin extends OptionHandler {
|
|||
}
|
||||
Part part = Part.forId(button);
|
||||
if (part == null) {
|
||||
SystemLogger.logErr(this.getClass(), "Unhandled part id - " + button + "!");
|
||||
log(this.getClass(), Log.ERR, "Unhandled part id - " + button + "!");
|
||||
return true;
|
||||
}
|
||||
if (this.tool.getPart() != part) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class GarlicPipeInteraction extends PluginInteraction {
|
|||
|
||||
@Override
|
||||
public boolean handle(Player player, NodeUsageEvent event) {
|
||||
System.out.println("Trying to handle it");
|
||||
|
||||
if(event.getUsed() instanceof Item && event.getUsedWith() instanceof Scenery){
|
||||
Scenery usedWith = event.getUsedWith().asScenery();
|
||||
Item used = event.getUsedItem();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import content.region.kandarin.seers.quest.elementalworkshop.EWUtils.WATER_WHEEL
|
|||
import content.region.kandarin.seers.quest.elementalworkshop.EWUtils.currentStage
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.IntType
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
|
||||
/**
|
||||
|
|
@ -276,7 +277,7 @@ class EWListeners : InteractionListener {
|
|||
}
|
||||
// Sanity error check (Should never get thrown)
|
||||
if (!player.inventory.containsAll(*elementalShieldReqItems)) {
|
||||
SystemLogger.logErr(this::class.java, "${player.username} tried to forge an elemental shield without all the required items.")
|
||||
log(this::class.java, Log.ERR, "${player.username} tried to forge an elemental shield without all the required items.")
|
||||
return@onUseWith false
|
||||
}
|
||||
// Successfully smith the elemental shield
|
||||
|
|
@ -451,7 +452,7 @@ class EWListeners : InteractionListener {
|
|||
else -> {
|
||||
offset = -1
|
||||
enabled = 0
|
||||
SystemLogger.logErr(this::class.java, "Unhandled location when determining enabled water controls! ${player.location}")
|
||||
log(this::class.java, Log.ERR, "Unhandled location when determining enabled water controls! ${player.location}")
|
||||
return@on false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,13 @@ import core.game.dialogue.DialoguePlugin;
|
|||
import core.game.dialogue.FacialExpression;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.system.task.Pulse;
|
||||
import core.game.world.GameWorld;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* @author Tyler Telis
|
||||
*/
|
||||
|
|
@ -128,7 +131,7 @@ public class GuardDialoguePlugin extends DialoguePlugin {
|
|||
stage = -1;
|
||||
break;
|
||||
default:
|
||||
SystemLogger.logErr(this.getClass(), "Unhandled dialogue stage=" + stage);
|
||||
log(this.getClass(), Log.ERR, "Unhandled dialogue stage=" + stage);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ public class TormentedDemonNPC extends AbstractNPC {
|
|||
* @param protectionStyle The protection style to switch to.
|
||||
*/
|
||||
public void transformDemon(CombatStyle attackStyle, CombatStyle protectionStyle) {
|
||||
//System.out.println("Transforming demon, selected combat style = " + style + ", the selected protection style = " + protection);
|
||||
|
||||
|
||||
// If either attackStyle or protectionStyle are null, use the current form's values
|
||||
if(attackStyle == null) {
|
||||
|
|
@ -216,7 +216,7 @@ public class TormentedDemonNPC extends AbstractNPC {
|
|||
int oldHp = getSkills().getLifepoints();
|
||||
transform(id);
|
||||
getSkills().setLifepoints(oldHp);
|
||||
//System.out.println("The outcome demon, id = " + id + " combat style = " + getProperties().getCombatPulse().getStyle() + ", the protection style = " + getProperties().getProtectStyle());
|
||||
|
||||
TD_SWING_HANDLER.style = getProperties().getCombatPulse().getStyle();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import core.game.world.map.zone.ZoneBorders
|
|||
import core.GlobalStats
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.IntType
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
|
||||
class VarrockGuardSignpost : InteractionListener {
|
||||
|
|
@ -29,7 +30,7 @@ class VarrockGuardSignpost : InteractionListener {
|
|||
|
||||
on(31298, IntType.SCENERY, "read"){ player, _ ->
|
||||
val pickpocketCount = GlobalStats.getDailyGuardPickpockets()
|
||||
SystemLogger.logInfo(this::class.java, "Is equal? ${pickpocketCount == 0}")
|
||||
log(this::class.java, Log.FINE, "Is equal? ${pickpocketCount == 0}")
|
||||
when(pickpocketCount){
|
||||
0 -> sendDialogue(player, "The Varrock Palace guards are pleased to announce that crime is at an all-time low, without a single guard in the palace or at the city gates being pickpocketed today.")
|
||||
1 -> sendDialogue(player, "One of the Varrock Palace guards was pickpocketed today. He was close to tears at having lost his last few gold pieces." )
|
||||
|
|
|
|||
|
|
@ -54,19 +54,19 @@ public final class DSlayerDrainPlugin extends UseWithHandler {
|
|||
player.animate(ANIMATION);
|
||||
player.getPacketDispatch().sendMessage("You pour the liquid down the drain.");
|
||||
if (quest.getStage(player) != 20) {
|
||||
System.out.println("1");
|
||||
|
||||
return true;
|
||||
}
|
||||
if (player.getAttribute("demon-slayer:just-poured", false)) {
|
||||
System.out.println("2");
|
||||
|
||||
return true;
|
||||
}
|
||||
if (!player.hasItem(DemonSlayer.FIRST_KEY)) {
|
||||
System.out.println("3");
|
||||
|
||||
player.getSavedData().getQuestData().getDemonSlayer()[0] = false;
|
||||
}
|
||||
if (quest.getStage(player) == 20 && !player.hasItem(DemonSlayer.FIRST_KEY) && !player.getSavedData().getQuestData().getDemonSlayer()[0]) {
|
||||
System.out.println("4");
|
||||
|
||||
player.getDialogueInterpreter().sendDialogues(player, null, "OK, I think I've washed the key down into the sewer.", "I'd better go down and get it!");
|
||||
player.getSavedData().getQuestData().getDemonSlayer()[0] = true;// poured
|
||||
player.getConfigManager().set(222, 2660610, true);
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@ package content.region.misthalin.varrock.quest.familycrest
|
|||
|
||||
|
||||
import core.api.addItem
|
||||
import core.api.log
|
||||
import core.api.setAttribute
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.quest.Quest
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.plugin.Initializable
|
||||
import core.tools.Log
|
||||
import org.rs09.consts.Items
|
||||
import core.tools.SystemLogger
|
||||
|
||||
|
|
@ -118,7 +120,7 @@ class FamilyCrest: Quest("Family Crest", 59, 58, 1, 148, 0, 1, 11) {
|
|||
drawReward(player,"for the gauntlets",ln++)
|
||||
|
||||
if (!addItem(player, Items.FAMILY_GAUNTLETS_778)) {
|
||||
SystemLogger.logErr(this::class.java, "Failed to give gauntlets to ${player.username} at end of quest, this should not occur due to crest item removal needed to finish quest.")
|
||||
log(this::class.java, Log.ERR, "Failed to give gauntlets to ${player.username} at end of quest, this should not occur due to crest item removal needed to finish quest.")
|
||||
}
|
||||
setAttribute(player, "/save:family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import core.game.interaction.IntType
|
|||
import content.region.morytania.handlers.MortMyreGhastNPC
|
||||
import core.tools.SystemLogger
|
||||
import core.tools.END_DIALOGUE
|
||||
import core.tools.Log
|
||||
|
||||
class NSListeners : InteractionListener {
|
||||
|
||||
|
|
@ -114,7 +115,7 @@ class NSListeners : InteractionListener {
|
|||
}
|
||||
|
||||
on(WASHING_BOWL, IntType.GROUNDITEM, "take"){ player, node ->
|
||||
SystemLogger.logInfo(this::class.java, "Running listener")
|
||||
log(this::class.java, Log.FINE, "Running listener")
|
||||
GroundItemManager.create(Item(MIRROR), node.location, player)
|
||||
PickupHandler.take(player, node as GroundItem)
|
||||
return@on true
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
package content.region.wilderness.handlers.revenants
|
||||
|
||||
import core.api.Commands
|
||||
import core.api.TickListener
|
||||
import core.api.poofClear
|
||||
import core.api.teleport
|
||||
import core.game.interaction.MovementPulse
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.link.TeleportManager
|
||||
|
|
@ -12,10 +8,12 @@ import core.game.world.map.Location
|
|||
import core.game.world.update.flag.context.Graphics
|
||||
import core.tools.RandomFunction
|
||||
import core.ServerConstants
|
||||
import core.api.*
|
||||
import core.tools.SystemLogger
|
||||
import core.game.system.command.Privilege
|
||||
import core.game.world.GameWorld
|
||||
import core.game.world.repository.Repository
|
||||
import core.tools.Log
|
||||
import java.lang.Integer.min
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.collections.HashMap
|
||||
|
|
@ -94,10 +92,10 @@ class RevenantController : TickListener, Commands {
|
|||
|
||||
define("listrevs", Privilege.ADMIN) {player, strings ->
|
||||
for (rev in trackedRevenants) {
|
||||
SystemLogger.logInfo(this::class.java, "REV ${rev.id}-${rev.name} @ ${rev.location.toString()}")
|
||||
log(this::class.java, Log.FINE, "REV ${rev.id}-${rev.name} @ ${rev.location.toString()}")
|
||||
}
|
||||
|
||||
SystemLogger.logInfo(this::class.java, "Total of ${trackedRevenants.size} revenants spawned.")
|
||||
log(this::class.java, Log.FINE, "Total of ${trackedRevenants.size} revenants spawned.")
|
||||
}
|
||||
|
||||
define("clearrevs", Privilege.ADMIN) {_, _ ->
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package core
|
||||
|
||||
import core.api.log
|
||||
import core.game.system.SystemManager
|
||||
import core.game.system.SystemState
|
||||
import core.net.NioReactor
|
||||
|
|
@ -9,6 +10,7 @@ import core.tools.SystemLogger
|
|||
import core.game.system.config.ServerConfigParser
|
||||
import core.game.world.GameWorld
|
||||
import core.game.world.repository.Repository
|
||||
import core.tools.Log
|
||||
import java.io.File
|
||||
import java.io.FileWriter
|
||||
import java.lang.management.ManagementFactory
|
||||
|
|
@ -51,27 +53,27 @@ object Server {
|
|||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
if (args.isNotEmpty()) {
|
||||
SystemLogger.logInfo(this::class.java, "Using config file: ${args[0]}")
|
||||
log(this::class.java, Log.INFO, "Using config file: ${args[0]}")
|
||||
ServerConfigParser.parse(args[0])
|
||||
} else {
|
||||
SystemLogger.logInfo(this::class.java, "Using config file: ${"worldprops" + File.separator + "default.conf"}")
|
||||
log(this::class.java, Log.INFO, "Using config file: ${"worldprops" + File.separator + "default.conf"}")
|
||||
ServerConfigParser.parse("worldprops" + File.separator + "default.conf")
|
||||
}
|
||||
startTime = System.currentTimeMillis()
|
||||
val t = TimeStamp()
|
||||
GameWorld.prompt(true)
|
||||
Runtime.getRuntime().addShutdownHook(ServerConstants.SHUTDOWN_HOOK)
|
||||
SystemLogger.logInfo(this::class.java, "Starting networking...")
|
||||
log(this::class.java, Log.INFO, "Starting networking...")
|
||||
try {
|
||||
reactor = NioReactor.configure(43594 + GameWorld.settings?.worldId!!)
|
||||
reactor!!.start()
|
||||
} catch (e: BindException) {
|
||||
SystemLogger.logErr(this::class.java, "Port " + (43594 + GameWorld.settings?.worldId!!) + " is already in use!")
|
||||
log(this::class.java, Log.ERR, "Port " + (43594 + GameWorld.settings?.worldId!!) + " is already in use!")
|
||||
throw e
|
||||
}
|
||||
//WorldCommunicator.connect()
|
||||
SystemLogger.logInfo(this::class.java, GameWorld.settings?.name + " flags " + GameWorld.settings?.toString())
|
||||
SystemLogger.logInfo(this::class.java, GameWorld.settings?.name + " started in " + t.duration(false, "") + " milliseconds.")
|
||||
log(this::class.java, Log.INFO, GameWorld.settings?.name + " flags " + GameWorld.settings?.toString())
|
||||
log(this::class.java, Log.INFO, GameWorld.settings?.name + " started in " + t.duration(false, "") + " milliseconds.")
|
||||
val scanner = Scanner(System.`in`)
|
||||
|
||||
running = true
|
||||
|
|
@ -80,7 +82,7 @@ object Server {
|
|||
val command = scanner.nextLine()
|
||||
when(command){
|
||||
"stop" -> exitProcess(0)
|
||||
"players" -> System.out.println("Players online: " + (Repository.LOGGED_IN_PLAYERS.size))
|
||||
|
||||
"update" -> SystemManager.flag(SystemState.UPDATING)
|
||||
"help","commands" -> printCommands()
|
||||
"restartworker" -> SystemManager.flag(SystemState.ACTIVE)
|
||||
|
|
@ -94,8 +96,8 @@ object Server {
|
|||
delay(20000)
|
||||
while (running) {
|
||||
if (System.currentTimeMillis() - lastHeartbeat > 7200 && running) {
|
||||
SystemLogger.logErr(this::class.java, "Triggering reboot due to heartbeat timeout")
|
||||
SystemLogger.logErr(this::class.java, "Creating thread dump...")
|
||||
log(this::class.java, Log.ERR, "Triggering reboot due to heartbeat timeout")
|
||||
log(this::class.java, Log.ERR, "Creating thread dump...")
|
||||
val dump = threadDump(true, true)
|
||||
|
||||
withContext(Dispatchers.IO) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package core
|
|||
|
||||
import core.game.system.SystemShutdownHook
|
||||
import core.game.world.map.Location
|
||||
import core.tools.LogLevel
|
||||
import core.tools.mysql.Database
|
||||
import core.tools.secondsToTicks
|
||||
import java.math.BigInteger
|
||||
|
|
@ -160,6 +161,12 @@ class ServerConstants {
|
|||
@JvmField
|
||||
var I_AM_A_CHEATER = false
|
||||
|
||||
@JvmField
|
||||
var LOG_LEVEL = LogLevel.VERBOSE
|
||||
|
||||
@JvmField
|
||||
var JAVA_VERSION = 8
|
||||
|
||||
//location names for the ::to command.
|
||||
val TELEPORT_DESTINATIONS = arrayOf(
|
||||
arrayOf(Location.create(2974, 4383, 2), "corp", "corporal", "corporeal"),
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package core
|
|||
|
||||
import core.api.PersistWorld
|
||||
import core.api.getItemName
|
||||
import core.api.log
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.tools.Log
|
||||
import org.json.simple.JSONArray
|
||||
import org.json.simple.JSONObject
|
||||
import org.json.simple.parser.JSONParser
|
||||
|
|
@ -38,7 +40,7 @@ class ServerStore : PersistWorld {
|
|||
fileMap[key] = data
|
||||
counter++
|
||||
} catch (e: Exception){
|
||||
SystemLogger.logErr(this::class.java, "Failed parsing ${storeFile.name} - stack trace below.")
|
||||
log(this::class.java, Log.ERR, "Failed parsing ${storeFile.name} - stack trace below.")
|
||||
e.printStackTrace()
|
||||
return@forEach
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,15 @@ fun IntArray.isNextLast(element: Int) : Boolean {
|
|||
return this.isLast(this.getNext(element))
|
||||
}
|
||||
|
||||
fun <T> LinkedList<T>.tryPop(default: T) : T {
|
||||
fun <T> LinkedList<T>.tryPop(default: T?) : T? {
|
||||
this.peek() ?: return default
|
||||
return this.pop()
|
||||
}
|
||||
|
||||
inline fun <reified E: Enum<E>> parseEnumEntry(name: String) : E? {
|
||||
return try {
|
||||
enumValueOf<E>(name)
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
|
@ -65,6 +65,7 @@ import core.game.world.GameWorld
|
|||
import core.game.world.GameWorld.Pulser
|
||||
import core.game.world.map.path.ProjectilePathfinder
|
||||
import core.game.world.repository.Repository
|
||||
import core.tools.Log
|
||||
import core.tools.tick
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
|
|
@ -759,7 +760,7 @@ fun openDialogue(player: Player, dialogue: Any, vararg args: Any) {
|
|||
is Int -> player.dialogueInterpreter.open(dialogue, *args)
|
||||
is DialogueFile -> player.dialogueInterpreter.open(dialogue, *args)
|
||||
is SkillDialogueHandler -> dialogue.open()
|
||||
else -> SystemLogger.logErr(ContentAPI::class.java, "Invalid object type passed to openDialogue() -> ${dialogue.javaClass.simpleName}")
|
||||
else -> log(ContentAPI::class.java, Log.ERR, "Invalid object type passed to openDialogue() -> ${dialogue.javaClass.simpleName}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1045,7 +1046,7 @@ fun adjustCharge(node: Node, amount: Int) {
|
|||
when (node) {
|
||||
is Item -> node.charge += amount
|
||||
is Scenery -> node.charge += amount
|
||||
else -> SystemLogger.logErr(ContentAPI::class.java, "Attempt to adjust the charge of invalid type: ${node.javaClass.simpleName}")
|
||||
else -> log(ContentAPI::class.java, Log.ERR, "Attempt to adjust the charge of invalid type: ${node.javaClass.simpleName}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1058,7 +1059,7 @@ fun getCharge(node: Node): Int {
|
|||
when (node) {
|
||||
is Item -> return node.charge
|
||||
is Scenery -> return node.charge
|
||||
else -> SystemLogger.logErr(ContentAPI::class.java, "Attempt to get charge of invalid type: ${node.javaClass.simpleName}")
|
||||
else -> log(ContentAPI::class.java, Log.ERR, "Attempt to get charge of invalid type: ${node.javaClass.simpleName}")
|
||||
.also { return -1 }
|
||||
}
|
||||
}
|
||||
|
|
@ -1072,7 +1073,7 @@ fun setCharge(node: Node, charge: Int) {
|
|||
when (node) {
|
||||
is Item -> node.charge = charge
|
||||
is Scenery -> node.charge = charge
|
||||
else -> SystemLogger.logErr(ContentAPI::class.java, "Attempt to set the charge of invalid type: ${node.javaClass.simpleName}")
|
||||
else -> log(ContentAPI::class.java, Log.ERR, "Attempt to set the charge of invalid type: ${node.javaClass.simpleName}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2266,6 +2267,16 @@ fun addDialogueAction(player: Player, action: core.game.dialogue.DialogueAction)
|
|||
player.dialogueInterpreter.addAction(action)
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs a message to the server console
|
||||
* @param origin simply put (Kotlin) this::class.java or (Java) this.getClass()
|
||||
* @param type the type of log: Log.FINE (default, visible on VERBOSE), Log.INFO (visible on DETAILED), Log.WARN (visible on CAUTIOUS), Log.ERR (always visible)
|
||||
* @param message the actual message to log.
|
||||
*/
|
||||
fun log(origin: Class<*>, type: Log, message: String) {
|
||||
SystemLogger.processLogEntry(origin, type, message)
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by content handlers to check if the entity is done moving yet
|
||||
*/
|
||||
|
|
@ -2310,7 +2321,7 @@ fun clearScripts(entity: Entity) : Boolean {
|
|||
|
||||
fun restartScript(entity: Entity) : Boolean {
|
||||
if (entity.scripts.getActiveScript()?.persist != true) {
|
||||
SystemLogger.logErr(entity.scripts.getActiveScript()!!::class.java, "Tried to call restartScript on a non-persistent script! Either use stopExecuting() or make the script persistent.")
|
||||
log(entity.scripts.getActiveScript()!!::class.java, Log.ERR, "Tried to call restartScript on a non-persistent script! Either use stopExecuting() or make the script persistent.")
|
||||
return clearScripts(entity)
|
||||
}
|
||||
return true
|
||||
|
|
@ -2323,7 +2334,7 @@ fun keepRunning(entity: Entity) : Boolean {
|
|||
|
||||
fun stopExecuting(entity: Entity) : Boolean {
|
||||
if (entity.scripts.getActiveScript()?.persist == true) {
|
||||
SystemLogger.logErr(entity.scripts.getActiveScript()!!::class.java, "Tried to call stopExecuting() on a persistent script! To halt execution of a persistent script, you MUST call clearScripts()!")
|
||||
log(entity.scripts.getActiveScript()!!::class.java, Log.ERR, "Tried to call stopExecuting() on a persistent script! To halt execution of a persistent script, you MUST call clearScripts()!")
|
||||
return clearScripts(entity)
|
||||
}
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ import core.game.world.map.zone.ZoneRestriction
|
|||
interface MapArea : ContentInterface {
|
||||
var zone: MapZone
|
||||
get(){
|
||||
return zoneMaps[this.javaClass.simpleName + "MapArea"]!!
|
||||
return zoneMaps[this::class.java.simpleName + "MapArea"]!!
|
||||
}
|
||||
set(value) {
|
||||
zoneMaps[this.javaClass.simpleName + "MapArea"] = value
|
||||
zoneMaps[this::class.java.simpleName + "MapArea"] = value
|
||||
}
|
||||
|
||||
fun defineAreaBorders() : Array<ZoneBorders>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ import java.io.FileWriter
|
|||
import org.json.simple.JSONObject
|
||||
import org.json.simple.parser.JSONParser
|
||||
import core.ServerConstants
|
||||
import core.api.log
|
||||
import core.game.node.item.Item
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger.logShutdown
|
||||
import core.tools.SystemLogger.logStartup
|
||||
|
||||
|
|
@ -31,7 +33,7 @@ class GlobalKillCounter : StartupListener, ShutdownListener {
|
|||
val tmp_rare_drops = data.get("rare_drops")
|
||||
populate(rare_drops, tmp_rare_drops)
|
||||
} catch (e: Exception){
|
||||
SystemLogger.logErr(this::class.java, "Failed parsing ${file.name} - stack trace below.")
|
||||
log(this::class.java, Log.ERR, "Failed parsing ${file.name} - stack trace below.")
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
9
Server/src/main/core/cache/Cache.java
vendored
9
Server/src/main/core/cache/Cache.java
vendored
|
|
@ -10,8 +10,11 @@ import core.cache.def.impl.GraphicDefinition;
|
|||
import core.cache.def.impl.ItemDefinition;
|
||||
import core.cache.def.impl.NPCDefinition;
|
||||
import core.cache.def.impl.SceneryDefinition;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* A cache reader.
|
||||
*
|
||||
|
|
@ -48,7 +51,7 @@ public final class Cache {
|
|||
* @throws Throwable When an exception occurs.
|
||||
*/
|
||||
public static void init(String path) throws Throwable {
|
||||
SystemLogger.logInfo(Cache.class, "Initializing cache...");
|
||||
log(Cache.class, Log.FINE, "Initializing cache...");
|
||||
byte[] cacheFileBuffer = new byte[520];
|
||||
RandomAccessFile containersInformFile = new RandomAccessFile(path + File.separator + "main_file_cache.idx255", "r");
|
||||
RandomAccessFile dataFile = new RandomAccessFile(path + File.separator + "main_file_cache.dat2", "r");
|
||||
|
|
@ -61,7 +64,7 @@ public final class Cache {
|
|||
CacheFile cacheFile = new CacheFile(i, new RandomAccessFile(f, "r"), dataFile, 1000000, cacheFileBuffer);
|
||||
cacheFileManagers[i] = new CacheFileManager(cacheFile, true);
|
||||
if (cacheFileManagers[i].getInformation() == null) {
|
||||
SystemLogger.logErr(Cache.class, "Error loading cache index " + i + ": no information.");
|
||||
log(Cache.class, Log.ERR, "Error loading cache index " + i + ": no information.");
|
||||
cacheFileManagers[i] = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -93,7 +96,7 @@ public final class Cache {
|
|||
public static ByteBuffer getArchiveData(int index, int archive, boolean priority, int encryptionValue) {
|
||||
byte[] data = index == 255 ? referenceFile.getContainerData(archive) : cacheFileManagers[index].getCacheFile().getContainerData(archive);
|
||||
if (data == null || data.length < 1) {
|
||||
SystemLogger.logErr(Cache.class, "Invalid JS-5 request - " + index + ", " + archive + ", " + priority + ", " + encryptionValue + "!");
|
||||
log(Cache.class, Log.ERR, "Invalid JS-5 request - " + index + ", " + archive + ", " + priority + ", " + encryptionValue + "!");
|
||||
return null;
|
||||
}
|
||||
int compression = data[0] & 0xff;
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ public final class AnimationDefinition {
|
|||
} else if (opcode == 14) {
|
||||
aBoolean2141 = true;
|
||||
} else {
|
||||
System.out.println("Unhandled animation opcode " + opcode);
|
||||
|
||||
}
|
||||
} else
|
||||
anInt2162 = buffer.get() & 0xFF;
|
||||
|
|
|
|||
|
|
@ -77,11 +77,9 @@ public final class ClothDefinition {
|
|||
e.printStackTrace();
|
||||
}
|
||||
int length = Cache.getIndexes()[2].getFilesSize(3);
|
||||
System.out.println("Definition size: " + length + ".");
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
ClothDefinition def = forId(i);
|
||||
if (def.unknownBool)
|
||||
System.out.println("Clothing " + i + ": " + def.equipmentSlot + ", " + def.unknownBool + ", " + Arrays.toString(def.modelIds) + ", " + Arrays.toString(def.models));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,15 @@ package core.cache.def.impl;
|
|||
import core.cache.Cache;
|
||||
import core.cache.misc.buffer.ByteBufferUtils;
|
||||
import core.tools.CP1252;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
public class DataMap {
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +40,7 @@ public class DataMap {
|
|||
|
||||
public int getInt(int key){
|
||||
if(!dataStore.containsKey(key)){
|
||||
SystemLogger.logErr(this.getClass(), "Invalid value passed for key: " + key + " map: " + id);
|
||||
log(this.getClass(), Log.ERR, "Invalid value passed for key: " + key + " map: " + id);
|
||||
return -1;
|
||||
}
|
||||
return (int) dataStore.get(key);
|
||||
|
|
|
|||
|
|
@ -70,14 +70,14 @@ public class GraphicDefinition {
|
|||
}
|
||||
// 5046 - 5050 are related anims & 2148
|
||||
GraphicDefinition d = GraphicDefinition.forId(803);
|
||||
System.out.println("Graphic " + d.graphicsId + " anim id = " + d.animationId + ", " + d.defaultModel + ".");
|
||||
|
||||
for (int i = 0; i < 5000; i++) {
|
||||
GraphicDefinition def = GraphicDefinition.forId(i);
|
||||
if (def == null) {
|
||||
continue;
|
||||
}
|
||||
if ((def.animationId > 2000 && def.animationId < 2200) || (def.defaultModel >= 1300 && def.defaultModel < 1500)) {
|
||||
System.out.println("Possible match [id=" + i + ", anim=" + def.animationId + "].");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import core.game.node.item.Item;
|
|||
import core.game.node.item.ItemPlugin;
|
||||
import core.net.packet.PacketRepository;
|
||||
import core.net.packet.out.WeightUpdate;
|
||||
import core.plugin.Plugin;
|
||||
import core.tools.Log;
|
||||
import core.tools.StringUtils;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.system.config.ItemConfigParser;
|
||||
|
|
@ -25,6 +27,7 @@ import java.util.Map;
|
|||
import java.util.Arrays;
|
||||
|
||||
import static core.api.ContentAPIKt.equipSlot;
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Represents an item's definitions.
|
||||
|
|
@ -268,7 +271,7 @@ public class ItemDefinition extends Definition<Item> {
|
|||
}
|
||||
ItemDefinition def = ItemDefinition.parseDefinition(itemId, ByteBuffer.wrap(data));
|
||||
if (def == null) {
|
||||
SystemLogger.logErr(ItemDefinition.class, "Could not load item definitions for id " + itemId + " - no definitions found!");
|
||||
log(ItemDefinition.class, Log.ERR, "Could not load item definitions for id " + itemId + " - no definitions found!");
|
||||
return ;
|
||||
}
|
||||
if(itemId == 14958)
|
||||
|
|
@ -447,7 +450,7 @@ public class ItemDefinition extends Definition<Item> {
|
|||
def.clientScriptData.put(key, value);
|
||||
}
|
||||
} else {
|
||||
System.out.println("Unhandled item definition opcode - opcode: " + opcode);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1480,7 +1483,7 @@ public class ItemDefinition extends Definition<Item> {
|
|||
ItemDefinition def = forId(nodeId);
|
||||
if (def == null) {
|
||||
if (nodeId == 22937)
|
||||
SystemLogger.logErr(ItemDefinition.class, "[ItemDefinition] No definition for item id " + nodeId + "!");
|
||||
log(ItemDefinition.class, Log.ERR, "[ItemDefinition] No definition for item id " + nodeId + "!");
|
||||
return null;
|
||||
}
|
||||
OptionHandler handler = def.getConfiguration("option:" + name);
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ public final class NPCDefinition extends Definition<NPC> {
|
|||
byte[] data = Cache.getIndexes()[18].getFileData(id >>> 7, id & 0x7f);
|
||||
if (data == null) {
|
||||
if (id != -1) {
|
||||
// System.out.println("Failed loading NPC " + id + ".");
|
||||
|
||||
}
|
||||
} else {
|
||||
def.parse(ByteBuffer.wrap(data));
|
||||
|
|
@ -214,12 +214,12 @@ public final class NPCDefinition extends Definition<NPC> {
|
|||
|
||||
public static void main(String... args) throws Throwable {
|
||||
GameWorld.prompt(false);
|
||||
System.out.println("Roar: " + NPCDefinition.forId(2329).standAnimation);
|
||||
|
||||
// for (int i = 0; i < 11000; i++) {
|
||||
// ItemDefinition def = ItemDefinition.forId(i);
|
||||
// if (def.getMaleWornModelId1() >= 1250 && def.getMaleWornModelId1() <=
|
||||
// 1550) {
|
||||
// System.out.println(def.getName() + " " + i + ": " +
|
||||
|
||||
// def.getMaleWornModelId1());
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package core.cache.def.impl;
|
||||
|
||||
import core.cache.Cache;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.GameWorld;
|
||||
|
||||
|
|
@ -9,6 +10,8 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.Modifier;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Holds definitions for render animations.
|
||||
* @author Jagex
|
||||
|
|
@ -72,7 +75,7 @@ public class RenderAnimationDefinition {
|
|||
if (data != null) {
|
||||
defs.parse(ByteBuffer.wrap(data));
|
||||
} else {
|
||||
SystemLogger.logErr(RenderAnimationDefinition.class, "No definitions found for render animation " + animId + ", size=" + Cache.getIndexes()[2].getFilesSize(32) + "!");
|
||||
log(RenderAnimationDefinition.class, Log.ERR, "No definitions found for render animation " + animId + ", size=" + Cache.getIndexes()[2].getFilesSize(32) + "!");
|
||||
}
|
||||
return defs;
|
||||
}
|
||||
|
|
@ -291,7 +294,7 @@ public class RenderAnimationDefinition {
|
|||
public static void main(String...args) throws Throwable {
|
||||
GameWorld.prompt(false);
|
||||
RenderAnimationDefinition def = RenderAnimationDefinition.forId(1426);
|
||||
System.out.println("size: " + def.getClass().getDeclaredFields().length);
|
||||
|
||||
for (Field f : def.getClass().getDeclaredFields()) {
|
||||
if (!Modifier.isStatic(f.getModifiers())) {
|
||||
if (f.getType().isArray()) {
|
||||
|
|
@ -305,7 +308,7 @@ public class RenderAnimationDefinition {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
System.out.println(f.getName() + ", " + f.get(def));
|
||||
|
||||
}
|
||||
}
|
||||
for (Field f : def.getClass().getSuperclass().getDeclaredFields()) {
|
||||
|
|
@ -321,7 +324,7 @@ public class RenderAnimationDefinition {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
System.out.println(f.getName() + ", " + f.get(def));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import core.cache.misc.buffer.ByteBufferUtils;
|
|||
import core.game.interaction.OptionHandler;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.scenery.Scenery;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.GameWorld;
|
||||
|
||||
|
|
@ -13,6 +14,8 @@ import java.nio.ByteBuffer;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Represents an object's definition.
|
||||
* @author Emperor
|
||||
|
|
@ -520,14 +523,14 @@ public class SceneryDefinition extends Definition<Scenery> {
|
|||
// for (int id = 0; id <= 27325; id++) {
|
||||
// ObjectDefinition def = ObjectDefinition.forId(id);
|
||||
// if (def.mapIcon > 69) {
|
||||
// System.out.println(id + " - " + def.getName() + " has map icon " +
|
||||
|
||||
// def.mapIcon);
|
||||
// }
|
||||
// }
|
||||
// return; 2105
|
||||
// }
|
||||
/*ObjectDefinition def = ObjectDefinition.forId(2105);
|
||||
System.out.println("size: " + def.getClass().getDeclaredFields().length);
|
||||
|
||||
for (Field f : def.getClass().getDeclaredFields()) {
|
||||
if (!Modifier.isStatic(f.getModifiers())) {
|
||||
if (f.getType().isArray()) {
|
||||
|
|
@ -538,11 +541,11 @@ public class SceneryDefinition extends Definition<Scenery> {
|
|||
for (int i = 0; i < length; i++) {
|
||||
System.out.print(Array.get(object, i) + (i < (length - 1) ? ", " : "]"));
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
System.out.println(f.getName() + ", " + f.get(def));
|
||||
|
||||
}
|
||||
}
|
||||
for (Field f : def.getClass().getSuperclass().getDeclaredFields()) {
|
||||
|
|
@ -555,11 +558,11 @@ public class SceneryDefinition extends Definition<Scenery> {
|
|||
for (int i = 0; i < length; i++) {
|
||||
System.out.print(Array.get(object, i) + (i < (length - 1) ? ", " : "]"));
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
System.out.println(f.getName() + ", " + f.get(def));
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
@ -615,7 +618,7 @@ public class SceneryDefinition extends Definition<Scenery> {
|
|||
// SystemLogger.logErr("----------------------------------------------------\n\n\n");
|
||||
while (true) {
|
||||
if (!buffer.hasRemaining()) {
|
||||
SystemLogger.logErr(SceneryDefinition.class, "Buffer empty for " + objectId);
|
||||
log(SceneryDefinition.class, Log.ERR, "Buffer empty for " + objectId);
|
||||
break;
|
||||
}
|
||||
int opcode = buffer.get() & 0xFF;
|
||||
|
|
@ -801,7 +804,7 @@ public class SceneryDefinition extends Definition<Scenery> {
|
|||
}
|
||||
} else {
|
||||
if (opcode != 0) {
|
||||
SystemLogger.logErr(SceneryDefinition.class, "Unhandled object definition opcode: " + opcode);
|
||||
log(SceneryDefinition.class, Log.ERR, "Unhandled object definition opcode: " + opcode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@ package core.cache.def.impl;
|
|||
|
||||
import core.cache.Cache;
|
||||
import core.cache.misc.buffer.ByteBufferUtils;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
public class Struct {
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +31,7 @@ public class Struct {
|
|||
|
||||
public int getInt(int key){
|
||||
if(!dataStore.containsKey(key)){
|
||||
SystemLogger.logErr(this.getClass(), "Invalid value passed for key: " + key + " struct: " + id);
|
||||
log(this.getClass(), Log.ERR, "Invalid value passed for key: " + key + " struct: " + id);
|
||||
return -1;
|
||||
}
|
||||
return (int) dataStore.get(key);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
package core.game.activity;
|
||||
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.GameWorld;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Manages the activities.
|
||||
* @author Emperor
|
||||
|
|
@ -50,7 +53,7 @@ public final class ActivityManager {
|
|||
ActivityPlugin plugin = ACTIVITIES.get(name);
|
||||
if (plugin == null) {
|
||||
if (GameWorld.getSettings().isDevMode()) {
|
||||
SystemLogger.logErr(ActivityManager.class, "Unhandled activity - " + name + "!");
|
||||
log(ActivityManager.class, Log.ERR, "Unhandled activity - " + name + "!");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import core.api.Event
|
|||
import core.api.utils.PlayerCamera
|
||||
import core.tools.SystemLogger
|
||||
import core.game.world.GameWorld
|
||||
import core.tools.Log
|
||||
|
||||
/**
|
||||
* A utility class for making cutscenes.
|
||||
|
|
@ -259,7 +260,7 @@ abstract class Cutscene(val player: Player) {
|
|||
try {
|
||||
endActions?.invoke()
|
||||
} catch (e: Exception) {
|
||||
SystemLogger.logErr(this::class.java, "There's some bad nasty code in ${this::class.java.simpleName} end actions!")
|
||||
log(this::class.java, Log.ERR, "There's some bad nasty code in ${this::class.java.simpleName} end actions!")
|
||||
e.printStackTrace()
|
||||
}
|
||||
return true
|
||||
|
|
@ -347,7 +348,7 @@ abstract class Cutscene(val player: Player) {
|
|||
fun logCutscene(message: String)
|
||||
{
|
||||
if(ServerConstants.LOG_CUTSCENE)
|
||||
SystemLogger.logInfo(this::class.java, "$message")
|
||||
log(this::class.java, Log.FINE, "$message")
|
||||
}
|
||||
|
||||
fun clearNPCs() {
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ public class AIPlayer extends Player {
|
|||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println("Missing " + fileName);
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
@ -349,7 +349,7 @@ public class AIPlayer extends Player {
|
|||
int meX = this.getLocation().getX();
|
||||
int meY = this.getLocation().getY();
|
||||
//int meX2 = this.getLocation().getX();
|
||||
//System.out.println("local " + meX + " real x? " + meX2 );
|
||||
|
||||
ArrayList<Node> nodes = new ArrayList<Node>();
|
||||
for (NPC npc : RegionManager.getLocalNpcs(this, range)) {
|
||||
if (entrys.contains(npc.getId()))
|
||||
|
|
@ -381,7 +381,7 @@ public class AIPlayer extends Player {
|
|||
public Node getClosestNodeWithEntryAndDirection(int range, int entry, Direction direction) {
|
||||
ArrayList<Node> nodeList = getNodeInRange(range, entry);
|
||||
if (nodeList.isEmpty()) {
|
||||
//System.out.println("nodelist empty");
|
||||
|
||||
return null;
|
||||
}
|
||||
Node node = getClosestNodeinNodeListWithDirection(nodeList, direction);
|
||||
|
|
@ -391,7 +391,7 @@ public class AIPlayer extends Player {
|
|||
public Node getClosestNodeWithEntry(int range, int entry) {
|
||||
ArrayList<Node> nodeList = getNodeInRange(range, entry);
|
||||
if (nodeList.isEmpty()) {
|
||||
//System.out.println("nodelist empty");
|
||||
|
||||
return null;
|
||||
}
|
||||
Node node = getClosestNodeinNodeList(nodeList);
|
||||
|
|
@ -401,7 +401,7 @@ public class AIPlayer extends Player {
|
|||
public Node getClosestNodeWithEntry(int range, List<Integer> entrys) {
|
||||
ArrayList<Node> nodeList = getNodeInRange(range, entrys);
|
||||
if (nodeList.isEmpty()) {
|
||||
//System.out.println("nodelist empty");
|
||||
|
||||
return null;
|
||||
}
|
||||
Node node = getClosestNodeinNodeList(nodeList);
|
||||
|
|
@ -453,7 +453,7 @@ public class AIPlayer extends Player {
|
|||
|
||||
private Node getClosestNodeinNodeListWithDirection(ArrayList<Node> nodes, Direction direction) {
|
||||
if (nodes.isEmpty()) {
|
||||
//System.out.println("nodelist empty");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ public class AIPlayer extends Player {
|
|||
|
||||
private Node getClosestNodeinNodeList(ArrayList<Node> nodes) {
|
||||
if (nodes.isEmpty()) {
|
||||
//System.out.println("nodelist empty");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -528,7 +528,7 @@ public class AIPlayer extends Player {
|
|||
Repository.getPlayers().remove(player);
|
||||
return;
|
||||
}
|
||||
//SystemLogger.logErr(this.getClass(), "Could not deregister AIP#" + uid + ": UID not added to the mapping!");
|
||||
//log(this.getClass(), Log.ERR, "Could not deregister AIP#" + uid + ": UID not added to the mapping!");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import core.tools.SystemLogger
|
|||
import core.game.system.config.ItemConfigParser
|
||||
import core.game.world.GameWorld
|
||||
import core.game.world.repository.Repository
|
||||
import core.tools.Log
|
||||
import core.tools.colorize
|
||||
import java.util.*
|
||||
import java.util.concurrent.CountDownLatch
|
||||
|
|
@ -78,7 +79,7 @@ class ScriptAPI(private val bot: Player) {
|
|||
val opt: Option? = node.interaction.options.filter {it != null && it.name.equals(option, true) }.firstOrNull()
|
||||
|
||||
if(opt == null){
|
||||
SystemLogger.logWarn(this::class.java, "Invalid option name provided: $option")
|
||||
log(this::class.java, Log.WARN, "Invalid option name provided: $option")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -491,7 +492,6 @@ class ScriptAPI(private val bot: Player) {
|
|||
}
|
||||
val canSell = GrandExchange.addBotOffer(actualId, itemAmt)
|
||||
if (canSell && saleIsBigNews(actualId, itemAmt)) {
|
||||
SystemLogger.logAI(this::class.java, "Offered $itemAmt of $actualId on the GE.")
|
||||
Repository.sendNews(SERVER_GE_NAME + " just offered " + itemAmt + " " + ItemDefinition.forId(actualId).name.toLowerCase() + " on the GE.")
|
||||
}
|
||||
bot.bank.remove(Item(id, itemAmt))
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ import core.game.node.entity.player.Player;
|
|||
import core.plugin.Plugin;
|
||||
import core.plugin.PluginManifest;
|
||||
import core.plugin.PluginType;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
import static core.api.DialUtilsKt.splitLines;
|
||||
import static core.tools.DialogueConstKt.DIALOGUE_INITIAL_OPTIONS_HANDLE;
|
||||
import static core.tools.DialogueConstKt.START_DIALOGUE;
|
||||
|
|
@ -197,7 +199,7 @@ public abstract class DialoguePlugin implements Plugin<Player> {
|
|||
}
|
||||
|
||||
if (npc == null) {
|
||||
SystemLogger.logWarn(this.getClass(),
|
||||
log(this.getClass(), Log.WARN,
|
||||
args[0].getClass().getSimpleName() +
|
||||
"Is not assigning an NPC. Whoever did that should fix it."
|
||||
);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import core.game.system.command.Privilege
|
|||
import core.game.system.config.ItemConfigParser
|
||||
import core.game.world.GameWorld
|
||||
import core.game.world.repository.Repository
|
||||
import core.tools.Log
|
||||
import core.tools.colorize
|
||||
import java.lang.Integer.max
|
||||
import java.util.concurrent.LinkedBlockingDeque
|
||||
|
|
@ -218,7 +219,7 @@ class GrandExchange : StartupListener, Commands {
|
|||
|
||||
if ( offer.offerState != OfferState.PENDING || offer.uid != 0L )
|
||||
{
|
||||
SystemLogger.logWarn(this::class.java, "[GE] DISPATCH FAILURE: ${offer.offerState.name}, UID: ${offer.uid}")
|
||||
log(this::class.java, Log.WARN, "[GE] DISPATCH FAILURE: ${offer.offerState.name}, UID: ${offer.uid}")
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package core.game.global.action;
|
|||
import core.game.node.entity.player.Player;
|
||||
import core.game.system.communication.CommunicationInfo;
|
||||
import content.global.handlers.item.SpadeDigListener;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.system.task.Pulse;
|
||||
import core.game.world.GameWorld;
|
||||
|
|
@ -12,6 +13,8 @@ import core.game.world.update.flag.context.Animation;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles digging with a spade.
|
||||
* @author Emperor
|
||||
|
|
@ -63,7 +66,7 @@ public final class DigSpadeHandler {
|
|||
*/
|
||||
public static boolean register(Location location, DigAction action) {
|
||||
if (ACTIONS.containsKey(location)) {
|
||||
SystemLogger.logErr(CommunicationInfo.class, "Already contained dig reward for location " + location + ".");
|
||||
log(CommunicationInfo.class, Log.ERR, "Already contained dig reward for location " + location + ".");
|
||||
return false;
|
||||
}
|
||||
ACTIONS.put(location, action);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ object PickupHandler {
|
|||
return true
|
||||
}
|
||||
if (player.getAttribute("droppedItem:" + item.id, 0) > GameWorld.ticks) { //Splinter
|
||||
SystemLogger.logAlert(this::class.java, "$player tried to do the drop & quick pick-up Ground Item dupe.")
|
||||
return true
|
||||
}
|
||||
if (item !is GroundSpawnLoader.GroundSpawn && item.isRemainPrivate && !item.droppedBy(player)) {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class DestinationFlag {
|
|||
if (dir != null) {
|
||||
return getDestination(mover, object, sizeX, sizeY, dir, 3);
|
||||
}
|
||||
// System.out.println(dir);
|
||||
|
||||
return getDestination(mover, object, sizeX, sizeY, Direction.getLogicalDirection(object.getLocation(), mover.getLocation()), 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,12 @@ import core.game.world.update.flag.player.FaceLocationFlag;
|
|||
import core.net.packet.PacketRepository;
|
||||
import core.net.packet.context.InteractionOptionContext;
|
||||
import core.net.packet.out.InteractionOption;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.GameWorld;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles interaction between nodes.
|
||||
* @author Emperor
|
||||
|
|
@ -85,7 +88,7 @@ public class InteractPlugin {
|
|||
player.dispatch(new InteractionEvent(node, option.getName().toLowerCase()));
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
SystemLogger.logErr(this.getClass(), this.getClass().getName() + e.getMessage());
|
||||
log(this.getClass(), Log.ERR, this.getClass().getName() + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +121,7 @@ public class InteractPlugin {
|
|||
}
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
SystemLogger.logErr(this.getClass(), this.getClass().getName() + e.getMessage());
|
||||
log(this.getClass(), Log.ERR, this.getClass().getName() + e.getMessage());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -149,7 +152,7 @@ public class InteractPlugin {
|
|||
player.getPacketDispatch().sendMessage("Nothing interesting happens.");
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
SystemLogger.logErr(this.getClass(), this.getClass().getName() + e.getMessage());
|
||||
log(this.getClass(), Log.ERR, this.getClass().getName() + e.getMessage());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -187,7 +190,7 @@ public class InteractPlugin {
|
|||
}
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
SystemLogger.logErr(this.getClass(), this.getClass().getName() + e.getMessage());
|
||||
log(this.getClass(), Log.ERR, this.getClass().getName() + e.getMessage());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,9 +233,6 @@ public abstract class MovementPulse extends Pulse {
|
|||
return;
|
||||
}
|
||||
if(destination.getLocation() == null){
|
||||
SystemLogger.logAlert(this.getClass(), destination.getId() + " < ID");
|
||||
SystemLogger.logAlert(this.getClass(), destination.getName() + " < NAME");
|
||||
SystemLogger.logAlert(this.getClass(), "ASDAD");
|
||||
return;
|
||||
}
|
||||
boolean inside = isInsideEntity(mover.getLocation());
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public final class Option {
|
|||
if (node instanceof Item) {
|
||||
return ItemDefinition.getOptionHandler(nodeId, name);
|
||||
}
|
||||
System.out.println("Unhandled node type " + node + "!");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package core.game.interaction;
|
|||
import core.cache.def.impl.SceneryDefinition;
|
||||
import core.game.node.Node;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.map.Location;
|
||||
import core.plugin.Plugin;
|
||||
|
|
@ -10,6 +11,8 @@ import core.plugin.Plugin;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles an interaction option.
|
||||
* @author Emperor
|
||||
|
|
@ -71,7 +74,7 @@ public abstract class OptionHandler implements Plugin<Object> {
|
|||
final SceneryDefinition definition = SceneryDefinition.forId(wrapper);
|
||||
final List<Integer> list = new ArrayList<>(20);
|
||||
if (definition.getChildrenIds() == null) {
|
||||
SystemLogger.logErr(this.getClass(), "Null child wrapper in option handler wrapperId=" + wrapper);
|
||||
log(this.getClass(), Log.ERR, "Null child wrapper in option handler wrapperId=" + wrapper);
|
||||
return new int[] { wrapper };
|
||||
}
|
||||
for (int child : definition.getChildrenIds()) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import core.game.node.scenery.Scenery
|
|||
import core.game.world.GameWorld
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.path.Pathfinder
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
import java.lang.Integer.max
|
||||
|
||||
|
|
@ -150,7 +151,7 @@ class ScriptProcessor(val entity: Entity) {
|
|||
continue
|
||||
if (entity !is Player) {
|
||||
toRemove.add(script)
|
||||
SystemLogger.logErr(this::class.java, "Tried to queue an item UseWith interaction for a non-player!")
|
||||
log(this::class.java, Log.ERR, "Tried to queue an item UseWith interaction for a non-player!")
|
||||
continue
|
||||
}
|
||||
if (script.nextExecution > GameWorld.ticks)
|
||||
|
|
@ -273,7 +274,7 @@ class ScriptProcessor(val entity: Entity) {
|
|||
|
||||
fun addToQueue(script: Script<*>, strength: QueueStrength) {
|
||||
if (script !is QueuedScript && script !is QueuedUseWith) {
|
||||
SystemLogger.logErr(this::class.java, "Tried to queue ${script::class.java.simpleName} as a queueable script but it's not!")
|
||||
log(this::class.java, Log.ERR, "Tried to queue ${script::class.java.simpleName} as a queueable script but it's not!")
|
||||
return
|
||||
}
|
||||
if (strength == QueueStrength.STRONG && entity is Player) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import core.game.node.entity.npc.NPC;
|
|||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.node.scenery.Scenery;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.system.task.Pulse;
|
||||
import core.game.world.map.Location;
|
||||
|
|
@ -19,6 +20,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Handles the "use {@code node a} with {@code node b}" option.
|
||||
*
|
||||
|
|
@ -210,7 +213,7 @@ public abstract class UseWithHandler implements Plugin<Object> {
|
|||
final SceneryDefinition definition = SceneryDefinition.forId(wrapper);
|
||||
final List<Integer> list = new ArrayList<>(20);
|
||||
if (definition.getChildrenIds() == null) {
|
||||
SystemLogger.logErr(this.getClass(), "Null child wrapper in option handler wrapperId=" + wrapper);
|
||||
log(this.getClass(), Log.ERR, "Null child wrapper in option handler wrapperId=" + wrapper);
|
||||
return new int[]{wrapper};
|
||||
}
|
||||
for (int child : definition.getChildrenIds()) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import core.game.node.entity.player.link.audio.Audio
|
|||
import core.game.node.entity.player.link.prayer.PrayerType
|
||||
import core.game.node.entity.skill.Skills
|
||||
import content.global.skill.summoning.familiar.Familiar
|
||||
import core.api.log
|
||||
import core.game.world.map.Direction
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.RegionManager
|
||||
|
|
@ -21,6 +22,7 @@ import core.game.world.update.flag.context.Animation
|
|||
import core.tools.RandomFunction
|
||||
import core.tools.SystemLogger
|
||||
import core.game.system.config.ItemConfigParser
|
||||
import core.tools.Log
|
||||
import java.util.*
|
||||
import kotlin.math.floor
|
||||
|
||||
|
|
@ -187,7 +189,7 @@ abstract class CombatSwingHandler(var type: CombatStyle?) {
|
|||
val block = floor(101 - ratio)
|
||||
val acc = Math.random() * accuracy
|
||||
val def = Math.random() * block
|
||||
return (acc > def).also { if(entity?.username?.toLowerCase() == "test10") SystemLogger.logInfo(this::class.java, "Should hit: $it") }
|
||||
return (acc > def).also { if(entity?.username?.toLowerCase() == "test10") log(this::class.java, Log.FINE, "Should hit: $it") }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -597,7 +599,7 @@ abstract class CombatSwingHandler(var type: CombatStyle?) {
|
|||
specialHandlers = HashMap()
|
||||
}
|
||||
if (specialHandlers!!.containsKey(itemId)) {
|
||||
SystemLogger.logErr(this::class.java, "Already contained special attack handler for item " + itemId + " - [old=" + specialHandlers!![itemId]!!::class.java.simpleName + ", new=" + handler.javaClass.simpleName + "].")
|
||||
log(this::class.java, Log.ERR, "Already contained special attack handler for item " + itemId + " - [old=" + specialHandlers!![itemId]!!::class.java.simpleName + ", new=" + handler.javaClass.simpleName + "].")
|
||||
return false
|
||||
}
|
||||
return specialHandlers!!.put(itemId, handler) == null
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ open class MeleeSwingHandler
|
|||
|
||||
override fun getSetMultiplier(e: Entity?, skillId: Int): Double {
|
||||
if (e!!.properties.armourSet === ArmourSet.DHAROK && skillId == Skills.STRENGTH) {
|
||||
// System.out.println("Fiist number -> " + 1.0 + ((e.getSkills().getMaximumLifepoints() - e.getSkills().getLifepoints()) * 0.01));
|
||||
|
||||
return 1.0 + (e!!.skills.maximumLifepoints - e.skills.lifepoints) * 0.01
|
||||
}
|
||||
if(e is Player && e.isWearingVoid(CombatStyle.MELEE) && (skillId == Skills.ATTACK || skillId == Skills.STRENGTH)) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package core.game.node.entity.combat
|
||||
|
||||
import content.global.skill.skillcapeperks.SkillcapePerks
|
||||
import core.api.log
|
||||
import core.game.container.impl.EquipmentContainer
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.equipment.*
|
||||
|
|
@ -20,6 +21,7 @@ import core.game.world.update.flag.context.Graphics
|
|||
import core.tools.RandomFunction
|
||||
import core.tools.SystemLogger
|
||||
import core.game.world.GameWorld
|
||||
import core.tools.Log
|
||||
import java.util.*
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.floor
|
||||
|
|
@ -75,7 +77,7 @@ open class RangeSwingHandler
|
|||
}
|
||||
var hit = 0
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.RANGE)) {
|
||||
val max = calculateHit(entity, victim, 1.0).also { if(entity?.name?.toLowerCase() == "test10") SystemLogger.logInfo(this::class.java, "Damage: $it") }
|
||||
val max = calculateHit(entity, victim, 1.0).also { if(entity?.name?.toLowerCase() == "test10") log(this::class.java, Log.FINE, "Damage: $it") }
|
||||
state.maximumHit = max
|
||||
hit = RandomFunction.random(max + 1)
|
||||
}
|
||||
|
|
@ -106,7 +108,7 @@ open class RangeSwingHandler
|
|||
if (entity is Player) {
|
||||
val rw = RangeWeapon.get(entity.equipment.getNew(3).id)
|
||||
if (rw == null) {
|
||||
SystemLogger.logErr(this::class.java, "Unhandled range weapon used - [item id=" + entity.equipment.getNew(3).id + "].")
|
||||
log(this::class.java, Log.ERR, "Unhandled range weapon used - [item id=" + entity.equipment.getNew(3).id + "].")
|
||||
return
|
||||
}
|
||||
w = Weapon(entity.equipment[3], rw.ammunitionSlot, entity.equipment.getNew(rw.ammunitionSlot))
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public final class RangeWeapon {
|
|||
return false;
|
||||
}
|
||||
NodeList nodeList = doc.getDocumentElement().getChildNodes();
|
||||
System.out.println("Loading range weapon info...");
|
||||
|
||||
for (short i = 1; i < nodeList.getLength(); i += 2) {
|
||||
Node n = nodeList.item(i);
|
||||
if (n != null) {
|
||||
|
|
@ -131,7 +131,7 @@ public final class RangeWeapon {
|
|||
}
|
||||
}
|
||||
}
|
||||
System.out.println("Loaded " + RANGE_WEAPONS.size() + " range weapon definitions.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,10 +107,10 @@ public enum SpellType {
|
|||
BARRAGE(1.4) {
|
||||
@Override
|
||||
public int getImpactAmount(Entity e, Entity victim, int base) {
|
||||
System.out.println("Attacker - >" + e.getName());
|
||||
System.out.println("Victim - >" + victim.getName());
|
||||
System.out.println("Accuracy Mod -> " + getAccuracyMod());
|
||||
System.out.println("Base Mod -> " + base);
|
||||
|
||||
|
||||
|
||||
|
||||
return 26 + base;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,11 +8,14 @@ import core.game.world.map.Direction;
|
|||
import core.game.world.map.Location;
|
||||
import core.game.world.map.Point;
|
||||
import core.game.world.map.RegionManager;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import java.util.Deque;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* The walking queue.
|
||||
* @author Emperor
|
||||
|
|
@ -375,7 +378,7 @@ public final class WalkingQueue {
|
|||
Location loc = entity.getLocation();
|
||||
|
||||
if (loc == null) {
|
||||
SystemLogger.logErr(this.getClass(),
|
||||
log(this.getClass(), Log.ERR,
|
||||
"The entity location provided was null."
|
||||
+ "Are you sure anything down the stack trace isn't providing an NPC with a null location?"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package core.game.node.entity.npc;
|
||||
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.map.Location;
|
||||
import core.plugin.Plugin;
|
||||
|
|
@ -7,6 +8,8 @@ import core.plugin.Plugin;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Used as superclass for "special NPC" plugins.
|
||||
* @author Emperor
|
||||
|
|
@ -63,7 +66,7 @@ public abstract class AbstractNPC extends NPC implements Plugin<Object> {
|
|||
if (mapping.containsKey(id)) {
|
||||
String name = mapping.get(id).getClass().getSimpleName();
|
||||
if (name != getClass().getSimpleName()) {
|
||||
SystemLogger.logErr(this.getClass(), "[" + getClass().getSimpleName() + "] - Warning: Mapping already contained NPC id " + id + "! (" + name + ")");
|
||||
log(this.getClass(), Log.ERR, "[" + getClass().getSimpleName() + "] - Warning: Mapping already contained NPC id " + id + "! (" + name + ")");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,9 +56,7 @@ import core.net.packet.context.SkillContext;
|
|||
import core.net.packet.out.BuildDynamicScene;
|
||||
import core.net.packet.out.SkillLevel;
|
||||
import core.net.packet.out.UpdateSceneGraph;
|
||||
import core.tools.RandomFunction;
|
||||
import core.tools.StringUtils;
|
||||
import core.tools.TickUtilsKt;
|
||||
import core.tools.*;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import org.rs09.consts.Items;
|
||||
|
|
@ -73,7 +71,6 @@ import core.game.node.entity.combat.graves.GraveController;
|
|||
import core.game.node.entity.player.info.login.PlayerSaver;
|
||||
import core.game.node.entity.state.State;
|
||||
import core.game.node.entity.state.StateRepository;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.GameWorld;
|
||||
import core.game.world.repository.Repository;
|
||||
import core.game.world.update.MapChunkRenderer;
|
||||
|
|
@ -318,6 +315,8 @@ public class Player extends Entity {
|
|||
|
||||
private int archeryTotal = 0;
|
||||
|
||||
public byte[] opCounts = new byte[255];
|
||||
|
||||
/**
|
||||
* Constructs a new {@code Player} {@code Object}.
|
||||
* @param details The player's details.
|
||||
|
|
@ -333,7 +332,7 @@ public class Player extends Entity {
|
|||
@Override
|
||||
public void init() {
|
||||
if(!artificial)
|
||||
SystemLogger.logInfo(this.getClass(), getUsername() + " initialising...");
|
||||
log(this.getClass(), Log.INFO, getUsername() + " initialising...");
|
||||
if (!artificial) {
|
||||
getProperties().setSpawnLocation(ServerConstants.HOME_LOCATION);
|
||||
getDetails().getSession().setObject(this);
|
||||
|
|
@ -528,6 +527,7 @@ public class Player extends Entity {
|
|||
PlayerParser.saveImmediately(this);
|
||||
removeAttribute("flagged-for-save");
|
||||
}
|
||||
Arrays.fill(opCounts, (byte) 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import core.integrations.discord.Discord
|
|||
import kotlinx.coroutines.*
|
||||
import org.sqlite.SQLiteDataSource
|
||||
import core.ServerConstants
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
import java.io.File
|
||||
import java.sql.Connection
|
||||
|
|
@ -138,7 +139,7 @@ object PlayerMonitor {
|
|||
}
|
||||
|
||||
@JvmStatic fun flushRemainingEventsImmediately() {
|
||||
SystemLogger.logInfo(this::class.java, "Flushing player log events...")
|
||||
core.api.log(this::class.java, Log.FINE, "Flushing player log events...")
|
||||
val path = ServerConstants.LOGS_PATH + "playerlogs.db"
|
||||
if (!File(path).exists()) {
|
||||
createSqliteDatabase(path)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import core.plugin.Plugin;
|
|||
import core.ServerConstants;
|
||||
import core.game.interaction.InteractionListeners;
|
||||
import content.global.handlers.iface.RulesAndInfo;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
import core.game.world.GameWorld;
|
||||
import core.game.world.repository.Repository;
|
||||
|
|
@ -26,6 +27,8 @@ import java.util.Random;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
|
||||
/**
|
||||
* Sends the login configuration packets.
|
||||
|
|
@ -209,7 +212,7 @@ public final class LoginConfiguration {
|
|||
*/
|
||||
public static final void config(final Player player) {
|
||||
if(!player.isArtificial())
|
||||
SystemLogger.logInfo(LoginConfiguration.class, "configuring player " + player.getUsername());
|
||||
log(LoginConfiguration.class, Log.INFO, "configuring player " + player.getUsername());
|
||||
player.getInventory().refresh();
|
||||
player.getEquipment().refresh();
|
||||
player.getSkills().refresh();
|
||||
|
|
@ -226,7 +229,7 @@ public final class LoginConfiguration {
|
|||
player.getEmoteManager().refresh();
|
||||
player.getInterfaceManager().openInfoBars();
|
||||
if(!player.isArtificial())
|
||||
SystemLogger.logInfo(LoginConfiguration.class, "finished configuring player " + player.getUsername());
|
||||
log(LoginConfiguration.class, Log.INFO, "finished configuring player " + player.getUsername());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@ package core.game.node.entity.player.info.login;
|
|||
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.ServerConstants;
|
||||
import core.tools.Log;
|
||||
import core.tools.SystemLogger;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import static core.api.ContentAPIKt.log;
|
||||
|
||||
/**
|
||||
* Class used to abstract the process of loading a player save.
|
||||
* @author Ceikry
|
||||
|
|
@ -61,7 +64,7 @@ public final class PlayerParser {
|
|||
assert os != null;
|
||||
os.close();
|
||||
} catch (Exception f){
|
||||
SystemLogger.logWarn(PlayerParser.class, "Unable to close file copiers in PlayerParser.java line 216.");
|
||||
log(PlayerParser.class, Log.ERR, "Unable to close file copiers in PlayerParser.java line 216.");
|
||||
f.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue