GameDesign: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
No edit summary
imported>StephenIerodiaconou
No edit summary
Line 16: Line 16:
</pre>
</pre>


So let's define the reply to each message. Before explaining how to process eahc message, let's clarify that the best way of modelling this system is using finite automates, (finite state machine) where, based on the input, we change the state we are currently in and produce an output.
So let's define the reply to each message. First, let's clarify that the best way of modelling this system is using finite automates, (a finite state machine) where, based on the input, we change the state we are currently in and produce an output.


<pre>
<pre>
Line 211: Line 211:
To configure Marauroa to work with a JDBC source we need to modify the configuration of the JDBC Connection.
To configure Marauroa to work with a JDBC source we need to modify the configuration of the JDBC Connection.


So open the configuration file marauroad.ini ''(or any other)'' and edit the next fields
So open the configuration file '''marauroad.ini''' ''(or whatever you choose to name it)'' and edit the next fields
<pre>
<pre>
marauroa_DATABASE=JDBCPlayerDatabase
marauroa_DATABASE=JDBCPlayerDatabase
Line 221: Line 221:
</pre>
</pre>


jdbc_class is the field that says what Driver to use. Please refer to your software manual to see the multiple options.
* ''jdbc_class'': This field tells the engine what Driver to use for database access. Please refer to your software manual to see the multiple options.
* ''jdbc_url'': This points to the type and source of the information, for MySQL the string must be as follows:
** '''jdbc:mysql://ip:database_name/'''
* ''jdbc_user'': This is the username for the database
* ''jdbc_pwd'': This is the password for that username in the database.


Now, simply save the changes and your configuration file is ready.
jdbc_url points to the type and source of the information, for MySQL the string must be as follow:


Before using the application with the database, you need to create the database itself. So, with MySQL just run MySQL and enter:
jdbc:mysql://ip:database_name/

jdbc_user is the username for the database and jdbc_pwd is the password for that username in the database.

Then simply save the changes and ready.

Before using the application with the database, you need to create the database itself. So in case of MySQL just open MySQL and write:
<pre>
<pre>
create database marauroa;
create database marauroa;
Line 237: Line 235:
</pre>
</pre>


The rest of code is handled by the server itself, and will create the tables if they don't exits.
The rest of code is handled by the server itself, and it will create the tables if they don't exist.


=PlayerContainer Explained=
=PlayerContainer Explained=
PlayerContainer is the data structure that contains all of the needed info about the players to keep the game running.
PlayerContainer is the data structure that contains all of the information about the players while the game is running.


It consists of a list of RuntimePlayerEntry objects, and is heavily linked with the PlayerDatabase, so we can hide the complexity to GameManager. By making PlayerDatabase hidden by PlayerContainer we achieve the illusion that managing the runtime behavior we modify automatically the permanent one.
It consists of a list of RuntimePlayerEntry objects and is heavily linked with the PlayerDatabase, so we can hide the complexity to GameManager. By making PlayerDatabase hidden by PlayerContainer we achieve the illusion that managing the runtime behavior we modify automatically the permanent one.


RuntimePlayerEntry is the structure that contains the information of the player while it is online. <br>RuntimePlayerEntry contains:
RuntimePlayerEntry is the structure that contains the information of the player while it is online. <br>RuntimePlayerEntry contains: