diff options
author | alexichi <alexbankai96@gmail.com> | 2016-04-25 10:25:46 +0200 |
---|---|---|
committer | alexichi <alexbankai96@gmail.com> | 2016-04-25 10:25:46 +0200 |
commit | 3ece645cc83e36aaa36c0258afa0f1b36eb13ca2 (patch) | |
tree | eda51cf0e00dd447c128b7b788627491c84e19e0 | |
parent | 8984aa2ecca7feacec93db35aee1570e40fa5123 (diff) | |
download | candybox-3ece645cc83e36aaa36c0258afa0f1b36eb13ca2.tar.gz candybox-3ece645cc83e36aaa36c0258afa0f1b36eb13ca2.tar.bz2 candybox-3ece645cc83e36aaa36c0258afa0f1b36eb13ca2.tar.xz candybox-3ece645cc83e36aaa36c0258afa0f1b36eb13ca2.zip |
remove useless files and add .gitignore to not see them again
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | inc/mine.inc~ | 20 | ||||
-rw-r--r-- | js/craftmine.js~ | 51 |
3 files changed, 1 insertions, 71 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/inc/mine.inc~ b/inc/mine.inc~ deleted file mode 100644 index a01d768..0000000 --- a/inc/mine.inc~ +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -function initCraftMine() { - $_SESSION["mine"] = array("mine" => 0, "or" => 0, "miners" => 1); -} - -function withdrawMine() { - $mine = $_SESSION["mine"]; - $_SESSION["mine"]["gold"] += $mine["mine"]; - $_SESSION["mine"]["mine"] = 0; -} - -function sendMine() { - if(empty($_SESSION["mine"])) initMine(); - $mine = $_SESSION["mine"]; - echo $mine["gold"]; -} - - -?> diff --git a/js/craftmine.js~ b/js/craftmine.js~ deleted file mode 100644 index bc03d6c..0000000 --- a/js/craftmine.js~ +++ /dev/null @@ -1,51 +0,0 @@ -datas = { - gold: 0, - mine: 0, - miners: 1, - level: 1 -} - -function sendRequest(url, params, callback) { - var xhr = new XMLHttpRequest(); - xhr.open("POST", url); - xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - xhr.onreadystatechange = function() { - if(xhr.readyState == XMLHttpRequest.DONE && xhr.status == "200") { - callback(xhr); - } - } - xhr.send(params); -} - - -function updateDatas(t) { - document.getElementById(t).innerHTML = datas[t]; -} - -function withdrawMine() { - sendRequest("craftmine.php", "op=withdrawMine", function() { - datas.gold += parseInt(datas.mine); - datas.mine = 0; - updateDatas("gold"); - updateDatas("mine"); - }) -} - -function initCraftMine() { - sendRequest("craftmine.php", "op=getCraftMine", function(xhr) { - var ret = xhr.responseText; - datas.gold = ret; - updateDatas("gold"); - }) -} - - -function updateMine() { - datas.mine += (datas.mineurs+1); - updateDatas("mine"); -} - -function init() { - initCraftMine(); - window.setInterval(updateMine, 1000); -} |