Server Setup
From SMO Wiki
This guide is incomplete.
| Table of contents |
A Note about SMO server
The Stepmania Online server is designed to run using the MySQL database system. It has not been tested on any other SQL systems. This setup guide is designed for the current CVS of the server. This guide is not intended for use with the publically available server downloadable from sourceforge.net (which is very old and out of date).
Obtaining the SMO Server
Currenty the only way to obtain the server (for use with this document) is to do an anonymous CVS checkout from sourceforge. A checkout can be performed using the following CVS client commands in linux.
cvs -d:pserver:anonymous@smonline.cvs.sourceforge.net:/cvsroot/smonline login cvs -z3 -d:pserver:anonymous@smonline.cvs.sourceforge.net:/cvsroot/smonline co -P SMOnline
Windows users can use CVS clients such as TortoiseCVS (http://www.tortoisecvs.org/) or WinCvs (http://www.wincvs.org/). The checkout commands will be the same as above, except the method for entering them into the programs will be slightly different.
More about the CVS system can be found on the SMOnline CVS (https://sourceforge.net/cvs/?group_id=121611) page.
Compiling
SMOnline can be compiled under Linux using g 3.4 and under Windows using Microsoft Visual C 6.0 and Microsoft .NET compilers.
To compile in linux type
$ make
at the command prompt.
Windows users simply need to open the VC 6 project file and compile. It is recommended that you compile in "Release" mode rather than debug mode.
Error on Compiling
If you get an error like
"gettid" was not declared in this scope
Then open the file Crash\Linux\LinuxThreadHelpers.cpp, and comment the next line :
static _syscall0(pid_t,gettid)
and replace calls to gettid by this
syscall(224);
Configuring the server
The SMO server uses the SMOnline.ini file for its configuration settings. The file itself is pretty well documented. However a few things should be mentioned here. (More to come)
Cycle Per Second
The SMOnline server runs at nearly a constant speed, this speed is measured in cycles per second. The following line
CPS=20
is used to set that speed. Lower values will cause the server to use less CPU while doing very little work, however this will cause longer delays between updates in the server. If set too low, this will cause noticable delays between the clients and server.
Higher values will reduce these delays, but will increase the amount of CPU used when doing very little work. A value of 20 seems to be a pretty good balance.
Judge Settings
These are the time values that SMO uses to try to determine if a step falls outside of the TIMING range. By default these values come directly from the Stepmania.ini for SM 3.9 with a judge level of 4.
JudgeWindowSecondsBoo=0.180000 JudgeWindowSecondsGood=0.135000 JudgeWindowSecondsGreat=0.090000 JudgeWindowSecondsMarvelous=0.022500 JudgeWindowSecondsPerfect=0.045000
These values can be changed to custom values, depending on the need of the server.
Create Rooms
This part of the INI file is used to create rooms that should always exists in the server. The first thing to note is that "Lobby" always exists. There is no way for you to change this. (more to come)
MySQL Setup
User Tables
The SMO server also makes use of the phpBB database structure for maintaining user account information such as usernames, passwords, and ban info. The SMO server does allow for configuration of database and table names.
Statistics Tables
The MySQL dump of the required table layouts for the SMO server can be found at http://www.stepmaniaonline.com/SmoStatsTables.txt
The MySQL database MUST be layed out exactly as found in the MySQL dump file. However, the database name can be changed from `stepmani_newstats`.
What about the web interface?
Stepmania Online does not currently make their web based statistics php scripts available to download. However many of the scripts simply query the statistics database in various way to reconstruct all the necessary statistical data.
Reconstructing Statistical Data
Player Stats Table
The first table to look at when reconstructing statistical data is the 'player_stats' table. This table contains all the info for every round ever played by any player. This includes all step data such as Perfects, Goods, Boos, etc... Each entry contains a unique key which is not used outside of mySQL. Each entry also has a user id (uid) which is the users id number which can be mapped to a user name. Each entry also contains a round id (round_ID). The round id is very important. It is used to link individual statistical entries for any players with a given ound entry in the 'rounds' table. Multiple entries can have the same round id, for example if 3 people played a round together, than there will be 3 entries with the same round id.
Rounds Table
The 'rounds' table contains information unique to each round played. This includes a round id, song id, timestamp, and room name. The round id is a unique number, for each round, there will be no duplicates. This number can be matched with entries in the 'player_stats' table. The song id is a number that matches an entry in the found in the 'song_stats' table.
Song Stats Table
The 'song_stats' table contains info on a given song including, title, subtitle, artist, play count, and song id. Song id is a unique number for each entry.
By making several queries between these table, all necessary information for any round can be generated.
