Proper total geodata file size information.

This commit is contained in:
MobiusDevelopment
2019-04-05 06:00:11 +00:00
parent 67cc5e1e45
commit c1d471dca8
25 changed files with 195 additions and 201 deletions

View File

@@ -301,13 +301,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -444,7 +438,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -309,13 +309,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -452,7 +446,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -309,13 +309,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -452,7 +446,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -308,13 +308,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -452,7 +446,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -312,13 +312,7 @@ public class GameServer
ClanShopData.getInstance(); ClanShopData.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -456,7 +450,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -312,13 +312,7 @@ public class GameServer
ClanShopData.getInstance(); ClanShopData.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -456,7 +450,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -312,13 +312,7 @@ public class GameServer
ClanShopData.getInstance(); ClanShopData.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -456,7 +450,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -51,15 +51,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -78,6 +69,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -89,6 +81,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -100,6 +93,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -926,6 +923,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -285,13 +285,7 @@ public class GameServer
ClanHallAuctionManager.getInstance(); ClanHallAuctionManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
DoorData.getInstance(); DoorData.getInstance();
@@ -454,7 +448,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -51,15 +51,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -78,6 +69,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -89,6 +81,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -100,6 +93,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -926,6 +923,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -304,13 +304,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -445,7 +439,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -304,13 +304,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -445,7 +439,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -304,13 +304,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -445,7 +439,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();

View File

@@ -304,13 +304,7 @@ public class GameServer
ClanEntryManager.getInstance(); ClanEntryManager.getInstance();
printSection("Geodata"); printSection("Geodata");
long geodataMemory = getUsedMemoryMB();
GeoEngine.getInstance(); GeoEngine.getInstance();
geodataMemory = getUsedMemoryMB() - geodataMemory;
if (geodataMemory < 0)
{
geodataMemory = 0;
}
printSection("NPCs"); printSection("NPCs");
NpcData.getInstance(); NpcData.getInstance();
@@ -445,7 +439,6 @@ public class GameServer
System.gc(); System.gc();
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576; final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory."); LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Geodata use " + geodataMemory + " MB of memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + "."); LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds."); LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");

View File

@@ -53,15 +53,6 @@ public class GeoEngine
private final ABlock[][] _blocks; private final ABlock[][] _blocks;
private final BlockNull _nullBlock; private final BlockNull _nullBlock;
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
/** /**
* GeoEngine constructor. Loads all geodata files of chosen geodata format. * GeoEngine constructor. Loads all geodata files of chosen geodata format.
*/ */
@@ -80,6 +71,7 @@ public class GeoEngine
// load geo files according to geoengine config setup // load geo files according to geoengine config setup
int loaded = 0; int loaded = 0;
long _fileSize = 0;
for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++) for (int rx = World.TILE_X_MIN; rx <= World.TILE_X_MAX; rx++)
{ {
for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++) for (int ry = World.TILE_Y_MIN; ry <= World.TILE_Y_MAX; ry++)
@@ -91,6 +83,7 @@ public class GeoEngine
if (loadGeoBlocks(rx, ry)) if (loadGeoBlocks(rx, ry))
{ {
loaded++; loaded++;
_fileSize += f.length();
} }
} }
else else
@@ -102,6 +95,10 @@ public class GeoEngine
} }
LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files."); LOGGER.info("GeoEngine: Loaded " + loaded + " geodata files.");
if (loaded > 0)
{
LOGGER.info("GeoEngine: Total geodata file size " + (_fileSize / 1024 / 1024) + " MB.");
}
// avoid wrong configs when no files are loaded // avoid wrong configs when no files are loaded
if (loaded == 0) if (loaded == 0)
@@ -940,6 +937,15 @@ public class GeoEngine
return null; return null;
} }
/**
* Returns the instance of the {@link GeoEngine}.
* @return {@link GeoEngine} : The instance.
*/
public static GeoEngine getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder private static class SingletonHolder
{ {
protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine(); protected static final GeoEngine _instance = Config.PATHFINDING ? new GeoEnginePathfinding() : new GeoEngine();