aboutsummaryrefslogtreecommitdiffstats
path: root/inc/account.inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc/account.inc')
-rw-r--r--inc/account.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/inc/account.inc b/inc/account.inc
new file mode 100644
index 0000000..19f311d
--- /dev/null
+++ b/inc/account.inc
@@ -0,0 +1,18 @@
+<?php
+require_once("messages.inc");
+
+function debitAccount($amount) {
+ if($_SESSION["mine"]["gold"] <= $amount) {
+ sendError("gold_insufficient");
+ return false;
+ }
+ $_SESSION["mine"]["gold"] -= $amount;
+ return true;
+}
+
+function creditAccount($amount) {
+ $_SESSION["mine"]["gold"] += $amount;
+}
+
+
+?>