GameDesign: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 53:
and a we have created a PlayerEntry for this player with an unique correct clientid.
</pre>
<pre>
Process C2S ChooseCharacter ( STATE_LOGIN_COMPLETE )
Precondition: The state MUST be STATE_LOGIN_COMPLETE
Line 74 ⟶ 75:
should be completely filled or if the character choise was wrong the state is STATE_LOGIN_COMPLETE
</pre>
<pre>
Process C2S Logout ( STATE_GAME_END )
Line 93 ⟶ 96:
Postcondition: Either the same as the input state or the state currently in
</pre>
<pre>
Process C2S Perception ACK
Line 101 ⟶ 107:
Postcondition: The state is STATE_LOGIN_BEGIN and Timestamp field in
PlayerContainer is updated.
</pre>
<pre>
Process C2S Transfer ACK
Line 116 ⟶ 125:
</pre>
= Basic idea behind Database storage =
The database table relationship schema is:
<pre>
Table PLAYER
{
Line 177 ⟶ 182:
PK(slot_id)
)
</pre>
Relationships:
<pre>
Relationship PLAYER_CHARACTERS
{
Line 192 ⟶ 197:
PK(login_event_id)
}
</pre>
Translate this to SQL easily and you have the SQL schema of Marauroa
== JDBC Database HOWTO==
JDBC technology is an API that lets you access virtually any tabular data source from the Java programming language. It provides cross-DBMS connectivity to a wide range of SQL databases, and now, with the new JDBC API, it also provides access to other tabular data sources, such as spreadsheets or flat files.
JDBCPlayerDatabase is anyway not database independent; on the Player table we are using AUTOINCREMENT that is a unique keyword of MySQL that is not part of the SQL standard.
You need to download MySQL Connector/J in order to get it to run.
http://www.mysql.com/downloads/api-jdbc-stable.html
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
<pre>
marauroa_DATABASE=JDBCPlayerDatabase
Line 276 ⟶ 219:
jdbc_user=marauroa_dbuser
jdbc_pwd=marauroa_dbpwd
</pre>
jdbc_class is the field that says what Driver to use. Please refer to your software manual to see the multiple options.
jdbc_url points to the type and source of the information, for MySQL the string must be as follow:
jdbc:mysql://
jdbc_user is the username for the database and jdbc_pwd is the password for that username in the database.
Line 286 ⟶ 232:
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>
create database marauroa;
grant all on marauroa.* to marauroa_dbuser@localhost identified by 'marauroa_dbpwd';
</pre>
The rest of code is handled by the server itself, and will create the tables if they don't exits.
3.c PlayerContainer Explained
Last updated: 2003/10/23
| |||