aboutsummaryrefslogtreecommitdiffstats
path: root/inc/messages.inc
blob: 1f25ed371052336a1bfb221fe3a6d5765eccb544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

$messages = array(
	"shop_already_built" => "You have already built a shop.",
	"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.",
	"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 sendMessage($type, $msg) {
	global $messages;
	$text = $messages[$msg];
	echo json_encode(array($type => $text));
}

function sendError($msg) {
	sendMessage("error", $msg);
}

function sendInfo($msg) {
	sendMessage("info", $msg);
}

?>