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:
@@ -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++) {
|
||||
|
||||
+3
-1
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+3
-2
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -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." )
|
||||
|
||||
+4
-4
@@ -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) {_, _ ->
|
||||
|
||||
Reference in New Issue
Block a user