Made ironman icons visible in clan and global chat (requires world.ironman_icons to be true)
Authentic tormented demon safe spotting Added cannon restriction to tormented demon area
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package core.game.node.entity.player.info;
|
||||
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.ServerConstants;
|
||||
|
||||
/**
|
||||
* Represent the rights of a player.
|
||||
@@ -24,9 +25,11 @@ public enum Rights {
|
||||
if (c != Rights.REGULAR_PLAYER && c != null) {
|
||||
return c.toInteger();
|
||||
}
|
||||
if (player.getIronmanManager().isIronman()) {
|
||||
return player.getIronmanManager().getMode().getIcon();
|
||||
}
|
||||
if (ServerConstants.IRONMAN_ICONS) {
|
||||
if (player.getIronmanManager().isIronman()) {
|
||||
return player.getIronmanManager().getMode().getIcon();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import core.api.sendMessage
|
||||
import core.api.setAttribute
|
||||
import core.game.system.command.Privilege
|
||||
import core.game.world.repository.Repository
|
||||
import core.game.node.entity.player.info.Rights
|
||||
import core.tools.colorize
|
||||
|
||||
class GlobalChat : Commands {
|
||||
@@ -20,9 +21,9 @@ class GlobalChat : Commands {
|
||||
|
||||
companion object {
|
||||
val ATTR_GLOBAL_MUTE = "/save:globalmute"
|
||||
fun process(sender: String, message: String) {
|
||||
val msgSD = prepare(sender, message, false)
|
||||
val msgHD = prepare(sender, message, true)
|
||||
fun process(sender: String, message: String, rights: Int) {
|
||||
val msgSD = prepare(sender, message, false, rights)
|
||||
val msgHD = prepare(sender, message, true, rights)
|
||||
for (player in Repository.players.filter { !getAttribute(it, ATTR_GLOBAL_MUTE, false) }) {
|
||||
if (player.interfaceManager.isResizable)
|
||||
sendMessage(player, msgHD)
|
||||
@@ -31,10 +32,10 @@ class GlobalChat : Commands {
|
||||
}
|
||||
}
|
||||
|
||||
private fun prepare(sender: String, message: String, isResizable: Boolean): String {
|
||||
private fun prepare(sender: String, message: String, isResizable: Boolean, rights: Int): String {
|
||||
val baseColor = if (isResizable) "%f1b04c" else "%7512ff"
|
||||
val bracketColor = if (isResizable) "%ffffff" else "%000000"
|
||||
return colorize("$bracketColor[${baseColor}G$bracketColor] $sender: ${baseColor}$message")
|
||||
return colorize("$bracketColor[${baseColor}G$bracketColor] ${if (rights > 0) "<img=${rights - 1}>" else ""}$sender: ${baseColor}$message")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ object ServerConfigParser {
|
||||
ServerConstants.DISCORD_OPENRSC_HOOK = data.getString("server.openrsc_integration_webhook", "")
|
||||
ServerConstants.ENABLE_GLOBALCHAT = data.getBoolean("world.enable_globalchat", true)
|
||||
ServerConstants.MAX_PATHFIND_DISTANCE = data.getLong("server.max_pathfind_dist", 25L).toInt()
|
||||
ServerConstants.IRONMAN_ICONS = data.getBoolean("world.ironman_icons", false)
|
||||
|
||||
val logLevel = data.getString("server.log_level", "VERBOSE").uppercase()
|
||||
ServerConstants.LOG_LEVEL = parseEnumEntry<LogLevel>(logLevel) ?: LogLevel.VERBOSE
|
||||
|
||||
Reference in New Issue
Block a user