This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
galaxy.php
159 lines (139 loc) · 5.72 KB
/
galaxy.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/common.php';
includeLang('galaxy');
$lunarow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_luna'] ."';", 'lunas', true);
$user = MergeUserTechnology($user);
$fleetmax = $user['computer_tech'] + 1;
$CurrentPlID = $planetrow['id'];
$CurrentMIP = $planetrow['interplanetary_misil'];
$CurrentRC = $planetrow['recycler'];
$CurrentSP = $planetrow['spy_sonde'];
$HavePhalanx = $planetrow['phalanx'];
$CurrentSystem = $planetrow['system'];
$CurrentGalaxy = $planetrow['galaxy'];
$CanDestroy = $planetrow[$resource[213]] + $planetrow[$resource[214]];
$maxfleet = doquery("SELECT * FROM {{table}} WHERE `fleet_owner` = '". $user['id'] ."';", 'fleets');
$maxfleet_count = mysqli_num_rows($maxfleet);
CheckPlanetUsedFields($planetrow);
CheckPlanetUsedFields($lunarow);
if (!isset($mode)) {
if (isset($_GET['mode'])) {
$mode = intval($_GET['mode']);
} else {
$mode = 0;
}
}
$galaxy = 1;
$system = 1;
$planet = null;
if ($mode == 0) {
$galaxy = $CurrentGalaxy;
$system = $CurrentSystem;
} elseif ($mode == 1 || $mode == 3) {
if (isset($_POST["galaxyLeft"])) {
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 1 || $_POST["galaxy"] > MAX_GALAXY_IN_WORLD) {
$galaxy = 1;
} else {
$galaxy = intval($_POST["galaxy"]) - 1;
}
} elseif (isset($_POST["galaxyRight"])) {
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] >= MAX_GALAXY_IN_WORLD) {
$galaxy = MAX_GALAXY_IN_WORLD;
} else {
$galaxy = intval($_POST["galaxy"]) + 1;
}
} else if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 1 || $_POST["galaxy"] > MAX_GALAXY_IN_WORLD) {
$galaxy = 1;
} else {
$galaxy = intval($_POST["galaxy"]);
}
if (isset($_POST["systemLeft"])) {
if (!isset($_POST["system"]) || $_POST["system"] <= 1 || $_POST["system"] > MAX_SYSTEM_IN_GALAXY) {
$system = 1;
} else {
$system = intval($_POST["system"]) - 1;
}
} elseif (isset($_POST["systemRight"])) {
if (!isset($_POST["system"]) || $_POST["system"] >= MAX_SYSTEM_IN_GALAXY) {
$system = MAX_SYSTEM_IN_GALAXY;
} else {
$system = intval($_POST["system"]) + 1;
}
} else if (!isset($_POST["system"]) || $_POST["system"] <= 1 || $_POST["system"] > MAX_SYSTEM_IN_GALAXY) {
$system = 1;
} else {
$system = intval($_POST["system"]);
}
} elseif ($mode == 2) {
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 0) {
$galaxy = 1;
} else if ($_POST["galaxy"] >= MAX_GALAXY_IN_WORLD) {
$galaxy = MAX_GALAXY_IN_WORLD;
} else {
$galaxy = intval($_POST["galaxy"]) + 1;
}
if (!isset($_POST["system"]) || $_POST["system"] <= 0) {
$system = 1;
} else if ($_POST["system"] >= MAX_SYSTEM_IN_GALAXY) {
$system = MAX_SYSTEM_IN_GALAXY;
} else {
$system = intval($_POST["system"]) + 1;
}
if (!isset($_POST["planet"]) || $_POST["planet"] <= 0) {
$planet = 1;
} else if ($_POST["planet"] >= MAX_PLANET_IN_SYSTEM) {
$planet = MAX_PLANET_IN_SYSTEM;
} else {
$planet = intval($_POST["planet"]) + 1;
}
}
$planetcount = 0;
$lunacount = 0;
$page = InsertGalaxyScripts($planetrow);
$page .= "<body style=\"overflow: hidden;\" onUnload=\"\"><br><br>";
$page .= ShowGalaxySelector ( $galaxy, $system );
if ($mode == 2) {
$page .= ShowGalaxyMISelector($galaxy, $system, $planet, $planetrow['id'], $CurrentMIP);
}
$page .= "<table width=569><tbody>";
$page .= ShowGalaxyTitles($galaxy, $system);
$page .= ShowGalaxyRows($galaxy, $system);
$page .= ShowGalaxyFooter($galaxy, $system, $CurrentMIP, $CurrentRC, $CurrentSP);
$page .= "</tbody></table></div>";
display ($page, $lang['Galaxy'], false, '', false);
// -----------------------------------------------------------------------------------------------------------
// History version
// 1.0 - Created by Perberos
// 1.1 - Modified by -MoF- (UGamela germany)
// 1.2 - 1er Nettoyage Chlorel ...
// 1.3 - 2eme Nettoyage Chlorel ... Mise en fonction et debuging complet