-
Notifications
You must be signed in to change notification settings - Fork 54
/
game.php
executable file
·41 lines (36 loc) · 1.17 KB
/
game.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
<?php
define('CURSCRIPT', 'game');
define('IN_GAME', true);
defined('GAME_ROOT') || define('GAME_ROOT', dirname(__FILE__).'/');
require GAME_ROOT.'./include/global.func.php';
include GAME_ROOT.'./include/modules/core/sys/config/server.config.php';
if(isset($_POST['mode']) && $_POST['mode'] == 'quit') {
gsetcookie('user','');
gsetcookie('pass','');
header("Location: index.php");
exit();
}
$url = url_dir().'command.php';
$context = array('page'=>'command_game');
foreach($_POST as $pkey => $pval){
$context[$pkey] = $pval;
}
$cookies = array();
foreach($_COOKIE as $ckey => $cval){
if(strpos($ckey,'user')!==false || strpos($ckey,'pass')!==false) $cookies[$ckey] = $cval;
}
$gameinfo = curl_post($url, $context, $cookies);
if(strpos($gameinfo, 'redirect')===0){
list($null, $url) = explode(':',$gameinfo);
header('Location: '.$url);
return;
}
if(strpos($gameinfo,'<head>')===false){
$d_gameinfo = gdecode($gameinfo,1);
if(is_array($d_gameinfo) && isset($d_gameinfo['url']) && 'error.php' == $d_gameinfo['url']){
gexit($d_gameinfo['errormsg'],__file__,__line__);
}
}
echo $gameinfo;
/* End of file game.php */
/* Location: /game.php */