mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCEMP-Server.git
synced 2026-05-22 21:05:17 +00:00
Initial commit
This commit is contained in:
22
Commands/SaveAllCommand.cpp
Normal file
22
Commands/SaveAllCommand.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "stdafx.h"
|
||||
#include "SaveAllCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerLevel.h"
|
||||
|
||||
void SaveAllCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
ServerCommand::notifyAdmins(src, server, L"Forcing save..");
|
||||
PlayerList *players = server->getPlayers();
|
||||
if (players)
|
||||
players->saveAll(NULL);
|
||||
for (unsigned int i = 0; i < server->levels.length; i++)
|
||||
{
|
||||
ServerLevel *level = server->levels[i];
|
||||
if (level)
|
||||
level->save(true, NULL);
|
||||
}
|
||||
ServerCommand::notifyAdmins(src, server, L"Save complete.");
|
||||
}
|
||||
Reference in New Issue
Block a user