3import com.moandjiezana.toml.Toml;
4import com.runehive.game.world.WorldType;
5import com.runehive.game.world.entity.mob.player.appearance.Appearance;
6import com.runehive.game.world.entity.mob.player.appearance.Gender;
7import com.runehive.game.world.items.Item;
8import com.runehive.game.world.position.Position;
9import com.runehive.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;
34 "There are currently #players players online!",
55 "- GPT4o Wise Old Man in Arceuus. Interact with him!",
56 "- Tile Destination Hint Arrows."
86 Arrays.asList(
"An existing connection was forcibly closed by the remote host",
87 "An established connection was aborted by the software in your host machine"));
90 public static final AttributeKey<Session>
SESSION_KEY = AttributeKey.valueOf(
"session.key");
92 public static final AttributeKey<String>
SOURCE_ADDRESS = AttributeKey.valueOf(
"source.address");
194 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;
213 0, 10, 18, 26, 34, 36, 42, 0, 0, 0, 3, 1);
217 "fag",
"f4g",
"faggot",
"nigger",
"fuck",
"bitch",
"whore",
"slut",
218 "gay",
"lesbian",
"scape",
".net",
".org",
"vagina",
"dick",
219 "cock",
"penis",
"hoe",
"soulsplit",
"ikov",
"retard",
"cunt",
220 "g ay",
"ga y",
"g a y",
"h o e",
305 final Toml parser =
new Toml().read(
new File(
"./settings.toml"));
307 SERVER_NAME = parser.getString(
"server.server_name");
308 SERVER_PORT = Math.toIntExact(parser.getLong(
"server.server_port"));
309 SERVER_DEBUG = parser.getBoolean(
"server.server_debug");
311 NPC_BITS = Math.toIntExact(parser.getLong(
"game.npc_bits"));
313 LOGIN_THESHOLD = Math.toIntExact(parser.getLong(
"network.login_threshold"));
314 LOGOUT_THESHOLD = Math.toIntExact(parser.getLong(
"network.logout_threshold"));
315 MAX_PLAYERS = Math.toIntExact(parser.getLong(
"game.max_players"));
316 MAX_NPCS = Math.toIntExact(parser.getLong(
"game.max_npcs"));
317 MAX_BOTS = Math.toIntExact(parser.getLong(
"game.max_bots"));
320 WEBSITE_URL = parser.getString(
"website.website_url");
322 FORUM_DB_URL = parser.getString(
"website.forum_db_url");
344 LOG_PLAYER = parser.getBoolean(
"game.log_player");
345 SKULL_TIME = Math.toIntExact(parser.getLong(
"game.skull_time"));
348 CONNECTION_LIMIT = Math.toIntExact(parser.getLong(
"network.connection_limit"));
351 IDLE_TIMEOUT = Math.toIntExact(parser.getLong(
"network.idle_timeout"));
355 RESOURCE_LEAK_DETECTION = ResourceLeakDetector.Level.valueOf(parser.getString(
"network.resource_leak_detection").toUpperCase());
357 RSA_MODULUS =
new BigInteger(parser.getString(
"network.rsa_modulus"));
358 RSA_EXPONENT =
new BigInteger(parser.getString(
"network.rsa_exponent"));
360 IP_TOS = Integer.parseInt(parser.getString(
"network.ip_tos"), 2);
362 POSTGRE_URL = parser.getString(
"postgre.postgre_url");
363 POSTGRE_USER = parser.getString(
"postgre.postgre_user");
364 POSTGRE_PASS = parser.getString(
"postgre.postgre_pass");
371 String world = parser.getString(
"world.type");
385 CLIENT_VERSION = Math.toIntExact(parser.getLong(
"client.client_version"));
388 }
catch (Exception ex) {
389 ex.printStackTrace();
390 throw new ExceptionInInitializerError(
"Failed to parse config file.");
395 public final static int[]
STARTER_BANK_AMOUNT = { 2, 8, 21, 11, 48, 9, 0, 0, 0, 0, };
397 new Item(995, 500000),
new Item(8013, 2500),
new Item(1704, 1000),
new Item(1725, 1000),
new Item(1731, 1000),
398 new Item(2550, 1000),
new Item(7458, 1000),
new Item(7460, 1000),
new Item(7461, 1000),
new Item(3105, 1000),
399 new Item(4587, 1000),
new Item(1305, 1000),
new Item(1377, 1000),
new Item(1434, 1000),
new Item(5698, 1000),
400 new Item(8850, 1000),
new Item(10828, 1000),
new Item(3751, 1000),
new Item(1163, 1000),
new Item(1127, 1000),
401 new Item(1079, 1000),
new Item(1093, 1000),
new Item(1201, 1000),
new Item(4131, 1000),
new Item(1153, 1000),
402 new Item(1115, 1000),
new Item(1067, 1000),
new Item(1081, 1000),
new Item(1191, 1000),
new Item(544, 1000),
403 new Item(542, 1000),
new Item(861, 1000),
new Item(892, 100000),
new Item(9185, 1000),
new Item(9242, 100000),
404 new Item(9243, 100000),
new Item(9244, 100000),
new Item(10499, 1000),
new Item(10498, 1000),
new Item(2497, 1000),
405 new Item(2491, 1000),
new Item(2503, 1000),
new Item(4675, 1000),
new Item(1387, 1000),
new Item(1383, 1000),
406 new Item(1381, 1000),
new Item(556, 100000),
new Item(557, 100000),
new Item(554, 100000),
new Item(555, 100000),
407 new Item(558, 100000),
new Item(559, 100000),
new Item(560, 100000),
new Item(561, 100000),
new Item(562, 100000),
408 new Item(563, 100000),
new Item(564, 100000),
new Item(565, 100000),
new Item(566, 100000),
new Item(9075, 100000),
409 new Item(21880, 100000),
new Item(3841, 1000),
new Item(2414, 1000),
new Item(3843, 1000),
new Item(2413, 1000),
410 new Item(3839, 1000),
new Item(2412, 1000),
new Item(3749, 1000),
new Item(3755, 1000),
new Item(4089, 1000),
411 new Item(4091, 1000),
new Item(4093, 1000),
new Item(4095, 1000),
new Item(4097, 1000),
new Item(4099, 1000),
412 new Item(4101, 1000),
new Item(4103, 1000),
new Item(4105, 1000),
new Item(4107, 1000),
new Item(4109, 1000),
413 new Item(4111, 1000),
new Item(4113, 1000),
new Item(4115, 1000),
new Item(4117, 1000),
new Item(6109, 1000),
414 new Item(6107, 1000),
new Item(6108, 1000),
new Item(6111, 1000),
new Item(6110, 1000),
new Item(6106, 1000),
415 new Item(391, 1000),
new Item(385, 1000),
new Item(3144, 1000),
new Item(2436, 1000),
new Item(2440, 1000),
416 new Item(2442, 1000),
new Item(2444, 1000),
new Item(6685, 1000),
new Item(3024, 1000),
420 public final static int[]
LEET_BANK_AMOUNTS = {7, 46, 19, 42, 41, 15, 21, 4, 0, 0,};
422 new Item(995, 10000),
new Item(11665, 10000),
new Item(11663, 10000),
new Item(11664, 10000),
new Item(8840, 10000),
423 new Item(8839, 10000),
new Item(8842, 10000),
new Item(4151, 10000),
new Item(11802, 10000),
new Item(11804, 10000),
424 new Item(11806, 10000),
new Item(11808, 10000),
new Item(13652, 10000),
new Item(13576, 10000),
new Item(4587, 10000),
425 new Item(1305, 10000),
new Item(7158, 10000),
new Item(1434, 10000),
new Item(5698, 10000),
new Item(1215, 10000),
426 new Item(11840, 10000),
new Item(6585, 10000),
new Item(12954, 10000),
new Item(11283, 10000),
new Item(10551, 10000),
427 new Item(4153, 10000),
new Item(10828, 10000),
new Item(3751, 10000),
new Item(2550, 10000),
new Item(3105, 10000),
428 new Item(1725, 10000),
new Item(1704, 10000),
new Item(1731, 10000),
new Item(1163, 10000),
new Item(1127, 10000),
429 new Item(1079, 10000),
new Item(1201, 10000),
new Item(7460, 10000),
new Item(4131, 10000),
new Item(11832, 10000),
430 new Item(11834, 10000),
new Item(11836, 10000),
new Item(21015, 10000),
new Item(6570, 10000),
new Item(13239, 10000),
431 new Item(11773, 10000),
new Item(12931, 10000),
new Item(13197, 10000),
new Item(13199, 10000),
new Item(19639, 10000),
432 new Item(19643, 10000),
new Item(19647, 10000),
new Item(11772, 10000),
new Item(861, 10000),
new Item(892, 10000),
433 new Item(9185, 10000),
new Item(9244, 10000),
new Item(868, 10000),
new Item(811, 10000),
new Item(10498, 10000),
434 new Item(10499, 10000),
new Item(3749, 10000),
new Item(2503, 10000),
new Item(2497, 10000),
new Item(2491, 10000),
435 new Item(19481, 10000),
new Item(11785, 10000),
new Item(11826, 10000),
new Item(11828, 10000),
new Item(11830, 10000),
436 new Item(13237, 10000),
new Item(11771, 10000),
new Item(4675, 10000),
new Item(12904, 10000),
new Item(11791, 10000),
437 new Item(11770, 10000),
new Item(13235, 10000),
new Item(3755, 10000),
new Item(1540, 10000),
new Item(6889, 10000),
438 new Item(2412, 10000),
new Item(3840, 10000),
new Item(2413, 10000),
new Item(3844, 10000),
new Item(2414, 10000),
439 new Item(3842, 10000),
new Item(4089, 10000),
new Item(4091, 10000),
new Item(4093, 10000),
new Item(4095, 10000),
440 new Item(4097, 10000),
new Item(4099, 10000),
new Item(4101, 10000),
new Item(4103, 10000),
new Item(4105, 10000),
441 new Item(4107, 10000),
new Item(4109, 10000),
new Item(4111, 10000),
new Item(4113, 10000),
new Item(4115, 10000),
442 new Item(4117, 10000),
new Item(554, 10000),
new Item(555, 10000),
new Item(556, 10000),
new Item(557, 10000),
443 new Item(558, 10000),
new Item(559, 10000),
new Item(560, 10000),
new Item(561, 10000),
new Item(562, 10000),
444 new Item(563, 10000),
new Item(564, 10000),
new Item(565, 10000),
new Item(9075, 10000),
new Item(6685, 10000),
445 new Item(3024, 10000),
new Item(2436, 10000),
new Item(2440, 10000),
new Item(2442, 10000),
new Item(2444, 10000),
446 new Item(3040, 10000),
new Item(2434, 10000),
new Item(2448, 10000),
new Item(6687, 10000),
new Item(3026, 10000),
447 new Item(145, 10000),
new Item(157, 10000),
new Item(163, 10000),
new Item(169, 10000),
new Item(3042, 10000),
448 new Item(139, 10000),
new Item(181, 10000),
new Item(6689, 10000),
new Item(3028, 10000),
new Item(147, 10000),
449 new Item(159, 10000),
new Item(165, 10000),
new Item(171, 10000),
new Item(3044, 10000),
new Item(141, 10000),
450 new Item(183, 10000),
new Item(6691, 10000),
new Item(3030, 10000),
new Item(149, 10000),
new Item(161, 10000),
451 new Item(167, 10000),
new Item(173, 10000),
new Item(3046, 10000),
new Item(143, 10000),
new Item(185, 10000),
452 new Item(12695, 10000),
new Item(3144, 10000),
new Item(391, 10000),
new Item(7060, 10000),
new Item(385, 10000),
453 new Item(4315, 10000),
new Item(4317, 10000),
new Item(4319, 10000),
new Item(4335, 10000),
new Item(4337, 10000),
454 new Item(4339, 10000),
new Item(4355, 10000),
new Item(4357, 10000),
new Item(4359, 10000),
new Item(4375, 10000),
455 new Item(4377, 10000),
new Item(4379, 10000),
new Item(4395, 10000),
new Item(4397, 10000),
new Item(4399, 10000),
456 new Item(4716, 10000),
new Item(4718, 10000),
new Item(4720, 10000),
new Item(4722, 10000),
new Item(4745, 10000),
457 new Item(4747, 10000),
new Item(4749, 10000),
new Item(4751, 10000),
new Item(4732, 10000),
new Item(4734, 10000),
458 new Item(4736, 10000),
new Item(4738, 10000),
new Item(4740, 10000),
new Item(4708, 10000),
new Item(4710, 10000),
459 new Item(4712, 10000),
new Item(4714, 10000),
new Item(4753, 10000),
new Item(4755, 10000),
new Item(4757, 10000),
460 new Item(4759, 10000),
new Item(12829, 10000),
new Item(12821, 10000),
new Item(12817, 10000),
new Item(12825, 10000),
The class that contains setting-related constants for the server.
static final double HERBLORE_MODIFICATION
The experience modification for herblore.
static final double MINING_MODIFICATION
The experience modification for mining.
static final int WRENCH_TAB
static final Appearance DEFAULT_APPEARANCE
The default appearance of a player.
static final int MAGIC_TAB
static final Position DEFAULT_POSITION
The default, i.e.
static final int QUEST_TAB
static final String FORUM_DB_PASS
This is used for mySQL to authenticate username and passwords from the forum.
static final String[] WELCOME_ANNOUNCEMENT
The welcome announcement.
static final int FRIENDS_TAB
static final int ATTACK_TAB
All the tab identifications.
static final String FORUM_DB_URL
This is used for mySQL to authenticate username and passwords from the forum.
static final double FLETCHING_MODIFICATION
The experience modification for fletching.
static final int EMOTE_TAB
static final int MUSIC_TAB
static final int LOGIN_THESHOLD
The amount of players that can be logged in, in a single cycle.
static final Position GAMBLING_ZONE
static final int SKULL_TIME
The time in ticks a player remains skulled for.
static final double THIEVING_MODIFICATION
The experience modification for thieving.
static boolean DISABLE_BROADCASTS
Flag to disable all broadcast messages (TriviaBot, killstreaks, pets, etc.)
static final double WOODCUTTING_MODIFICATION
The experience modification for woodcutting.
static final boolean FORUM_INTEGRATION
If forum integration is true, users can only login if they enter the same username and password that'...
static final boolean PARALLEL_GAME_ENGINE
This will use the parallel game game.
static final int CLIENT_PACKET_THRESHOLD
The amount of client (incoming) packets that can be handled by the server each tick.
static final int NPC_WALKING_RADIUS
The walking radius for Npc.
static final double COOKING_MODIFICATION
The experience modification for cooking.
static final boolean SERVER_CYCLE_DEBUG
Displays the time in milliseconds each tick the game takes to run through a game cycle.
static final int CLIENT_VERSION
static final Position REGULAR_DONATOR_ZONE
static final int CURRENCY
The currency identification of the server.
static final String[] WELCOME_MARQUEE
The welcome marquee.
static final int ACTIVITY_TAB
static boolean DOUBLE_EXPERIENCE
static final int USERNAME_MIN_CHARACTERS
static final boolean LOG_PLAYER
static final int SERVER_PORT
The server port.
static final boolean SUPPORT_HAPROXY
static final int[][] SIDEBAR_INTERFACE
Holds the array of all the side-bar identification and their corresponding itemcontainer identificati...
static final int PASSWORD_MAX_CHARACTERS
static final String POSTGRE_URL
static final String LATEST_UPDATE_THREAD
The latest update thread link.
static final Position STAFF_ZONE
The staff zone.
static final int USERNAME_MAX_CHARACTERS
static final int CLAN_TAB
static final int CONNECTION_LIMIT
The maximum amount of connections that can be active at a time, or in other words how many clients ca...
static final String FORUM_DB_USER
This is used for mySQL to authenticate username and passwords from the forum.
static final int PRAYER_TAB
static final double MAGIC_MODIFICATION
The experience modification for magic.
static final int EQUIPMENT_TAB
static final Item[] LEET_BANK_ITEMS
static final double COMBAT_MODIFICATION
The experience modification for combat.
static final double FARMING_MODIFICATION
The experience modification for farming.
static final String WEBSITE_URL
static final ObjectSet< String > IGNORED_EXCEPTIONS
The list of exceptions that are ignored and discarded by the.
static final int MAX_NPCS
The maximum amount of npcs that can be held within the game world.
static final String[] BAD_STRINGS
Strings that are classified as bad.
static final String DISCORD_TOKEN
The OS Royale community discord token.
static final int FAILED_LOGIN_ATTEMPTS
static final int[] STARTER_BANK_AMOUNT
Starter bank.
static final String POSTGRE_USER
static final BigInteger RSA_MODULUS
The RSA modulus.
static final int NPC_BITS
The npc bits for the server which can execute 6755 npcs.
static final int INVENTORY_TAB
static final double SLAYER_MODIFICATION
The experience modification for Slayer.
static final int FAILED_LOGIN_TIMEOUT
static final BigInteger RSA_EXPONENT
The RSA exponent.
static final int EMAIL_MAX_CHARACTERS
static final Item[] STARTER_BANK
static final AttributeKey< String > SOURCE_ADDRESS
static final String LATEST_ANNOUNCEMENT_THREAD
The latest announcement thread link.
static final double SMITHING_MODIFICATION
The experience modification for smithing.
static final double FISHING_MODIFICATION
The experience modification for fishing.
static final String SERVER_NAME
The name of the server.
static boolean DISPLAY_PACKETS
Displays packet information in the output stream.
static final Position JAIL_ZONE
The Jail zone.
static final double AGILITY_MODIFICATION
The experience modification for agility.
static final int LOGOUT_THESHOLD
The amount of players that can logout in a single cycle.
static final ResourceLeakDetector.Level RESOURCE_LEAK_DETECTION
The resource leak detection level, should be PARANOID in a development environment and DISABLED in a ...
static final int IDLE_TIMEOUT
The number of seconds before a connection becomes idle.
static final AttributeKey< Session > SESSION_KEY
The session key.
static final int SERVER_PACKET_THRESHOLD
The amount of server (outgoing) packets that can be written by the server each tick.
static final double CRAFTING_MODIFICATION
The experience modification for crafting.
static final String[] WELCOME_UPDATE
static final int[] LEET_BANK_AMOUNTS
TEMP VARS - WILL BE DELETED AFTER BETA IS FINISHED.
static final double HUNTER_MODIFICATION
The experience modification for hunter.
static final int LOGOUT_TAB
static final int IGNORE_TAB
static WorldType WORLD_TYPE
static final int ITEM_DEFINITION_LIMIT
The limit of the item identification.
static boolean SERVER_DEBUG
The development state flag.
static boolean highscoresEnabled
static final int MAX_BOTS
The amount of bots that will spawn into the game world.
static final int MAX_PLAYERS
The maximum amount of players that can be held within the game world.
static final String[] WELCOME_DIALOGUE
The welcome dialogue.
static final int SKILL_TAB
static final double PRAYER_MODIFICATION
The experience modification for prayer.
static final String[] MESSAGES
Messages that are sent periodically to all players.
static final int NPC_DEFINITION_LIMIT
The limit of the npc identification.
static final Position SUPER_DONATOR_ZONE
The donator zone.
static final double FIREMAKING_MODIFICATION
The experience modification for firemaking.
static final int EMAIL_MIN_CHARACTERS
static final String POSTGRE_PASS
static final double RUNECRAFTING_MODIFICATION
The experience modification for runecrafting.
Represents a Players appearance.
The container class that represents an item that can be interacted with.
Represents a single tile on the game world.
The OS Royale world types.
LOCAL
Local host world used for developers.
TEST
The world used for testing purposes by a team.
Represents a gender for a player character.