XG-Proyect-v3.x.x icon indicating copy to clipboard operation
XG-Proyect-v3.x.x copied to clipboard

Fixed bugs and added API

Open OceanicNomad opened this issue 1 year ago • 4 comments

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 playerapi uniapi

OceanicNomad avatar Aug 17 '23 00:08 OceanicNomad

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

jbezza123 avatar Nov 15 '23 22:11 jbezza123

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

jbezza123 avatar Nov 16 '23 13:11 jbezza123

You don't need PDO to do it, you can use App\Core\Database and it will take the data

jonamix-ar avatar Nov 18 '23 02:11 jonamix-ar

What is this fixing?

LucasKovacs avatar Sep 01 '24 14:09 LucasKovacs