-
Notifications
You must be signed in to change notification settings - Fork 1
/
levelchecker.php
84 lines (80 loc) · 2.71 KB
/
levelchecker.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
include_once($_SERVER['DOCUMENT_ROOT'] . "/topmenu.php");
$missionsMinLevel = 1;
$homeMinLevel = 2;
$battleMinLevel = 3;
$shopItemMinLevel = 4;
$shopREMinLevel = 4;
$profileMinLevel = 5;
$hospitalMinLevel = 5;
$recruitMinLevel = 6;
session_start();
$level = $playerLevel;
//TODO: refactor js to have absolute paths
$tooLowLevelString = "You need to be at least level ";
if ($_POST['pageRequestType'] == "mission"){
if ($level >= $missionsMinLevel) {
echo "<script>location.href='$serverRoot/choosemission.php'</script>";
} else {
echo $tooLowLevelString . $missionsMinLevel . " to do missions";
print "<br>";
echo "<insert links to allowable paths here>";
}
} else if ($_POST['pageRequestType'] == "battle"){
if ($level >= $battleMinLevel) {
echo "<script>location.href='$serverRoot/battle.php'</script>";
} else {
echo $tooLowLevelString . $battleMinLevel . " to battle";
print "<br>";
echo "<insert links to allowable paths here>";
}
} else if ($_POST['pageRequestType'] == "shopitem"){
if ($level >= $shoItemMinLevel) {
echo "<script>location.href='$serverRoot/shopitemlist.php'</script>";
} else {
echo $tooLowLevelString . $shopItemMinLevel . " to shop";
print "<br>";
echo "<insert links to allowable paths here>";
}
} else if ($_POST['pageRequestType'] == "shoprealestate"){
if ($level >= $shopREMinLevel) {
echo "<script>location.href='$serverRoot/shoprealestatelist.php'</script>";
} else {
echo $tooLowLevelString . $shopREMinLevel . " to shop";
print "<br>";
echo "<insert links to allowable paths here>";
}
} else if ($_POST['pageRequestType'] == "recruit"){
if ($level >= $recruitMinLevel) {
echo "<script>location.href='$serverRoot/recruit.php'</script>";
} else {
echo $tooLowLevelString . $recruitMinLevel . " to recruit";
print "<br>";
echo "<insert links to allowable paths here>";
}
} else if ($_POST['pageRequestType'] == "home"){
if ($level >= $homeMinLevel) {
echo "<script>location.href='$serverRoot/charhome.php'</script>";
} else {
echo $tooLowLevelString . $homeMinLevel . " to get to home";
print "<br>";
echo "<insert links to allowable paths here>";
}
} else if ($_POST['pageRequestType'] == "profile"){
if ($level >= $profileMinLevel) {
echo "<script>location.href='$serverRoot/charprofile.php'</script>";
} else {
echo $tooLowLevelString . $profileMinLevel . " to get to profile";
print "<br>";
echo "<insert links to allowable paths here>";
}
} else if ($_POST['pageRequestType'] == "hospital"){
if ($level >= $hospitalMinLevel) {
echo "<script>location.href='$serverRoot/hospital.php'</script>";
} else {
echo $tooLowLevelString . $hospitalMinLevel . " to get to hospital";
print "<br>";
echo "<insert links to allowable paths here>";
}
}
?>