aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-04-27 20:00:23 +0200
committerpiernov <piernov@piernov.org>2016-04-27 20:00:23 +0200
commit8bb2650b5d35dc5f47c8a46167dc2044638d1f4c (patch)
tree029c13c6c0113e6da31581b3ce7ac33400e94b8c
parent0133251e523b1c984b2b5cdb60c7392c18e6bd73 (diff)
parenta639278fcf395dd7349886785d56dee63c3a8774 (diff)
downloadcandybox-8bb2650b5d35dc5f47c8a46167dc2044638d1f4c.tar.gz
candybox-8bb2650b5d35dc5f47c8a46167dc2044638d1f4c.tar.bz2
candybox-8bb2650b5d35dc5f47c8a46167dc2044638d1f4c.tar.xz
candybox-8bb2650b5d35dc5f47c8a46167dc2044638d1f4c.zip
Merge branch 'feat/messages' into feat/savegame
-rw-r--r--inc/messages.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/inc/messages.inc b/inc/messages.inc
index d6ea87e..5b1631f 100644
--- a/inc/messages.inc
+++ b/inc/messages.inc
@@ -8,10 +8,18 @@ $messages = array(
"guild_already_built" => "You have aready built a guild."
);
-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);
}
?>