/**
* Saves all necessary data as preparation for stopping the server.
*/
public void stopServer()
{
if (!this.worldIsBeingDeleted)
{
logger.info("Stopping server");
if (this.getNetworkSystem() != null)
{
this.getNetworkSystem().terminateEndpoints();
}
if (this.serverConfigManager != null)
{
logger.info("Saving players");
this.serverConfigManager.saveAllPlayerData();
this.serverConfigManager.removeAllPlayers();
}
if (this.worldServers != null)
{
logger.info("Saving worlds");
this.saveAllWorlds(false);
for (int i = 0; i < this.worldServers.length; ++i)
{
WorldServer worldserver = this.worldServers[i];
worldserver.flush();
}
}
if (this.usageSnooper.isSnooperRunning())
{
this.usageSnooper.stopSnooper();
}
}
}
MinecraftServer.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:BaseClient
作者:
评论列表
文章目录