mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-12 15:46:06 +00:00
feat: access log config setting and a real get-post-cookie logger
This is a very naive and primitive logger of user requests to the game. To be used on systems where access to webserver's log data is not available (especially if the webserver doesn't store POST data as well).
This commit is contained in:
@@ -9,6 +9,29 @@
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
// even with autoloader created, we can't use it here yet, as it's not been created
|
||||
// ... so, let's see where it is and include it
|
||||
$autoloader_found = false;
|
||||
// go max 5 levels up - we don't have folders that go deeper than that
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
$autoprefix = str_repeat('../', $i);
|
||||
if (file_exists($autoprefix.'autoloader.php')) {
|
||||
$autoloader_found = true;
|
||||
include_once $autoprefix.'autoloader.php';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$autoloader_found) {
|
||||
die('Could not find autoloading class.');
|
||||
}
|
||||
|
||||
// we need config to determine whether to log access or not
|
||||
include_once($autoprefix.'GameEngine/config.php');
|
||||
|
||||
use App\Utils\AccessLogger;
|
||||
AccessLogger::logRequest();
|
||||
|
||||
switch($_GET['f']) {
|
||||
case 'k7':
|
||||
header('Content-Type: application/json');
|
||||
|
||||
Reference in New Issue
Block a user