diff options
Diffstat (limited to 'inc/messages.inc')
-rw-r--r-- | inc/messages.inc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/inc/messages.inc b/inc/messages.inc index d6ea87e..9f3a09d 100644 --- a/inc/messages.inc +++ b/inc/messages.inc @@ -5,13 +5,24 @@ $messages = array( "gold_insufficient" => "You don't have enough gold.", "shop_missing_item" => "This item does not exist.", "guild_not_yet_created" => "You need to create a guild first.", - "guild_already_built" => "You have aready built a guild." + "guild_already_built" => "You have aready built a guild.", + + "gamesave_ok" => "Game saved.", + "gamesave_error" => "An error occured when trying to save the game.", ); -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); } ?> |