forked from XG-Project/xNova
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.php
More file actions
executable file
·158 lines (125 loc) · 5.22 KB
/
global.php
File metadata and controls
executable file
·158 lines (125 loc) · 5.22 KB
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
<?php
/**
* @project XG Proyect
* @version 2.10.x build 0000
* @copyright Copyright (C) 2008 - 2012
*/
if (version_compare(PHP_VERSION, "5.2.0", "<"))
die('<!DOCTYPE html><html><head><title>¡Error!</title><meta charset="UTF-8"></head><body>¡Error! Tu servidor debe tener al menos php 5.2.0</body></html>');
// -1 permitirá guardar todos los errores
error_reporting(-1);
$user = array();
$lang = array();
$link = "";
$IsUserChecked = FALSE;
include_once(XGP_ROOT.'includes/constants.php');
include_once(XGP_ROOT.'includes/GeneralFunctions.php');
include_once(XGP_ROOT.'includes/classes/class.simple_html_dom.php');
include_once(XGP_ROOT.'includes/classes/class.debug.php');
include_once(XGP_ROOT.'includes/classes/class.xml.php');
include_once(XGP_ROOT.'includes/classes/class.Format.php');
include_once(XGP_ROOT.'includes/classes/class.NoobsProtection.php');
include_once(XGP_ROOT.'includes/classes/class.Production.php');
include_once(XGP_ROOT.'includes/classes/class.Fleets.php');
$debug = new debug();
if (filesize(XGP_ROOT.'config.php') == 0 && (( ! defined('INSTALL')) OR ( ! INSTALL)))
{
exit(header('location:'.XGP_ROOT.'install/'));
}
if (filesize(XGP_ROOT.'config.php') != 0)
{
$game_version = read_config('version');
define('VERSION', ($game_version == '') ? "" : "v" . $game_version );
}
if ( ! defined('INSTALL') OR ( ! INSTALL))
{
include(XGP_ROOT.'includes/vars.php');
include(XGP_ROOT.'includes/functions/CreateOneMoonRecord.php');
include(XGP_ROOT.'includes/functions/CreateOnePlanetRecord.php');
include(XGP_ROOT.'includes/functions/SendSimpleMessage.php');
include(XGP_ROOT.'includes/functions/calculateAttack.php');
include(XGP_ROOT.'includes/functions/formatCR.php');
include(XGP_ROOT.'includes/functions/GetBuildingTime.php');
include(XGP_ROOT.'includes/functions/HandleElementBuildingQueue.php');
include(XGP_ROOT.'includes/functions/PlanetResourceUpdate.php');
$game_lang = read_config('lang');
define('DEFAULT_LANG', ($game_lang == '') ? "spanish" : $game_lang);
includeLang('INGAME');
include(XGP_ROOT.'includes/classes/class.CheckSession.php');
$Result = new CheckSession();
$Result = $Result->CheckUser($IsUserChecked);
$IsUserChecked = $Result['state'];
if (isset($InLogin) && $InLogin && $IsUserChecked)
{
header('Location: game.php?page=overview');
}
elseif (( ! isset($InLogin) OR ( ! $InLogin)) && ( ! $IsUserChecked))
{
header('Location: '.XGP_ROOT);
}
$user = $Result['record'];
if (read_config('game_disable') == 0 && $user['authlevel'] == 0)
{
message(stripslashes(read_config('close_reason')), '', '', FALSE, FALSE);
}
if ((time() >= (read_config('stat_last_update') + (60 * read_config ( 'stat_update_time' )))))
{
include(XGP_ROOT.'adm/statfunctions.php');
$result = MakeStats();
update_config('stat_last_update', $result['stats_time']);
}
if ( ! empty($user))
{
include( XGP_ROOT.'includes/classes/class.FlyingFleetHandler.php');
$_fleets = doquery("SELECT fleet_start_galaxy,fleet_start_system,fleet_start_planet,fleet_start_type FROM {{table}} WHERE `fleet_start_time` <= '".time()."' and `fleet_mess` ='0' order by fleet_id asc;", 'fleets'); // OR fleet_end_time <= ".time()
while ($row = mysql_fetch_array($_fleets))
{
$array = array();
$array['galaxy'] = $row['fleet_start_galaxy'];
$array['system'] = $row['fleet_start_system'];
$array['planet'] = $row['fleet_start_planet'];
$array['planet_type'] = $row['fleet_start_type'];
$temp = new FlyingFleetHandler($array);
}
mysql_free_result($_fleets);
$_fleets = doquery("SELECT fleet_end_galaxy,fleet_end_system,fleet_end_planet ,fleet_end_type FROM {{table}} WHERE `fleet_end_time` <= '" . time() . " order by fleet_id asc';", 'fleets'); // OR fleet_end_time <= ".time()
while ($row = mysql_fetch_array($_fleets))
{
$array = array();
$array['galaxy'] = $row['fleet_end_galaxy'];
$array['system'] = $row['fleet_end_system'];
$array['planet'] = $row['fleet_end_planet'];
$array['planet_type'] = $row['fleet_end_type'];
$temp = new FlyingFleetHandler($array);
}
mysql_free_result($_fleets);
unset($_fleets);
if (defined('IN_ADMIN'))
{
includeLang('ADMIN');
include(XGP_ROOT.'adm/AdminFunctions/Autorization.php');
define('DPATH', "../".DEFAULT_SKINPATH);
}
else
{
define('DPATH', (( ! isset($user["dpath"]) OR (empty($user["dpath"]))) ? DEFAULT_SKINPATH : SKIN_PATH . $user["dpath"] . '/'));
}
if (isset($user['current_planet']))
{
include(XGP_ROOT.'includes/functions/SetSelectedPlanet.php');
SetSelectedPlanet($user);
$planetrow = doquery("SELECT * FROM `{{table}}` WHERE `id` = '".$user['current_planet']."';", "planets", TRUE);
}
// Include the plugin system 0.3
include(XGP_ROOT.'includes/plugins.php');
}
}
else
{
define('DPATH' , "../".DEFAULT_SKINPATH);
}
include('includes/classes/class.SecurePage.php'); // include the class
$SecureSqlInjection = new SecureSqlInjection(); // load the class
$SecureSqlInjection->secureGlobals(); // run the main class function
/* End of file global.php */
/* Location: ./global.php */