- I - [goto=a1]Prerequisites[/goto]
II - [goto=a2]Warcraft 3 FT[/goto]- [goto=a2d1]Stopping the server[/goto]
- [goto=a2d2]Configuring Warcraft 3 FT[/goto]
- [goto=a3d1]Skipping (for fresh server installation)[/goto]
- [goto=a3d2]Preparing the database[/goto]
- [goto=a3d3]Converting Warcraft 3 FT XP[/goto]
- [goto=a3d3d1]Converting from Files[/goto]
- [goto=a3d3d2]Converting from MySQL[/goto]
- [goto=a4d1]Starting the server[/goto]
- [anchor]a1d1[/anchor]You have a working Warcraft 3 FT server installation using either the vault.ini file or the MySQL server for XP storage (later on you'll be [goto=a3]converting it[/goto]).
- [anchor]a1d2[/anchor]You have the latest version (post 1.55) of AMX Mod X or, if you are running versions 1.50/1.55, you have installed the SQLite pack for Warcraft 3 FT (please pay attention, since this is different from what is required in the following point).
- [anchor]a1d3[/anchor]You have read, followed and completed the SQLite for AMX Mod X simple Mini-HOWTO (The simple Mini-HOWTO series structure is being modularized so this document you are reading contains only partial information, you will not be able to complete it without following the above link).
- [anchor]a2d1[/anchor]Start by stopping your game server in the usual way for your system. If you are running a listen server simply quit the game, if you are running a dedicated server you may have several ways to stop it, if everything else fails issue the commandin the game console.
Code: Select all
quit
- [anchor]a2d2[/anchor]You now have to configure Warcraft 3 FT to access the SQLite database:
- [anchor]a2d2d1[/anchor]The Warcraft 3 FT configuration file is a text file and you will be editing it with your system text editor, either Notepad for Microsoft Windows, or vi for GNU Linux (your default editor might not be vi, so use the one you are used to, I'll be using vi for the remaining of this Mini-HOWTO, so replace where appropriate).
- [anchor]a2d2d2[/anchor]Locate your base directory for the game (don't ask me where it is, you installed the thing) and change to the AMX Mod X configuration folder.
- [anchor]a2d2d2d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows (replace <steam account> with your Steam login name and <game mod folder> with the game you are running, either "Counter-Strike\cstrike", "Condition Zero\czero", "Day of Defeat\dod", "Dedicated Server\cstrike", "Dedicated Server\czero" or "Dedicated Server\dod")
Code: Select all
cd "SteamApps\<steam account>\<game mod folder>\addons\amxmodx\configs"
- [anchor]a2d2d2d2[/anchor]Issue the following command in a shell for GNU Linux (replace <game mod> with the game you are running, either cstrike, czero or dod)
Code: Select all
cd <game mod>/addons/amxmodx/configs
- [anchor]a2d2d2d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows (replace <steam account> with your Steam login name and <game mod folder> with the game you are running, either "Counter-Strike\cstrike", "Condition Zero\czero", "Day of Defeat\dod", "Dedicated Server\cstrike", "Dedicated Server\czero" or "Dedicated Server\dod")
- [anchor]a2d2d3[/anchor]Edit the war3FT.cfg configuration file.
- [anchor]a2d2d3d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows
Code: Select all
notepad war3FT.cfg
- [anchor]a2d2d3d2[/anchor]Issue the following command in a shell for GNU Linux
Code: Select all
vi war3FT.cfg
- [anchor]a2d2d3d3[/anchor]Change the variable FT_mysql_db (yes FT_mysql_db is correct, all SQL related variables in Warcarft 3 FT reflect their inheritance of former MySQL only support) to point to where you want the database file to live (don't worry if it doesn't exist yet it will be created automatically). It is highly recommended to keep it in the "addons\amxmodx\data" directory, so edit the file to read as the following snippet of a changed war3FT.cfg (you can leave FT_mysql_host, FT_mysql_user and FT_mysql_pass with their default values since they are ignored by the SQLite module but you should set both mp_savexp and sv_mysql, you might also want to have a look at sv_mysql_save_end_round and/or at sv_mysql_auto_pruning and sv_daysbeforedelete)
Code: Select all
// Warcraft 3 Frozen Throne Configuration File // Note: NO MATTER WHAT, you must have [color=green]a database[/color] module running // even if you're not using it [color=green]mp_savexp 1[/color] // Enables saving of experience (uses a vault, default is 0) [color=green]sv_mysql 1[/color] // this will save w/MySQL (note: to use this mp_savexp must also be 1, default is 0) FT_saveby 0 // What should I save this as? steam id = 0, IP = 1, name = 2 (works for vault and mysql, default is 0) // MySQL configuration FT_mysql_host "127.0.0.1" // Host Name FT_mysql_user "root" // User Name FT_mysql_pass "" // Password [color=green]FT_mysql_db "addons/amxmodx/data/amxx.db"[/color] // Database Name sv_mysql_auto_pruning 0 // Automatically prunes the database of old users at a mapchange occuring between 5:36 to 5:59 AM (default is 0, doesn't work for vault) sv_daysbeforedelete 31 // However many days before deleting XP or pruning from MySQL database (default is 31) sv_mysqltablename "war3users" // Table Name, no need to change (default is war3users) sv_mysql_save_end_round 0 // Save Users at the end of each round (causes slight lag, default is 0) FT_disable_savexp 0 // Set this to 1 to disable users typing /savexp (default is 0)
- [anchor]a2d2d3d1[/anchor]Issue the following command in a Command Prompt for Microsoft Windows
- [anchor]a3d1[/anchor]If you don't have any Warcraft 3 FT XP you would like to convert to SQLite database format you can [goto=a4]wrap it up[/goto].
- [anchor]a3d2[/anchor]Preparing the database:
- [anchor]a3d2d1[/anchor]For Microsoft Windows start up the SQLite command-line program by issuing the following command in a Command Prompt (note that you must point to the exact same path where the [goto=a2d2d3d3]FT_mysql_db is pointing to[/goto], replace <steam folder> with the base path where you installed Steam, <steam account> with your Steam login name and <game mod folder> with the game you are running)
Code: Select all
sqlite3 "<steam folder>\SteamApps\<steam account>\<game mod folder>\addons\amxmodx\data\amxx.db"
- [anchor]a3d2d2[/anchor]For GNU Linux start up the SQLite command-line program by issuing the following command in a shell (note that you must point to the exact same path where the [goto=a2d2d3d3]FT_mysql_db is pointing to[/goto], replace <base dir> with the base path where you installed your dedicated server and <game mod> with the game you are running)
Code: Select all
sqlite3 "<base dir>/<game mod>/addons/amxmodx/data/amxx.db"
- [anchor]a3d2d3[/anchor]Create the Warcraft 3 FT XP table by issuing the following command in the SQLite interactive shell
Code: Select all
CREATE TABLE `war3users` (`playerid` VARCHAR(35) NOT NULL DEFAULT '', `playername` VARCHAR(35) NOT NULL DEFAULT '', `xp` INT(11) NOT NULL DEFAULT 0, `race` TINYINT(4) NOT NULL DEFAULT 0, `skill1` TINYINT(4) NOT NULL DEFAULT 0, `skill2` TINYINT(4) NOT NULL DEFAULT 0, `skill3` TINYINT(4) NOT NULL DEFAULT 0, `skill4` TINYINT(4) NOT NULL DEFAULT 0, `time` TIMESTAMP(14) NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`playerid`, `race`)) ;
- [anchor]a3d2d1[/anchor]For Microsoft Windows start up the SQLite command-line program by issuing the following command in a Command Prompt (note that you must point to the exact same path where the [goto=a2d2d3d3]FT_mysql_db is pointing to[/goto], replace <steam folder> with the base path where you installed Steam, <steam account> with your Steam login name and <game mod folder> with the game you are running)
- [anchor]a3d3[/anchor]Converting Warcraft 3 FT XP:
- [anchor]a3d3d1[/anchor]Converting from Files:
- [anchor]a3d3d1d1[/anchor]Populate the Warcraft 3 FT XP table with your players XP (you can find the values to enter in the following SQL statements in the vault.ini file in your AMX Mod X data directory)
- [anchor]a3d3d1d1d1[/anchor]If your server is running on Microsoft Windows you are really out of luck, you will have to do this by hand (and if so be aware that there might be hundreds of entries in your vault.ini) so issue the following commands in the SQLite interactive shell
Code: Select all
REPLACE INTO `war3users` (`playerid`, `playername`, `xp`, `race`, `skill1`, `skill2`, `skill3`, `skill4`) VALUES ('<1st user id>', '<1st user name>', <1st user XP>, <1st user race>, <1st user skill1 level>, <1st user skill2 level>, <1st user skill3 level>, <1st user skill4 level>) ; REPLACE INTO `war3users` (`playerid`, `playername`, `xp`, `race`, `skill1`, `skill2`, `skill3`, `skill4`) VALUES ('<2nd user id>', '<2nd user name>', <2nd user XP>, <2nd user race>, <2nd user skill1 level>, <2nd user skill2 level>, <2nd user skill3 level>, <2nd user skill4 level>) ; ... REPLACE INTO `war3users` (`playerid`, `playername`, `xp`, `race`, `skill1`, `skill2`, `skill3`, `skill4`) VALUES ('<last user id>', '<last user name>', <last user XP>, <last user race>, <last user skill1 level>, <last user skill2 level>, <last user skill3 level>, <last user skill4 level>) ;
- [anchor]a3d3d1d1d2[/anchor]If your server is running on GNU Linux you can either do as above for Microsoft Windows (recommended if you have 1 or 2 players) or you may exit the SQLite interactive shell (as indicated in the [goto=a3d3d1d2]next point[/goto]) and issue the following command in a shell (note that you must point to the exact same path where the [goto=a2d2d3d3]FT_mysql_db is pointing to[/goto], replace <base dir> with the base path where you installed your dedicated server and <game mod> with the game you are running)
Code: Select all
awk '{ if (/;|#|^ *$|\/\//) next ; if (NF != 14) next ; printf "REPLACE INTO `war3users` (`playerid`, `playername`, `xp`, `race`, `skill1`, `skill2`, `skill3`, `skill4`) VALUES (\"%s\", \"%s\", %s, %s, %s, %s, %s, %s);\n", substr($(NF-13), 0, length($(NF-13))-2), $(NF-5), $(NF-11), $(NF-10), $(NF-9), $(NF-8), $(NF-7), $(NF-6)}' <../data/vault.ini ||sqlite3 "<base dir>/<game mod>/addons/amxmodx/data/amxx.db"
- [anchor]a3d3d1d1d1[/anchor]If your server is running on Microsoft Windows you are really out of luck, you will have to do this by hand (and if so be aware that there might be hundreds of entries in your vault.ini) so issue the following commands in the SQLite interactive shell
- [anchor]a3d3d1d2[/anchor]Exit the SQLite interactive shell by issuing the following command (note the dot in the beginning of the command)
Code: Select all
.quit
- [anchor]a3d3d1d1[/anchor]Populate the Warcraft 3 FT XP table with your players XP (you can find the values to enter in the following SQL statements in the vault.ini file in your AMX Mod X data directory)
- [anchor]a3d3d2[/anchor]Converting from MySQL:
- [anchor]a3d3d2d1[/anchor]If you had your game server previously configured to save/restore your players XP to/from a database on a MySQL server you can convert it to SQLite:
- [anchor]a3d3d2d1d1[/anchor]Exit the SQLite interactive shell by issuing the following command (note the dot in the beginning of the command)
Code: Select all
.quit
- [anchor]a3d3d2d1d2[/anchor]For Microsoft Windows issue the following command in a Command Prompt (note that you must point to the exact same path where the [goto=a2d2d3d3]FT_mysql_db is pointing to[/goto], replace <steam folder> with the base path where you installed Steam, <steam account> with your Steam login name and <game mod folder> with the game you are running, replace <amxx user> with the username you configured AMX Mod X to access MySQL, <amxx user password> with the password you set for that user, <mysql hostname or IP> with the MySQL server IP or name and <amxx database> with the name of the database you have configured for the above user)
Code: Select all
mysqldump --compact --skip-opt --complete-insert --no-create-info --user=<amxx user> --password=<amxx user password> --host=<mysql hostname or IP> <amxx database> war3users |sqlite3 "<steam folder>\SteamApps\<steam account>\<game mod folder>\addons\amxmodx\data\amxx.db"
- [anchor]a3d3d2d1d3[/anchor]For GNU Linux issue the following command in a shell (note that you must point to the exact same path where the [goto=a2d2d3d3]FT_mysql_db is pointing to[/goto], replace <base dir> with the base path where you installed your dedicated server and <game mod> with the game you are running, replace <amxx user> with the username you configured AMX Mod X to access MySQL, <amxx user password> with the password you set for that user, <mysql hostname or IP> with the MySQL server IP or name and <amxx database> with the name of the database you have configured for the above user)
Code: Select all
mysqldump --compact --skip-opt --complete-insert --no-create-info --user=<amxx user> --password=<amxx user password> --host=<mysql hostname or IP> <amxx database> war3users |sqlite3 "<base dir>/<game mod>/addons/amxmodx/data/amxx.db"
- [anchor]a3d3d2d1d1[/anchor]Exit the SQLite interactive shell by issuing the following command (note the dot in the beginning of the command)
- [anchor]a3d3d2d1[/anchor]If you had your game server previously configured to save/restore your players XP to/from a database on a MySQL server you can convert it to SQLite:
- [anchor]a3d3d1[/anchor]Converting from Files:
- [anchor]a4d1[/anchor]You are done, it's now time to start your game server in the usual way for your system.
Edits:
- 2005-08-28 - fixed a bunch of typos in hyperlinks
- 2005-09-03 - changed the awk script to allow the ' character in names, by sugestion of anders_dog
- 2005-10-02 - changed the SQL CREATE statement to mirror the one in the plugin itself
- 2005-10-02 - added reference paths for a dedicated server install under Microsoft Windows