MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / saveGame

Method saveGame

source/modes/GameMode.cpp:1341–1360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339}
1340
1341bool GameMode::saveGame(const CEGUI::EventArgs& /*e*/)
1342{
1343 // We can save if launching in server mode only
1344 if(!ODServer::getSingleton().isConnected())
1345 {
1346 std::string msg = "You cannot save the game when not launching in server mode";
1347 EventMessage* event = new EventMessage(msg, EventShortNoticeType::genericGameInfo);
1348 receiveEventShortNotice(event);
1349 return true;
1350 }
1351
1352 if(ODClient::getSingleton().isConnected())
1353 {
1354 // Send a message to the server telling it we want to drop the creature
1355 ClientNotification *clientNotification = new ClientNotification(
1356 ClientNotificationType::askSaveMap);
1357 ODClient::getSingleton().queueClientNotification(clientNotification);
1358 }
1359 return true;
1360}
1361
1362bool GameMode::showSettingsFromOptions(const CEGUI::EventArgs& /*e*/)
1363{

Callers

nothing calls this directly

Calls 2

isConnectedMethod · 0.45

Tested by

no test coverage detected