com.ruse.world.World.sequence(World.java:173) ; World.java class at line 173.
|
|
Code:Oct 25, 2018 3:23:48 PM com.ruse.GameServer main INFO: Initializing the loader... Set "Necrotic.json" to Read Only. (Anti-corruption) java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Oct 25, 2018 3:24:18 PM com.ruse.GameServer main INFO: The loader has finished loading utility tasks. Oct 25, 2018 3:24:18 PM com.ruse.GameServer main INFO: Necrotic is now online on port 43594! Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only. java.lang.Error: Unresolved compilation problems: FightPit cannot be resolved PestControl cannot be resolved at com.ruse.world.World.sequence(World.java:173) at com.ruse.engine.GameEngine.run(GameEngine.java:48) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Skipped writing Necrotic.json file because it's read only.
Anyone know how to resolve minigames? there are errors in the code. base is Necrotic, RUSE.
Code:FightPit cannot be resolved PestControl cannot be resolved




com.ruse.world.World.sequence(World.java:173) ; World.java class at line 173.
It's the Nectoric release, could you take an look at it and send me an updated copy, I looked at the world.java and its just giving minigame errors, the code looks fine.




says 173 is fine now, but ive over 900 errors and says this, now ive changed it to 1.8 and still got all the errors.
heres world.java lines 130-133Code:Oct 25, 2018 9:29:25 PM com.ruse.GameServer main INFO: Initializing the loader... Exception in thread "main" java.lang.Error: Unresolved compilation problems: Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above Lambda expressions are allowed only at source level 1.8 or above at com.ruse.GameLoader.executeServiceLoad(GameLoader.java:75) at com.ruse.GameLoader.init(GameLoader.java:56) at com.ruse.GameServer.main(GameServer.java:25) Oct 25, 2018 9:29:25 PM com.ruse.util.ShutdownHook run INFO: The shutdown hook is processing all required actions... Exception in thread "Thread-1" java.lang.Error: Unresolved compilation problem: Lambda expressions are allowed only at source level 1.8 or above at com.ruse.world.World.savePlayers(World.java:131) at com.ruse.util.ShutdownHook.run(ShutdownHook.java:23)
heres my full world.javaCode:public static void savePlayers() { players.forEach(p -> p.save()); //players.forEach(p -> new Thread(new HighscoresHandler(p)).start()); }
/closed I fixed itCode:package com.ruse.world; import java.util.Iterator; import java.util.Optional; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Phaser; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.ruse.GameSettings; import com.ruse.model.MessageType; import com.ruse.model.PlayerRights; import com.ruse.util.Misc; import com.ruse.webhooks.discord.DiscordMessager; import com.ruse.world.content.PlayerLogs; import com.ruse.world.content.Wildywyrm; import com.ruse.world.content.minigames.impl.FightPit; import com.ruse.world.content.minigames.impl.PestControl; import com.ruse.world.content.randomevents.EvilTree; import com.ruse.world.content.randomevents.ShootingStar; import com.ruse.world.entity.Entity; import com.ruse.world.entity.EntityHandler; import com.ruse.world.entity.impl.CharacterList; import com.ruse.world.entity.impl.GlobalItemSpawner; import com.ruse.world.entity.impl.npc.NPC; import com.ruse.world.entity.impl.player.Player; import com.ruse.world.entity.impl.player.PlayerHandler; import com.ruse.world.entity.updating.NpcUpdateSequence; import com.ruse.world.entity.updating.PlayerUpdateSequence; import com.ruse.world.entity.updating.UpdateSequence; /** * @author Gabriel Hannason * Thanks to lare96 for help with parallel updating system */ public class World { /** All of the registered players. */ private static CharacterList<Player> players = new CharacterList<>(GameSettings.playerCharacterListCapacity); /** All of the registered NPCs. */ private static CharacterList<NPC> npcs = new CharacterList<>(GameSettings.npcCharacterListCapacity); /** Used to block the game thread until updating has completed. */ private static Phaser synchronizer = new Phaser(1); /** A thread pool that will update players in parallel. */ private static ExecutorService updateExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), new ThreadFactoryBuilder().setNameFormat("UpdateThread").setPriority(Thread.MAX_PRIORITY).build()); /** The queue of {@link Player}s waiting to be logged in. **/ private static Queue<Player> logins = new ConcurrentLinkedQueue<>(); /**The queue of {@link Player}s waiting to be logged out. **/ private static Queue<Player> logouts = new ConcurrentLinkedQueue<>(); /**The queue of {@link Player}s waiting to be given their vote reward. **/ private static Queue<Player> voteRewards = new ConcurrentLinkedQueue<>(); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public static void register(Entity entity) { EntityHandler.register(entity); } public static void deregister(Entity entity) { EntityHandler.deregister(entity); } public static Player getPlayerByName(String username) { Optional<Player> op = players.search(p -> p != null && p.getUsername().equals(Misc.formatText(username))); return op.isPresent() ? op.get() : null; } public static Player getPlayerByLong(long encodedName) { Optional<Player> op = players.search(p -> p != null && p.getLongUsername().equals(encodedName)); return op.isPresent() ? op.get() : null; } public static void sendMessage(String message) { if (message.contains("[Yell]")) { DiscordMessager.sendYellMessage(message); /*} else if (message.contains("logged in for the first time")) { DiscordMessager.sendStaffMessage(message);*/ } else if (message.contains("10 more players have just voted")){ DiscordMessager.sendInGameMessage("10 more players have just voted."); } else { DiscordMessager.sendInGameMessage(message); } players.forEach(p -> p.getPacketSender().sendMessage(message)); } public static void sendMessage(MessageType type, String message) { players.forEach(p -> p.getPacketSender().sendMessage(type, message)); if (message.contains("[Yell]")) { DiscordMessager.sendYellMessage(message); } else if (message.contains("logged in for the first time")) { DiscordMessager.sendStaffMessage(message); } else { DiscordMessager.sendInGameMessage(message); } } public static void sendFilteredMessage(String message) { players.stream().filter(p -> p != null && (p.toggledGlobalMessages() == false)).forEach(p -> p.getPacketSender().sendMessage(message)); } public static void sendStaffMessage(String message) { players.stream().filter(p -> p != null && (p.getRights().isStaff())).forEach(p -> p.getPacketSender().sendMessage(message)); // == PlayerRights.OWNER || p.getRights() == PlayerRights.DEVELOPER || p.getRights() == PlayerRights.ADMINISTRATOR || p.getRights() == PlayerRights.MODERATOR || p.getRights() == PlayerRights.SUPPORT)).forEach(p -> p.getPacketSender().sendMessage(message)); DiscordMessager.sendStaffMessage(message); } public static void sendOwnerDevMessage(String message) { players.stream().filter(p -> p != null && (p.getRights() == PlayerRights.OWNER || p.getRights() == PlayerRights.DEVELOPER)).forEach(p -> p.getPacketSender().sendMessage(message)); DiscordMessager.sendDebugMessage("[Owner/Developer]\n"+message); } public static void sendGlobalGroundItems() { players.stream().filter(p -> p != null).forEach(p -> GlobalItemSpawner.spawnGlobalGroundItems(p)); //p.getPacketSender().createGroundItem(952, new Position(3571, 3312), 1)); } public static void updateServerTime() { //players.forEach(p -> p.getPacketSender().sendString(39161, "@[email protected] time: @[email protected][ @[email protected]"+Misc.getCurrentServerTime()+"@[email protected] ]")); } public static void updatePlayersOnline() { players.forEach(p -> p.getPacketSender().sendString(39160, "@[email protected] online: @[email protected][ @[email protected]"+(int)(players.size())+"@[email protected] ]")); players.forEach(p -> p.getPacketSender().sendString(57003, "Players: @[email protected]"+(int)(World.getPlayers().size()))); } public static void savePlayers() { players.forEach(p -> p.save()); //players.forEach(p -> new Thread(new HighscoresHandler(p)).start()); } public static CharacterList<Player> getPlayers() { return players; } public static CharacterList<NPC> getNpcs() { return npcs; } public static void sequence() { // Handle queued logins. for (int amount = 0; amount < GameSettings.LOGIN_THRESHOLD; amount++) { Player player = logins.poll(); if (player == null) break; if (World.getPlayerByName(player.getUsername()) != null) { System.out.println("STOPPED MULTI LOG by "+player.getUsername()); PlayerLogs.log(player.getUsername(), "Had a multilog attempt."); break; } PlayerHandler.handleLogin(player); } // Handle queued logouts. int amount = 0; Iterator<Player> $it = logouts.iterator(); while ($it.hasNext()) { Player player = $it.next(); if (player == null || amount >= GameSettings.LOGOUT_THRESHOLD) break; if (PlayerHandler.handleLogout(player, false)) { $it.remove(); amount++; } } // Handle queued vote rewards FightPit.sequence(); PestControl.sequence(); ShootingStar.sequence(); EvilTree.sequence(); Wildywyrm.initialize(); // First we construct the update sequences. UpdateSequence<Player> playerUpdate = new PlayerUpdateSequence(synchronizer, updateExecutor); UpdateSequence<NPC> npcUpdate = new NpcUpdateSequence(); // Then we execute pre-updating code. players.forEach(playerUpdate::executePreUpdate); npcs.forEach(npcUpdate::executePreUpdate); // Then we execute parallelized updating code. synchronizer.bulkRegister(players.size()); players.forEach(playerUpdate::executeUpdate); synchronizer.arriveAndAwaitAdvance(); // Then we execute post-updating code. players.forEach(playerUpdate::executePostUpdate); npcs.forEach(npcUpdate::executePostUpdate); } public static Queue<Player> getLoginQueue() { return logins; } public static Queue<Player> getLogoutQueue() { return logouts; } public static Queue<Player> getVoteRewardingQueue() { return voteRewards; } }![]()
| « [Request] Anyone have an Clean PI Loading 634+ Data? | [IDEA] Community Led Project - Open Source OSRS Project » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |