This repository was archived by the owner on Jun 11, 2021. It is now read-only.
forked from XGProyect/XG-Proyect-v2.10.x
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathglobal.php
More file actions
executable file
·148 lines (118 loc) · 5.1 KB
/
global.php
File metadata and controls
executable file
·148 lines (118 loc) · 5.1 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
<?php
/**
* @package XG Project
* @copyright Copyright (c) 2008 - 2014
* @license http://opensource.org/licenses/gpl-3.0.html GPL-3.0
* @since Version 2.10.0
*/
// SETEADO PARA EVITAR ERRORRES EN VERSION DE PHP MAYORES A 5.3.0
//error_reporting ( E_ALL & ~E_NOTICE );
//ini_set('display_errors', 1);
//error_reporting(E_ALL);
$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 ( INSTALL != TRUE )
{
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' );
if ( !isset ( $InLogin ) or $InLogin != TRUE )
{
include ( XGP_ROOT . 'includes/classes/class.CheckSession.php' );
$Result = new CheckSession();
$Result = $Result->CheckUser ( $IsUserChecked );
$IsUserChecked = $Result['state'];
$user = $Result['record'];
require ( XGP_ROOT . 'includes/classes/class.SecurePage.php' );
SecurePage::run();
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 ( '../adm/AdminFunctions/Autorization.php' );
define('DPATH' , "../". DEFAULT_SKINPATH );
}
else
{
define('DPATH' , ( ( !$user["dpath"] ) ? DEFAULT_SKINPATH : SKIN_PATH . $user["dpath"] . '/' ) );
}
include ( XGP_ROOT . 'includes/functions/SetSelectedPlanet.php' );
SetSelectedPlanet ( $user );
$planetrow = doquery ( "SELECT *, (SELECT COUNT(`id`) AS count FROM `{{table}}users` ) AS total_users
FROM `{{table}}planets`
WHERE `id` = '" . $user['current_planet'] . "';" , '' , TRUE );
// Include the plugin system 0.3
include ( XGP_ROOT . 'includes/plugins.php' );
}
}
else
{
define('DPATH' , "../". DEFAULT_SKINPATH );
}
?>