Hello everyone!
We've got an update on the progress of the emulator: We've finished the DAO packages, and with awesome results!
The DAO (Data Access Object) serves as mediator between the database (actually the API server) and the rest of the emulator.
This way we can easily parse a row from a given table and treat it like a normal Java object.
Each package consits of three classes:
- A factory.
- A builder.
- A DAO.
The factory is the class that will make the requests to the API server and parse them to Java objects.
The builder is the class that actually parses the responses of the API server and builds the DAO objects.
The DAO is the class that wraps the response from the API server in a Java object for easy access.
The thing here is its performance: a total of
684 rows from the database are loaded in
539 ms (some times can take up to
624 ms).
This means that
each row is loaded, build and parsed in
less than 1ms. Pretty fast, huh?
Here's the output:
Code:
manulaiko@spacebattles:/home/git/emulator$ /usr/java/bin/java -jar bin/emulator.jar
SpaceBattles v0.0.0 by RetarDev.
Loading configuration file...
Initializing GameManager...
Loading `factions`...
4 factions loaded!
Loading `items`...
291 items loaded!
Loading `collectables`...
111 collectables loaded!
Loading `levels`...
40 levels loaded!
Loading `npcs`...
80 npcs loaded!
Loading `maps_portals`...
106 portals loaded!
Loading `maps_stations`...
6 stations loaded!
Loading `maps`...
33 maps loaded!
Loading `ships`...
13 ships loaded!
Loading `galaxygates`...
0 galaxygates loaded!
Loading `clans`...
0 clans loaded!
GameManager initialized in 539 ms.
Enter a command to execute ('help' for a list of commands):
We're still looking for some developers able to help, if you like this kind of things submit your application in the discord server