diff options
Diffstat (limited to 'inc/messages.inc')
-rw-r--r-- | inc/messages.inc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/inc/messages.inc b/inc/messages.inc index c24bd18..c51adba 100644 --- a/inc/messages.inc +++ b/inc/messages.inc @@ -7,12 +7,26 @@ $messages = array( "guild_not_yet_created" => "You need to create a guild first.", "guild_already_built" => "You have aready built a guild.", "dungeon_already_available" => "You can already access the dungeon" + + "gamesave_ok" => "Game saved.", + "gamesave_error" => "An error occured when trying to save the game.", + "gamesave_not_found" => "Couldn't find the specified save file.", + "gamesave_delete_fail" => "Couldn't delete the specified save file.", + "gamesave_delete_success" => "Game save successfully removed from server", ); -function sendError($msg) { +function sendMessage($type, $msg) { global $messages; $text = $messages[$msg]; - echo json_encode(array("error" => $text)); + echo json_encode(array($type => $text)); +} + +function sendError($msg) { + sendMessage("error", $msg); +} + +function sendInfo($msg) { + sendMessage("info", $msg); } ?> |