From 3ece645cc83e36aaa36c0258afa0f1b36eb13ca2 Mon Sep 17 00:00:00 2001 From: alexichi Date: Mon, 25 Apr 2016 10:25:46 +0200 Subject: remove useless files and add .gitignore to not see them again --- .gitignore | 1 + inc/mine.inc~ | 20 -------------------- js/craftmine.js~ | 51 --------------------------------------------------- 3 files changed, 1 insertion(+), 71 deletions(-) create mode 100644 .gitignore delete mode 100644 inc/mine.inc~ delete mode 100644 js/craftmine.js~ 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 @@ - 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); -} -- cgit v1.2.3-70-g09d2