blob: 752fc691ededfbb6ffcb82b067bb299e49e6b981 (
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("gold" => 0, "miners" => 0);
}
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"];
}
?>
|