Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-07-12 13:22:45 +0000
committerStijn Buys <ingar@osirion.org>2011-07-12 13:22:45 +0000
commitce7186b35372ede9d6a8e3af6e9aff72d632bbe6 (patch)
treebcb6ccdfb5618eba21f63a096b54cc3088501b66 /src/game/base
parentae3127e1f98b74bab9b40ed774d4a520507a325b (diff)
Force saving of player data on dock and launch.
Diffstat (limited to 'src/game/base')
-rw-r--r--src/game/base/game.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index 1342ea0..bdca48a 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -208,7 +208,10 @@ void Game::func_target_dock(core::Player *player, core::Entity *entity)
} else {
player->send("^BDocking at " + entity->name());
}
- }
+ }
+
+ // force save
+ core::server()->module()->player_save(player);
}
}
@@ -799,6 +802,9 @@ void Game::func_launch(core::Player *player, std::string const &args)
}
}
+ // force save, at this point, the ship is still docked
+ core::server()->module()->player_save(player);
+
player->send("^BLaunching from " + ship->dock()->name());
ship->launch();
@@ -1729,7 +1735,7 @@ void Game::player_load(core::Player *player)
return;
}
- con_debug << " player " << player->id() << ": " << "loading data" << std::endl;
+ con_debug << "player " << player->id() << ": " << "loading data" << std::endl;
Ship *ship = 0;
long l;
@@ -1936,7 +1942,7 @@ void Game::player_save(core::Player *player)
}
if (core::server()->mode() == core::GameServer::MultiPlayer) {
- con_debug << " player " << player->id() << ": " << "saving data" << std::endl;
+ con_debug << "player " << player->id() << ": " << "saving data" << std::endl;
std::string guid(player->guid().str());
std::string directory(guid.substr(0,4));