Added account and character saving on shutdown

This commit is contained in:
Kayne Ruse
2014-05-13 03:25:50 +10:00
parent 68475eee0f
commit c5e8f1b3af
+8 -1
View File
@@ -144,9 +144,16 @@ void ServerApplication::Quit() {
std::cout << "Shutting down" << std::endl;
//save the server state
//TODO: save the existing players
for (auto& it : accountMap) {
SaveUserAccount(it.first);
}
for (auto& it : characterMap) {
SaveCharacter(it.first);
}
//empty the members
accountMap.clear();
characterMap.clear();
regionPager.UnloadAll();
//APIs