3import com.moandjiezana.toml.Toml;
4import com.osroyale.game.world.WorldType;
5import com.osroyale.game.world.entity.mob.player.appearance.Appearance;
6import com.osroyale.game.world.entity.mob.player.appearance.Gender;
7import com.osroyale.game.world.items.Item;
8import com.osroyale.game.world.position.Position;
9import com.osroyale.net.session.Session;
10import io.netty.util.AttributeKey;
11import io.netty.util.ResourceLeakDetector;
12import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
13import it.unimi.dsi.fastutil.objects.ObjectSet;
16import java.math.BigInteger;
17import java.util.Arrays;
57* The
class that contains setting-related constants for the server.
71 "There are currently #players players online!",
72 "Make sure to vote daily for great rewards!",
73 "Donating really helps us with keeping the server alive"
78 "Update threads are released every tuesday",
79 "The owner is Apollo",
80 "The community manager is Prodigy"
86 "Tarnish is currently in it's",
87 "early stages. We are only",
88 "100 players until official",
92 public static final String[] WELCOME_UPDATE = {
94 "[ February 24, 2018 ]",
95 "Instant Pking, PvP instance",
96 "Presets, New achievements",
127 Arrays.asList(
"An existing connection was forcibly closed by the remote host",
128 "An established connection was aborted by the software in your host machine"));
131 public static final AttributeKey<Session>
SESSION_KEY = AttributeKey.valueOf(
"session.key");
133 public static final AttributeKey<String> SOURCE_ADDRESS = AttributeKey.valueOf(
"source.address");
141 public static final boolean SUPPORT_HAPROXY;
142 public static final int IP_TOS;
146 public static final boolean LOG_PLAYER;
169 public static final String POSTGRE_URL;
170 public static final String POSTGRE_USER;
171 public static final String POSTGRE_PASS;
173 public static final int FAILED_LOGIN_ATTEMPTS;
174 public static final int FAILED_LOGIN_TIMEOUT;
176 public static final int CLIENT_VERSION;
178 public static boolean highscoresEnabled =
false;
180 public static boolean DOUBLE_EXPERIENCE =
false;
232 public static final int ATTACK_TAB = 0, SKILL_TAB = 1, QUEST_TAB = 2, INVENTORY_TAB = 3, EQUIPMENT_TAB = 4, PRAYER_TAB = 5, MAGIC_TAB = 6, ACTIVITY_TAB = 7, FRIENDS_TAB = 8, IGNORE_TAB = 9, CLAN_TAB = 10, WRENCH_TAB = 11, EMOTE_TAB = 12, MUSIC_TAB = 13, LOGOUT_TAB = 14;
239 public static final Position REGULAR_DONATOR_ZONE =
new Position(2478, 10435, 0);
251 0, 10, 18, 26, 34, 36, 42, 0, 0, 0, 3, 1);
255 "fag",
"f4g",
"faggot",
"nigger",
"fuck",
"bitch",
"whore",
"slut",
256 "gay",
"lesbian",
"scape",
".net",
".org",
"vagina",
"dick",
257 "cock",
"penis",
"hoe",
"soulsplit",
"ikov",
"retard",
"cunt",
258 "g ay",
"ga y",
"g a y",
"h o e",
263 "Our website is located at: http://www.tarnishps.com/",
264 "Feel free to join the (help) clan channel",
265 "Add more security to your account by setting a bank pin.",
266 "Have any ideas on how we could improve our gameplay? Post on forums!",
267 "Voting daily can be very beneficial & it supports the server!",
268 "Found a bug? Let a moderator know or post it on the forums!",
269 "You can do ::commands for a list of commands!",
283 public static final String WEBSITE_URL;
339 public static final int EMAIL_MAX_CHARACTERS = 28;
340 public static final int EMAIL_MIN_CHARACTERS = 7;
341 public static final int USERNAME_MAX_CHARACTERS = 12;
342 public static final int USERNAME_MIN_CHARACTERS = 3;
343 public static final int PASSWORD_MAX_CHARACTERS = 20;
347 final Toml parser =
new Toml().read(
new File(
"./settings.toml"));
349 SERVER_NAME = parser.getString(
"server.server_name");
350 SERVER_PORT = Math.toIntExact(parser.getLong(
"server.server_port"));
351 SERVER_DEBUG = parser.getBoolean(
"server.server_debug");
353 NPC_BITS = Math.toIntExact(parser.getLong(
"game.npc_bits"));
355 LOGIN_THESHOLD = Math.toIntExact(parser.getLong(
"network.login_threshold"));
356 LOGOUT_THESHOLD = Math.toIntExact(parser.getLong(
"network.logout_threshold"));
357 MAX_PLAYERS = Math.toIntExact(parser.getLong(
"game.max_players"));
358 MAX_NPCS = Math.toIntExact(parser.getLong(
"game.max_npcs"));
359 MAX_BOTS = Math.toIntExact(parser.getLong(
"game.max_bots"));
362 WEBSITE_URL = parser.getString(
"website.website_url");
364 FORUM_DB_URL = parser.getString(
"website.forum_db_url");
386 LOG_PLAYER = parser.getBoolean(
"game.log_player");
387 SKULL_TIME = Math.toIntExact(parser.getLong(
"game.skull_time"));
390 CONNECTION_LIMIT = Math.toIntExact(parser.getLong(
"network.connection_limit"));
391 FAILED_LOGIN_ATTEMPTS = Math.toIntExact(parser.getLong(
"network.failed_login_attempts"));
392 FAILED_LOGIN_TIMEOUT = Math.toIntExact(parser.getLong(
"network.failed_login_timeout"));
393 IDLE_TIMEOUT = Math.toIntExact(parser.getLong(
"network.idle_timeout"));
397 RESOURCE_LEAK_DETECTION = ResourceLeakDetector.Level.valueOf(parser.getString(
"network.resource_leak_detection").toUpperCase());
399 RSA_MODULUS =
new BigInteger(parser.getString(
"network.rsa_modulus"));
400 RSA_EXPONENT =
new BigInteger(parser.getString(
"network.rsa_exponent"));
401 SUPPORT_HAPROXY = parser.getBoolean(
"network.support_haproxy");
402 IP_TOS = Integer.parseInt(parser.getString(
"network.ip_tos"), 2);
404 POSTGRE_URL = parser.getString(
"postgre.postgre_url");
405 POSTGRE_USER = parser.getString(
"postgre.postgre_user");
406 POSTGRE_PASS = parser.getString(
"postgre.postgre_pass");
413 String world = parser.getString(
"world.type");
427 CLIENT_VERSION = Math.toIntExact(parser.getLong(
"client.client_version"));
429 highscoresEnabled = parser.getBoolean(
"services.highscores_enabled");
430 }
catch (Exception ex) {
431 ex.printStackTrace();
432 throw new ExceptionInInitializerError(
"Failed to parse config file.");
437 public final static int[]
STARTER_BANK_AMOUNT = { 2, 8, 21, 11, 48, 9, 0, 0, 0, 0, };
438 public final static Item[] STARTER_BANK = {
439 new Item(995, 500000),
new Item(8013, 2500),
new Item(1704, 1000),
new Item(1725, 1000),
new Item(1731, 1000),
440 new Item(2550, 1000),
new Item(7458, 1000),
new Item(7460, 1000),
new Item(7461, 1000),
new Item(3105, 1000),
441 new Item(4587, 1000),
new Item(1305, 1000),
new Item(1377, 1000),
new Item(1434, 1000),
new Item(5698, 1000),
442 new Item(8850, 1000),
new Item(10828, 1000),
new Item(3751, 1000),
new Item(1163, 1000),
new Item(1127, 1000),
443 new Item(1079, 1000),
new Item(1093, 1000),
new Item(1201, 1000),
new Item(4131, 1000),
new Item(1153, 1000),
444 new Item(1115, 1000),
new Item(1067, 1000),
new Item(1081, 1000),
new Item(1191, 1000),
new Item(544, 1000),
445 new Item(542, 1000),
new Item(861, 1000),
new Item(892, 100000),
new Item(9185, 1000),
new Item(9242, 100000),
446 new Item(9243, 100000),
new Item(9244, 100000),
new Item(10499, 1000),
new Item(10498, 1000),
new Item(2497, 1000),
447 new Item(2491, 1000),
new Item(2503, 1000),
new Item(4675, 1000),
new Item(1387, 1000),
new Item(1383, 1000),
448 new Item(1381, 1000),
new Item(556, 100000),
new Item(557, 100000),
new Item(554, 100000),
new Item(555, 100000),
449 new Item(558, 100000),
new Item(559, 100000),
new Item(560, 100000),
new Item(561, 100000),
new Item(562, 100000),
450 new Item(563, 100000),
new Item(564, 100000),
new Item(565, 100000),
new Item(566, 100000),
new Item(9075, 100000),
451 new Item(21880, 100000),
new Item(3841, 1000),
new Item(2414, 1000),
new Item(3843, 1000),
new Item(2413, 1000),
452 new Item(3839, 1000),
new Item(2412, 1000),
new Item(3749, 1000),
new Item(3755, 1000),
new Item(4089, 1000),
453 new Item(4091, 1000),
new Item(4093, 1000),
new Item(4095, 1000),
new Item(4097, 1000),
new Item(4099, 1000),
454 new Item(4101, 1000),
new Item(4103, 1000),
new Item(4105, 1000),
new Item(4107, 1000),
new Item(4109, 1000),
455 new Item(4111, 1000),
new Item(4113, 1000),
new Item(4115, 1000),
new Item(4117, 1000),
new Item(6109, 1000),
456 new Item(6107, 1000),
new Item(6108, 1000),
new Item(6111, 1000),
new Item(6110, 1000),
new Item(6106, 1000),
457 new Item(391, 1000),
new Item(385, 1000),
new Item(3144, 1000),
new Item(2436, 1000),
new Item(2440, 1000),
458 new Item(2442, 1000),
new Item(2444, 1000),
new Item(6685, 1000),
new Item(3024, 1000),
462 public final static int[]
LEET_BANK_AMOUNTS = {7, 46, 19, 42, 41, 15, 21, 4, 0, 0,};
463 public final static Item[] LEET_BANK_ITEMS = {
464 new Item(995, 10000),
new Item(11665, 10000),
new Item(11663, 10000),
new Item(11664, 10000),
new Item(8840, 10000),
465 new Item(8839, 10000),
new Item(8842, 10000),
new Item(4151, 10000),
new Item(11802, 10000),
new Item(11804, 10000),
466 new Item(11806, 10000),
new Item(11808, 10000),
new Item(13652, 10000),
new Item(13576, 10000),
new Item(4587, 10000),
467 new Item(1305, 10000),
new Item(7158, 10000),
new Item(1434, 10000),
new Item(5698, 10000),
new Item(1215, 10000),
468 new Item(11840, 10000),
new Item(6585, 10000),
new Item(12954, 10000),
new Item(11283, 10000),
new Item(10551, 10000),
469 new Item(4153, 10000),
new Item(10828, 10000),
new Item(3751, 10000),
new Item(2550, 10000),
new Item(3105, 10000),
470 new Item(1725, 10000),
new Item(1704, 10000),
new Item(1731, 10000),
new Item(1163, 10000),
new Item(1127, 10000),
471 new Item(1079, 10000),
new Item(1201, 10000),
new Item(7460, 10000),
new Item(4131, 10000),
new Item(11832, 10000),
472 new Item(11834, 10000),
new Item(11836, 10000),
new Item(21015, 10000),
new Item(6570, 10000),
new Item(13239, 10000),
473 new Item(11773, 10000),
new Item(12931, 10000),
new Item(13197, 10000),
new Item(13199, 10000),
new Item(19639, 10000),
474 new Item(19643, 10000),
new Item(19647, 10000),
new Item(11772, 10000),
new Item(861, 10000),
new Item(892, 10000),
475 new Item(9185, 10000),
new Item(9244, 10000),
new Item(868, 10000),
new Item(811, 10000),
new Item(10498, 10000),
476 new Item(10499, 10000),
new Item(3749, 10000),
new Item(2503, 10000),
new Item(2497, 10000),
new Item(2491, 10000),
477 new Item(19481, 10000),
new Item(11785, 10000),
new Item(11826, 10000),
new Item(11828, 10000),
new Item(11830, 10000),
478 new Item(13237, 10000),
new Item(11771, 10000),
new Item(4675, 10000),
new Item(12904, 10000),
new Item(11791, 10000),
479 new Item(11770, 10000),
new Item(13235, 10000),
new Item(3755, 10000),
new Item(1540, 10000),
new Item(6889, 10000),
480 new Item(2412, 10000),
new Item(3840, 10000),
new Item(2413, 10000),
new Item(3844, 10000),
new Item(2414, 10000),
481 new Item(3842, 10000),
new Item(4089, 10000),
new Item(4091, 10000),
new Item(4093, 10000),
new Item(4095, 10000),
482 new Item(4097, 10000),
new Item(4099, 10000),
new Item(4101, 10000),
new Item(4103, 10000),
new Item(4105, 10000),
483 new Item(4107, 10000),
new Item(4109, 10000),
new Item(4111, 10000),
new Item(4113, 10000),
new Item(4115, 10000),
484 new Item(4117, 10000),
new Item(554, 10000),
new Item(555, 10000),
new Item(556, 10000),
new Item(557, 10000),
485 new Item(558, 10000),
new Item(559, 10000),
new Item(560, 10000),
new Item(561, 10000),
new Item(562, 10000),
486 new Item(563, 10000),
new Item(564, 10000),
new Item(565, 10000),
new Item(9075, 10000),
new Item(6685, 10000),
487 new Item(3024, 10000),
new Item(2436, 10000),
new Item(2440, 10000),
new Item(2442, 10000),
new Item(2444, 10000),
488 new Item(3040, 10000),
new Item(2434, 10000),
new Item(2448, 10000),
new Item(6687, 10000),
new Item(3026, 10000),
489 new Item(145, 10000),
new Item(157, 10000),
new Item(163, 10000),
new Item(169, 10000),
new Item(3042, 10000),
490 new Item(139, 10000),
new Item(181, 10000),
new Item(6689, 10000),
new Item(3028, 10000),
new Item(147, 10000),
491 new Item(159, 10000),
new Item(165, 10000),
new Item(171, 10000),
new Item(3044, 10000),
new Item(141, 10000),
492 new Item(183, 10000),
new Item(6691, 10000),
new Item(3030, 10000),
new Item(149, 10000),
new Item(161, 10000),
493 new Item(167, 10000),
new Item(173, 10000),
new Item(3046, 10000),
new Item(143, 10000),
new Item(185, 10000),
494 new Item(12695, 10000),
new Item(3144, 10000),
new Item(391, 10000),
new Item(7060, 10000),
new Item(385, 10000),
495 new Item(4315, 10000),
new Item(4317, 10000),
new Item(4319, 10000),
new Item(4335, 10000),
new Item(4337, 10000),
496 new Item(4339, 10000),
new Item(4355, 10000),
new Item(4357, 10000),
new Item(4359, 10000),
new Item(4375, 10000),
497 new Item(4377, 10000),
new Item(4379, 10000),
new Item(4395, 10000),
new Item(4397, 10000),
new Item(4399, 10000),
498 new Item(4716, 10000),
new Item(4718, 10000),
new Item(4720, 10000),
new Item(4722, 10000),
new Item(4745, 10000),
499 new Item(4747, 10000),
new Item(4749, 10000),
new Item(4751, 10000),
new Item(4732, 10000),
new Item(4734, 10000),
500 new Item(4736, 10000),
new Item(4738, 10000),
new Item(4740, 10000),
new Item(4708, 10000),
new Item(4710, 10000),
501 new Item(4712, 10000),
new Item(4714, 10000),
new Item(4753, 10000),
new Item(4755, 10000),
new Item(4757, 10000),
502 new Item(4759, 10000),
new Item(12829, 10000),
new Item(12821, 10000),
new Item(12817, 10000),
new Item(12825, 10000),
static final int CONNECTION_LIMIT
static final int MAX_NPCS
static final int LOGIN_THESHOLD
static final Position STAFF_ZONE
static final Appearance DEFAULT_APPEARANCE
static final int LOGOUT_THESHOLD
static final double COOKING_MODIFICATION
static final double MINING_MODIFICATION
static final double THIEVING_MODIFICATION
static final double PRAYER_MODIFICATION
static final int NPC_BITS
static final double RUNECRAFTING_MODIFICATION
static final double HUNTER_MODIFICATION
static final int SKULL_TIME
static final double FLETCHING_MODIFICATION
static final ObjectSet< String > IGNORED_EXCEPTIONS
static final double CRAFTING_MODIFICATION
static final ResourceLeakDetector.Level RESOURCE_LEAK_DETECTION
static final int MAX_BOTS
static final double AGILITY_MODIFICATION
static final double FARMING_MODIFICATION
static final double SMITHING_MODIFICATION
static final String FORUM_DB_PASS
static final BigInteger RSA_EXPONENT
static final AttributeKey< Session > SESSION_KEY
static final double HERBLORE_MODIFICATION
static final int SERVER_PORT
static final int[] LEET_BANK_AMOUNTS
static final int NPC_DEFINITION_LIMIT
static final double FIREMAKING_MODIFICATION
static final int ATTACK_TAB
static final boolean PARALLEL_GAME_ENGINE
static final double SLAYER_MODIFICATION
static final String FORUM_DB_URL
static final double WOODCUTTING_MODIFICATION
static final String[] WELCOME_MARQUEE
static final Position SUPER_DONATOR_ZONE
static final int[][] SIDEBAR_INTERFACE
static final int[] STARTER_BANK_AMOUNT
static final String[] MESSAGES
static final int MAX_PLAYERS
static final Position JAIL_ZONE
static final String[] BAD_STRINGS
static final Position DEFAULT_POSITION
static final double COMBAT_MODIFICATION
static final String[] WELCOME_ANNOUNCEMENT
static boolean SERVER_DEBUG
static boolean DISPLAY_PACKETS
static final boolean SERVER_CYCLE_DEBUG
static final int IDLE_TIMEOUT
static final int CLIENT_PACKET_THRESHOLD
static final int ITEM_DEFINITION_LIMIT
static final double MAGIC_MODIFICATION
static final String SERVER_NAME
static final int NPC_WALKING_RADIUS
static final int SERVER_PACKET_THRESHOLD
static final double FISHING_MODIFICATION
static final String LATEST_UPDATE_THREAD
static final String LATEST_ANNOUNCEMENT_THREAD
static final String DISCORD_TOKEN
static final boolean FORUM_INTEGRATION
static final String FORUM_DB_USER
static final int CURRENCY
static final String[] WELCOME_DIALOGUE
static final BigInteger RSA_MODULUS