aboutsummaryrefslogtreecommitdiffstats
path: root/js/guild.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/guild.js')
-rw-r--r--js/guild.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/js/guild.js b/js/guild.js
index 28f58b8..8d4d91b 100644
--- a/js/guild.js
+++ b/js/guild.js
@@ -1,18 +1,17 @@
function hireMiner(){
- sendRequest("craftmine.php", "op=hireMiner", function() {
- //datas.gold -= parseInt(datas.mine);
- var ret = xhr.responseText;
- console.log(ret);
- //datas.gold = ret;
- //updateDatas("gold");
- //updateDatas("miners");
- })
+ sendRequest("craftmine.php", "op=hireMiner", function(ret) {
+ debitAccount(parseInt(ret.cost));
+ data.miners = parseInt(ret.miners);
+ updateData("miners");
+ }
+ )
}
function createGuild(){
- sendRequest("craftmine.php", "op=createGuild", function() {
- var ret = xhr.responseText;
- console.log(ret);
- })
+ sendRequest("craftmine.php", "op=createGuild", function(ret) {
+ showInfo("Your guild has been successfully created");
+ debitAccount(parseInt(ret.cost));
+ }
+ )
}