Proper fix for server generating HexID each time it connects to the login.

This commit is contained in:
MobiusDev
2016-12-29 08:22:16 +00:00
parent e344c6a7ad
commit 34e1aa5a90
2 changed files with 19 additions and 6 deletions

View File

@@ -2542,12 +2542,15 @@ public final class Config
final Properties hexSetting = new Properties();
final File file = new File(fileName);
// Create a new empty file only if it doesn't exist
file.createNewFile();
try (OutputStream out = new FileOutputStream(file))
if (!file.exists())
{
hexSetting.setProperty("ServerID", String.valueOf(serverId));
hexSetting.setProperty("HexID", hexId);
hexSetting.store(out, "The HexId to Auth into LoginServer");
try (OutputStream out = new FileOutputStream(file))
{
hexSetting.setProperty("ServerID", String.valueOf(serverId));
hexSetting.setProperty("HexID", hexId);
hexSetting.store(out, "The HexId to Auth into LoginServer");
LOGGER.log(Level.INFO, "Gameserver: Generated new HexID file for server id " + serverId + ".");
}
}
}
catch (Exception e)