XGProyect / XG-Proyect-v3.x.x

XG Proyect is an OGame clone open-source web application framework designed for creating game clones, particularly those inspired by the popular game OGame, set in a vast and captivating space-themed universe.
https://xgproyect.org
GNU General Public License v3.0
149 stars 101 forks source link

Fixed bugs and added API #572

Open OceanicNomad opened 1 year ago

OceanicNomad commented 1 year ago

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

jbezza123 commented 10 months ago

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 commented 10 months ago

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

jonamix-ar commented 10 months ago

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

LucasKovacs commented 1 month ago

What is this fixing?