XG-Proyect-v3.x.x
XG-Proyect-v3.x.x copied to clipboard
Fixed bugs and added API
I fixed the bugs with the combat system, one issue was PHP 8 related and the other an incorrectly defined constant in report generation.
Also implemented an API feature
so i had to add this to both php files in the api folder
$dsn = "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]; $pdo = new PDO($dsn, DB_USER, DB_PASS, $options);
also change the secret word for planets in playerdata.php on line 40 and line 63 to xgp_ in serverdata its line 16 but yh other than that it all works, maybe an easier way to intergrate
place in game directory and this will install the api mod, but i abbreviated the endpoints to /public/api/PD.php
and /public/api/SD.php
also i changed them to return the json file, as the webpage is nice but impractical since i just want the data
install api.zip
You don't need PDO to do it, you can use App\Core\Database and it will take the data
What is this fixing?