jonathaneeckhout / jdungeon

An opensource 2d morpg game based on the Godot engine in a medieval inspired fantasy world
https://jdungeon.org
BSD 2-Clause "Simplified" License
130 stars 23 forks source link

Sugestion: Rework the Datebase Backend and storage for Env Vars #231

Open Fox-Alpha opened 8 months ago

Fox-Alpha commented 8 months ago

Hello, i have begun with a rework of the database backend.

What will i do. i will try to write a general interface for more flexibility at the used backend and easier access.

at my forked repostory at commit: https://github.com/jonathaneeckhout/jdungeon/commit/fc3313445509b1007708ba4b119508e45b8cf9c4

I have written a base class for inheritance and implemented some base functions which are needed in all backends. For example, AuthenticateUser or CreateAccount.

The JSON Backend is running, but not optimized or complete migrated.

I would like to implement sqlite and migrate postgres too.

sqlite godot extension from here for the first step https://github.com/2shady4u/godot-sqlite/blob/v4.2/README.md

I will also try to implement the backend in C# with using of EntityFramework Core With this nearly every backend can used with just inherit from the base

With EF it is possible to implement Code first and generate the DateBase on the fly just from the DataModel. After this i thing it could be possible to implement for example the authentication with a C# minimal RestFull API server with more flexibility. An API Server can also be used to provide Data to the Website like playerprofile Pages or Highscores or TopTens or make daily/weekly quest

For the Enviroment i will try to make it easier. I thing there are many vars that could better stored in DB. With this you can, for example make different configuration per server or for debug / release

What do you thinking about this ?

Greetings FoxAlpha

jonathaneeckhout commented 8 months ago

I am fine with this proposal of extending the database.

I am looking forward for this contribution!