ERROR:
Code:
INFO: Initializing the loader...
java.io.EOFException
at java.io.DataInputStream.readUnsignedShort(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at com.world.content.clan.ClanChatManager.init(ClanChatManager.java:57)
at com.GameLoader.lambda$10(GameLoader.java:86)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Clanchatmanager
Code:
public static void init() {
try {
for (File file : (new File(FILE_DIRECTORY)).listFiles()) {
if(!file.exists())
continue;
DataInputStream input = new DataInputStream(new FileInputStream(file));
String name = input.readUTF();
String owner = input.readUTF();
int index = input.readShort();
ClanChat clan = new ClanChat(owner, name, index);
clan.setRankRequirements(ClanChat.RANK_REQUIRED_TO_ENTER, ClanChatRank.forId(input.read()));
clan.setRankRequirements(ClanChat.RANK_REQUIRED_TO_KICK, ClanChatRank.forId(input.read()));
clan.setRankRequirements(ClanChat.RANK_REQUIRED_TO_TALK, ClanChatRank.forId(input.read()));
clans[index] = clan;
input.close();
}
} catch (IOException exception) {
exception.printStackTrace();
}
}
GameLoader
Code:
private void executeServiceLoad() {
if (GameSettings.MYSQL_ENABLED) {
serviceLoader.execute(() -> MySQLController.init());
}
serviceLoader.execute(() -> ConnectionHandler.init());
serviceLoader.execute(() -> PlayerPunishment.init());
serviceLoader.execute(() -> RegionClipping.init());
serviceLoader.execute(() -> CustomObjects.init());
serviceLoader.execute(() -> ItemDefinition.init());
serviceLoader.execute(() -> Lottery.init());
serviceLoader.execute(() -> GrandExchangeOffers.init());
serviceLoader.execute(() -> Scoreboards.init());
serviceLoader.execute(() -> WellOfGoodwill.init());
serviceLoader.execute(() -> ClanChatManager.init());
serviceLoader.execute(() -> CombatPoisonData.init());
serviceLoader.execute(() -> CombatStrategies.init());
serviceLoader.execute(() -> NpcDefinition.parseNpcs().load());
serviceLoader.execute(() -> NPCDrops.parseDrops().load());
serviceLoader.execute(() -> WeaponInterfaces.parseInterfaces().load());
serviceLoader.execute(() -> ShopManager.parseShops().load());
serviceLoader.execute(() -> DialogueManager.parseDialogues().load());
serviceLoader.execute(() -> NPC.init());
}
Update: Well, if anyone has something similar error. I found out it was an error with file saving clanchat on created clan.