log fix
This commit is contained in:
parent
784901be2f
commit
1d839e0106
3 changed files with 24 additions and 5 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("Crypt/XXTEA.php");
|
require_once(__DIR__ . "/Crypt/XXTEA.php");
|
||||||
|
|
||||||
if (!defined('GSP_XMLRPC_READY')) {
|
if (!defined('GSP_XMLRPC_READY')) {
|
||||||
if (!function_exists('xmlrpc_encode_request') || !function_exists('xmlrpc_decode')) {
|
if (!function_exists('xmlrpc_encode_request') || !function_exists('xmlrpc_decode')) {
|
||||||
|
|
@ -188,6 +188,10 @@ class OGPRemoteLibrary
|
||||||
if ( $response == -10 )
|
if ( $response == -10 )
|
||||||
return 'Agent Returned: -10. Home not found.';
|
return 'Agent Returned: -10. Home not found.';
|
||||||
@list($retval,$data_tmp) = @explode(";",$response);
|
@list($retval,$data_tmp) = @explode(";",$response);
|
||||||
|
if ($retval == -8 && !empty($data_tmp))
|
||||||
|
{
|
||||||
|
$data = base64_decode($data_tmp);
|
||||||
|
}
|
||||||
|
|
||||||
// We get log only with positive values.
|
// We get log only with positive values.
|
||||||
if ( $retval > 0 )
|
if ( $retval > 0 )
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('../../includes/lib_remote.php');
|
require_once(__DIR__ . '/../../includes/lib_remote.php');
|
||||||
require_once('../../modules/config_games/server_config_parser.php');
|
require_once(__DIR__ . '/../../modules/config_games/server_config_parser.php');
|
||||||
require_once('../../includes/functions.php');
|
require_once(__DIR__ . '/../../includes/functions.php');
|
||||||
|
|
||||||
// Get parameters from GET
|
// Get parameters from GET
|
||||||
$home_id = isset($_GET['home_id']) ? $_GET['home_id'] : null;
|
$home_id = isset($_GET['home_id']) ? $_GET['home_id'] : null;
|
||||||
|
|
@ -38,6 +38,11 @@ $home_log = implode("\n", array_slice($lines, -40));
|
||||||
if ($log_retval > 0) {
|
if ($log_retval > 0) {
|
||||||
echo "<pre style='background:black;color:white;'>".htmlspecialchars($home_log)."</pre>";
|
echo "<pre style='background:black;color:white;'>".htmlspecialchars($home_log)."</pre>";
|
||||||
} else {
|
} else {
|
||||||
echo "<pre style='background:black;color:white;'>Unable to get log: $log_retval</pre>";
|
if ($log_retval == -8 && isset($log_path) && preg_match('/[*?\[]/', $log_path)) {
|
||||||
|
$wildcardMsg = !empty($home_log) ? $home_log : ("No log files matched pattern: " . $log_path);
|
||||||
|
echo "<pre style='background:black;color:white;'>" . htmlspecialchars($wildcardMsg, ENT_QUOTES, 'UTF-8') . "</pre>";
|
||||||
|
} else {
|
||||||
|
echo "<pre style='background:black;color:white;'>Unable to get log: $log_retval</pre>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,17 @@ require_once("modules/config_games/server_config_parser.php");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if ($log_retval == -8 && isset($log_path) && preg_match('/[*?\[]/', $log_path))
|
||||||
|
{
|
||||||
|
if (!empty($home_log))
|
||||||
|
print_failure(htmlentities($home_log, ENT_QUOTES, "UTF-8"));
|
||||||
|
else
|
||||||
|
print_failure("No log files matched pattern: " . htmlentities($log_path, ENT_QUOTES, "UTF-8"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print_failure(get_lang_f('unable_to_get_log',$log_retval));
|
print_failure(get_lang_f('unable_to_get_log',$log_retval));
|
||||||
|
}
|
||||||
echo create_back_button( $_GET['m'], 'game_monitor&home_id-mod_id-ip-port='.$_GET['home_id-mod_id-ip-port'] );
|
echo create_back_button( $_GET['m'], 'game_monitor&home_id-mod_id-ip-port='.$_GET['home_id-mod_id-ip-port'] );
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue