aboutsummaryrefslogtreecommitdiffstats
path: root/inc/mine.inc
blob: 6a04cc48c318c2c165a32ac509506ea5043f57a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

function initCraftMine() {
	$_SESSION["mine"] = array("mine" => 0, "gold" => 0, "miners" => 1);
}

function withdrawMine() {
	$amount = intval($_POST["amount"]);
	if($amount == 0) return;
	$_SESSION["mine"]["gold"] += $amount;
	echo json_encode($_SESSION["mine"]["gold"]);
}

function sendMine() {
	if(empty($_SESSION["mine"])) initCraftMine();
	$mine = $_SESSION["mine"];
	return $mine["gold"];
}


?>