summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2009-10-24 20:54:43 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2009-10-24 20:54:43 +0200
commit9eeb927b991aef81bdc954be92cd061a835516e2 (patch)
tree3b739f040534a61673f2d52771d389d16a012217
parent19a7d334af71a1e70281d3b2b6602d291dd82960 (diff)
downloadmanaserv-9eeb927b991aef81bdc954be92cd061a835516e2.tar.gz
manaserv-9eeb927b991aef81bdc954be92cd061a835516e2.tar.xz
manaserv-9eeb927b991aef81bdc954be92cd061a835516e2.zip
Rebranding tmwserv to manaserv
Includes a database update. Use update_6_to_7.sql to update existing sqlite databases.
-rw-r--r--.gitignore14
-rw-r--r--README26
-rw-r--r--acinclude.m46
-rw-r--r--configure.ac10
-rw-r--r--docs/manaserv.xml (renamed from docs/tmwserv.xml)20
-rw-r--r--docs/scripting.txt4
-rw-r--r--docs/stats.txt2
-rw-r--r--src/Makefile.am14
-rw-r--r--src/account-server/dalstorage.cpp2
-rw-r--r--src/account-server/dalstoragesql.hpp70
-rw-r--r--src/account-server/main-account.cpp8
-rw-r--r--src/dal/mysqldataprovider.cpp6
-rw-r--r--src/dal/sqlitedataprovider.cpp2
-rw-r--r--src/game-server/main-game.cpp8
-rw-r--r--src/scripting/lua.cpp96
-rw-r--r--src/scripting/luascript.hpp2
-rw-r--r--src/sql/mysql/createDatabase.sql18
-rw-r--r--src/sql/mysql/createTables.sql122
-rw-r--r--src/sql/postgresql/createTables.sql64
-rw-r--r--src/sql/sqlite/createTables.sql216
-rw-r--r--src/sql/sqlite/updates/update_6_to_7.sql122
-rw-r--r--tools/monitor/main.cpp6
22 files changed, 479 insertions, 359 deletions
diff --git a/.gitignore b/.gitignore
index 26d1675..2865e17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,8 +21,8 @@ stamp-h1
*.moc
.dirstamp
tools/monitor/monitor
-src/tmwserv-account
-src/tmwserv-game
+src/manaserv-account
+src/manaserv-game
accountserver.exe
accountserver.depend
gameserver.exe
@@ -33,8 +33,8 @@ docs/api
doxygen_warnings.txt
# files generated during test/runtime
-tmw.db
-tmwserv-account.log
-tmwserv-game.log
-tmwserv.stats
-tmwserv.xml
+mana.db
+manaserv-account.log
+manaserv-game.log
+manaserv.stats
+manaserv.xml
diff --git a/README b/README
index a0d03e0..1348dac 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-Setting up a TMW server
-=======================
+Setting up a Mana server
+========================
COMPILATION
@@ -9,19 +9,19 @@ COMPILATION
The compilation should produce two binaries:
-* tmwserv-account - The account + chat server
-* tmwserv-game - The game server
+* manaserv-account - The account + chat server
+* manaserv-game - The game server
SERVER DATA
The server depends on parts of the client data and also has its own data
-repository. These are the 'tmwdata' and 'tmwserv-data' repositories.
-Currently, tmwserv expects these to be merged into a single 'data' directory.
+repository. These are the 'manadata' and 'manaserv-data' repositories.
+Currently, manaserv expects these to be merged into a single 'data' directory.
-1) Clone tmwdata and tmwserv-data next to the tmwserv repository
-2) Symlink a 'data' directory in tmwserv to tmwserv-data
-3) Symlink the following files from tmwserv-data to tmwdata:
+1) Clone manadata and manaserv-data next to the manaserv repository
+2) Symlink a 'data' directory in manaserv to manaserv-data
+3) Symlink the following files from manaserv-data to manadata:
* data/items.xml - Item definitions
* data/monsters.xml - Monster definitions
@@ -30,8 +30,8 @@ Currently, tmwserv expects these to be merged into a single 'data' directory.
CONFIGURATION
-The configuration is currently loaded from ~/.tmwserv.xml. An example file is
-located at docs/tmwserv.xml.
+The configuration is currently loaded from ~/.manaserv.xml. An example file is
+located at docs/manaserv.xml.
Default option values:
@@ -43,14 +43,14 @@ Default option values:
RUNNING
-1. Run tmwserv-account on one single computer. It will open three consecutive
+1. Run manaserv-account on one single computer. It will open three consecutive
UDP ports, starting from the one given by the configuration option
"accountServerPort". This first port is the one you should advertise to your
users. The configuration option "accountServerAddress" should contain the
public address the server runs on, as it will be sent to the users as the
address of the chat server, which happens to be the account server for now.
-2. Run tmwserv-game on multiple computers. Each game server will open one UDP
+2. Run manaserv-game on multiple computers. Each game server will open one UDP
port given by the configuration option "gameServerPort". It will also connect
to the account server given by the configuration options "accountServerAddress"
and "accountServerPort". The configuration option "gameServerAddress" should
diff --git a/acinclude.m4 b/acinclude.m4
index 8dc0426..00c0da9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,6 +1,6 @@
dnl $Id$
-dnl @synopsis AC_CHECK_LIB_TMW(
+dnl @synopsis AC_CHECK_LIB_MANA(
dnl LIBRARY
dnl [, MINIMUM-VERSION
dnl [, LIBRARY-CONFIG-EXE
@@ -20,7 +20,7 @@ dnl (In other words, it must be like gtk-config.)
dnl
dnl Example:
dnl
-dnl AC_CHECK_LIB_TMW(foo, 1.0.0)
+dnl AC_CHECK_LIB_MANA(foo, 1.0.0)
dnl
dnl would run `foo-config --version' and check that it is at least 1.0.0.
dnl
@@ -36,7 +36,7 @@ dnl as the script to execute instead of the default `foo-config`.
m4_include(ax_compare_version.m4)
-AC_DEFUN([AC_CHECK_LIB_TMW], [
+AC_DEFUN([AC_CHECK_LIB_MANA], [
dnl define macros to uppercase or lowercase a string.
pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
diff --git a/configure.ac b/configure.ac
index 842e4b6..f23279e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ(2.59)
-AC_INIT([TMW Server], [0.0.1], [themanaworld-devel@lists.sourceforge.net], [tmwserv])
+AC_INIT([Mana Server], [1.0.0], [themanaworld-devel@lists.sourceforge.net], [manaserv])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
@@ -56,17 +56,17 @@ AC_ARG_WITH(
if test "$with_storage_backend" = "mysql"; then
# use mysql_config to check libmysqlclient.
- # MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LIBS are set by AC_CHECK_LIB_TMW.
- AC_CHECK_LIB_TMW([mysqlclient], [4.1.0], [mysql_config])
+ # MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LIBS are set by AC_CHECK_LIB_MANA.
+ AC_CHECK_LIB_MANA([mysqlclient], [4.1.0], [mysql_config])
# update CXXFLAGS and LIBS.
CXXFLAGS="$CXXFLAGS -DMYSQL_SUPPORT $MYSQLCLIENT_CFLAGS"
LIBS="$LIBS $MYSQLCLIENT_LIBS"
elif test "$with_storage_backend" = "postgresql"; then
# use pg_config to check libpq.
- # PQ_CFLAGS and PQ_LIBS are set by AC_CHECK_LIB_TMW.
+ # PQ_CFLAGS and PQ_LIBS are set by AC_CHECK_LIB_MANA.
# NOTE: PQ_LIBS not set correctly
- AC_CHECK_LIB_TMW([pq], [7.0.0], [pg_config])
+ AC_CHECK_LIB_MANA([pq], [7.0.0], [pg_config])
# update CXXFLAGS and LIBS.
CXXFLAGS="$CXXFLAGS -DPOSTGRESQL_SUPPORT $PQ_CFLAGS"
diff --git a/docs/tmwserv.xml b/docs/manaserv.xml
index 40576e4..1e5d62a 100644
--- a/docs/tmwserv.xml
+++ b/docs/manaserv.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
- An example configuration file for ~/.tmwserv.xml
+ An example configuration file for ~/.manaserv.xml
If you add any parameters to this configuration file make sure to update
the wiki documentation at:
http://wiki.themanaworld.org/index.php/Configuration_file:tmwserv.xml
@@ -13,12 +13,12 @@
-->
<!--
- SQLite specific configuration.
+ SQLite specific configuration.
sqlite_database: name and path to the sqlite database file
- optional, default="tmw.db"
+ optional, default="mana.db"
-->
-<!-- <option name="sqlite_database" value="tmw.db"/> -->
+<!-- <option name="sqlite_database" value="mana.db"/> -->
<!--
@@ -29,18 +29,18 @@
mysql_port: the port where the mysql server listens to
optional, default=3306
mysql_database: name of the installed database
- optional, default="tmw"
+ optional, default="mana"
mysql_username: name of the user to connect to the database server
- optional, default="tmw"
+ optional, default="mana"
mysql_password: password to use whith the mysql_username
- optional, default="tmw"
+ optional, default="mana"
-->
<!--
<option name="mysql_hostname" value="localhost"/>
<option name="mysql_port" value="3306"/>
-<option name="mysql_database" value="tmw"/>
-<option name="mysql_username" value="tmw"/>
-<option name="mysql_password" value="tmw"/>
+<option name="mysql_database" value="mana"/>
+<option name="mysql_username" value="mana"/>
+<option name="mysql_password" value="mana"/>
-->
diff --git a/docs/scripting.txt b/docs/scripting.txt
index a70ab59..4f91c74 100644
--- a/docs/scripting.txt
+++ b/docs/scripting.txt
@@ -1,4 +1,4 @@
-The Mana World Scripting Specification - DRAFT v0.2
+Mana Scripting Specification - DRAFT v0.2
Generic scripting interfaces for various in-game objects.
@@ -66,4 +66,4 @@ Being Scripting:
Persistent Variables:
-- nym \ No newline at end of file
+- nym
diff --git a/docs/stats.txt b/docs/stats.txt
index 73daed3..b5cbedc 100644
--- a/docs/stats.txt
+++ b/docs/stats.txt
@@ -1,4 +1,4 @@
-The Mana World Statistics Specification - DRAFT v0.1
+Mana Statistics Specification - DRAFT v0.1
Currently this work is derived from work done on Wiki. This system
is simplified. Each being has core statistics which are used to
diff --git a/src/Makefile.am b/src/Makefile.am
index 83aeadd..0963553 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,8 @@
AUTOMAKE_OPTIONS = subdir-objects
-bin_PROGRAMS = tmwserv-account tmwserv-game
+bin_PROGRAMS = manaserv-account manaserv-game
-tmwserv_account_SOURCES = \
+manaserv_account_SOURCES = \
account-server/main-account.cpp \
defines.h \
protocol.h \
@@ -78,7 +78,7 @@ tmwserv_account_SOURCES = \
utils/xml.cpp \
utils/string.cpp
-tmwserv_game_SOURCES = \
+manaserv_game_SOURCES = \
game-server/main-game.cpp \
defines.h \
protocol.h \
@@ -184,25 +184,25 @@ tmwserv_game_SOURCES = \
utils/string.cpp
if BUILD_MYSQL
-tmwserv_account_SOURCES += \
+manaserv_account_SOURCES += \
dal/mysqldataprovider.h \
dal/mysqldataprovider.cpp
endif
if BUILD_POSTGRESQL
-tmwserv_account_SOURCES += \
+manaserv_account_SOURCES += \
dal/pqdataprovider.h \
dal/pqdataprovider.cpp
endif
if BUILD_SQLITE
-tmwserv_account_SOURCES += \
+manaserv_account_SOURCES += \
dal/sqlitedataprovider.h \
dal/sqlitedataprovider.cpp
endif
if BUILD_LUA
-tmwserv_game_SOURCES += \
+manaserv_game_SOURCES += \
scripting/lua.cpp \
scripting/luascript.cpp \
scripting/luascript.hpp \
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp
index 1f71d40..5ae557a 100644
--- a/src/account-server/dalstorage.cpp
+++ b/src/account-server/dalstorage.cpp
@@ -41,7 +41,7 @@
// defines the supported db version
#define DB_VERSION_PARAMETER "database_version"
-#define SUPPORTED_DB_VERSION "6"
+#define SUPPORTED_DB_VERSION "7"
/**
diff --git a/src/account-server/dalstoragesql.hpp b/src/account-server/dalstoragesql.hpp
index cab3aea..4607cfc 100644
--- a/src/account-server/dalstoragesql.hpp
+++ b/src/account-server/dalstoragesql.hpp
@@ -18,8 +18,8 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _TMWSERV_DALSTORAGE_SQL_H_
-#define _TMWSERV_DALSTORAGE_SQL_H_
+#ifndef _MANASERV_DALSTORAGE_SQL_H_
+#define _MANASERV_DALSTORAGE_SQL_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -60,92 +60,92 @@
/**
- * TABLE: tmw_accounts.
+ * TABLE: mana_accounts.
*/
-static const char *ACCOUNTS_TBL_NAME = "tmw_accounts";
+static const char *ACCOUNTS_TBL_NAME = "mana_accounts";
/**
- * TABLE: tmw_characters.
+ * TABLE: mana_characters.
* - gender is 0 for male, 1 for female.
*/
-static const char *CHARACTERS_TBL_NAME = "tmw_characters";
+static const char *CHARACTERS_TBL_NAME = "mana_characters";
/**
- * TABLE: tmw_char_skills.
+ * TABLE: mana_char_skills.
*/
-static const char *CHAR_SKILLS_TBL_NAME = "tmw_char_skills";
+static const char *CHAR_SKILLS_TBL_NAME = "mana_char_skills";
/**
- * TABLE: tmw_char_status_effects.
+ * TABLE: mana_char_status_effects.
*/
-static const char *CHAR_STATUS_EFFECTS_TBL_NAME = "tmw_char_status_effects";
+static const char *CHAR_STATUS_EFFECTS_TBL_NAME = "mana_char_status_effects";
/**
- * TABLE: tmw_inventories.
+ * TABLE: mana_inventories.
*/
-static const char *INVENTORIES_TBL_NAME("tmw_inventories");
+static const char *INVENTORIES_TBL_NAME("mana_inventories");
/**
- * TABLE: tmw_items.
+ * TABLE: mana_items.
*/
-static const char *ITEMS_TBL_NAME("tmw_items");
+static const char *ITEMS_TBL_NAME("mana_items");
/**
- * TABLE: tmw_guilds.
+ * TABLE: mana_guilds.
* Store player guilds
*/
-static const char *GUILDS_TBL_NAME = "tmw_guilds";
+static const char *GUILDS_TBL_NAME = "mana_guilds";
/**
- * TABLE: tmw_guild_members.
+ * TABLE: mana_guild_members.
* Store guild members
*/
-static const char *GUILD_MEMBERS_TBL_NAME = "tmw_guild_members";
+static const char *GUILD_MEMBERS_TBL_NAME = "mana_guild_members";
/**
- * TABLE: tmw_quests.
+ * TABLE: mana_quests.
*/
-static const char *QUESTS_TBL_NAME = "tmw_quests";
+static const char *QUESTS_TBL_NAME = "mana_quests";
/**
- * TABLE: tmw_world_states
+ * TABLE: mana_world_states
*/
-static const char *WORLD_STATES_TBL_NAME = "tmw_world_states";
+static const char *WORLD_STATES_TBL_NAME = "mana_world_states";
/**
- * TABLE: tmw_post
+ * TABLE: mana_post
* Store letters sent by characters
*/
-static const char *POST_TBL_NAME = "tmw_post";
+static const char *POST_TBL_NAME = "mana_post";
/**
- * TABLE: tmw_post_attachments
+ * TABLE: mana_post_attachments
* Store attachments per letter.
*/
-static const char *POST_ATTACHMENTS_TBL_NAME = "tmw_post_attachments";
+static const char *POST_ATTACHMENTS_TBL_NAME = "mana_post_attachments";
/**
- * TABLE: tmw_auctions
+ * TABLE: mana_auctions
* Store items auctions.
*/
-static const char *AUCTION_TBL_NAME = "tmw_auctions";
+static const char *AUCTION_TBL_NAME = "mana_auctions";
/**
- * TABLE: tmw_auction_bids
+ * TABLE: mana_auction_bids
* Store bids on auctions.
*/
-static const char *AUCTION_BIDS_TBL_NAME = "tmw_auction_bids";
+static const char *AUCTION_BIDS_TBL_NAME = "mana_auction_bids";
/**
- * TABLE: tmw_online_list
+ * TABLE: mana_online_list
* List currently online users.
*/
-static const char *ONLINE_USERS_TBL_NAME = "tmw_online_list";
+static const char *ONLINE_USERS_TBL_NAME = "mana_online_list";
/**
- * TABLE: tmw_transactions
+ * TABLE: mana_transactions
* Stores all transactions
*/
-static const char *TRANSACTION_TBL_NAME = "tmw_transactions";
+static const char *TRANSACTION_TBL_NAME = "mana_transactions";
-#endif // _TMWSERV_DALSTORAGE_SQL_H_
+#endif // _MANASERV_DALSTORAGE_SQL_H_
diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp
index 06c11c9..200e787 100644
--- a/src/account-server/main-account.cpp
+++ b/src/account-server/main-account.cpp
@@ -49,9 +49,9 @@
using utils::Logger;
// Default options that automake should be able to override.
-#define DEFAULT_LOG_FILE "tmwserv-account.log"
-#define DEFAULT_STATS_FILE "tmwserv.stats"
-#define DEFAULT_CONFIG_FILE "tmwserv.xml"
+#define DEFAULT_LOG_FILE "manaserv-account.log"
+#define DEFAULT_STATS_FILE "manaserv.stats"
+#define DEFAULT_CONFIG_FILE "manaserv.xml"
static bool running = true; /**< Determines if server keeps running */
@@ -254,7 +254,7 @@ static void dumpStatistics()
*/
static void printHelp()
{
- std::cout << "tmwserv" << std::endl << std::endl
+ std::cout << "manaserv" << std::endl << std::endl
<< "Options: " << std::endl
<< " -h --help : Display this help" << std::endl
<< " --verbosity <n> : Set the verbosity level" << std::endl
diff --git a/src/dal/mysqldataprovider.cpp b/src/dal/mysqldataprovider.cpp
index 008ffda..13a3002 100644
--- a/src/dal/mysqldataprovider.cpp
+++ b/src/dal/mysqldataprovider.cpp
@@ -34,9 +34,9 @@ const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD ="mysql_password";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_HOST_DEF = "localhost";
const unsigned int MySqlDataProvider::CFGPARAM_MYSQL_PORT_DEF = 3306;
-const std::string MySqlDataProvider::CFGPARAM_MYSQL_DB_DEF = "tmw";
-const std::string MySqlDataProvider::CFGPARAM_MYSQL_USER_DEF = "tmw";
-const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD_DEF = "tmw";
+const std::string MySqlDataProvider::CFGPARAM_MYSQL_DB_DEF = "mana";
+const std::string MySqlDataProvider::CFGPARAM_MYSQL_USER_DEF = "mana";
+const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD_DEF = "mana";
/**
* Constructor.
diff --git a/src/dal/sqlitedataprovider.cpp b/src/dal/sqlitedataprovider.cpp
index 463abd7..292b611 100644
--- a/src/dal/sqlitedataprovider.cpp
+++ b/src/dal/sqlitedataprovider.cpp
@@ -31,7 +31,7 @@ namespace dal
const std::string SqLiteDataProvider::CFGPARAM_SQLITE_DB = "sqlite_database";
-const std::string SqLiteDataProvider::CFGPARAM_SQLITE_DB_DEF = "tmw.db";
+const std::string SqLiteDataProvider::CFGPARAM_SQLITE_DB_DEF = "mana.db";
/**
diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp
index 5933671..07528ec 100644
--- a/src/game-server/main-game.cpp
+++ b/src/game-server/main-game.cpp
@@ -57,12 +57,12 @@
using utils::Logger;
// Default options that automake should be able to override.
-#define DEFAULT_LOG_FILE "tmwserv-game.log"
-#define DEFAULT_CONFIG_FILE "tmwserv.xml"
+#define DEFAULT_LOG_FILE "manaserv-game.log"
+#define DEFAULT_CONFIG_FILE "manaserv.xml"
#define DEFAULT_ITEMSDB_FILE "items.xml"
#define DEFAULT_MAPSDB_FILE "maps.xml"
#define DEFAULT_MONSTERSDB_FILE "monsters.xml"
-#define DEFAULT_STATUSDB_FILE "tmw-status-effect.xml"
+#define DEFAULT_STATUSDB_FILE "mana-status-effect.xml"
utils::Timer worldTimer(100, false); /**< Timer for world tics set to 100 ms */
int worldTime = 0; /**< Current world time in 100ms ticks */
@@ -226,7 +226,7 @@ void deinitialize()
*/
void printHelp()
{
- std::cout << "tmwserv" << std::endl << std::endl
+ std::cout << "manaserv" << std::endl << std::endl
<< "Options: " << std::endl
<< " -h --help : Display this help" << std::endl
<< " --verbosity <n> : Set the verbosity level" << std::endl
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index b17bc90..fc505eb 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -60,7 +60,7 @@ extern "C" {
/**
* Callback for sending a NPC_MESSAGE.
- * tmw.npc_message(npc, character, string)
+ * mana.npc_message(npc, character, string)
*/
static int npc_message(lua_State *s)
{
@@ -82,7 +82,7 @@ static int npc_message(lua_State *s)
/**
* Callback for sending a NPC_CHOICE.
- * tmw.npc_choice(npc, character, string...)
+ * mana.npc_choice(npc, character, string...)
*/
static int npc_choice(lua_State *s)
{
@@ -129,7 +129,7 @@ static int npc_choice(lua_State *s)
/**
* Callback for sending a NPC_INTEGER.
- * tmw.npc_integer(npc, character, min, max, defaut)
+ * mana.npc_integer(npc, character, min, max, defaut)
*/
static int npc_ask_integer(lua_State *s)
{
@@ -159,7 +159,7 @@ static int npc_ask_integer(lua_State *s)
/**
* Callback for sending a NPC_STRING.
- * tmw.npc_ask_string(npc, character)
+ * mana.npc_ask_string(npc, character)
*/
static int npc_ask_string(lua_State *s)
{
@@ -179,7 +179,7 @@ static int npc_ask_string(lua_State *s)
/**
* Callback for creating a NPC on the current map with the current script.
- * tmw.npc_create(string name, int id, int x, int y): npc
+ * mana.npc_create(string name, int id, int x, int y): npc
*/
static int npc_create(lua_State *s)
{
@@ -226,7 +226,7 @@ static int npc_end(lua_State *s)
/**
* Callback for sending a NPC_POST.
- * tmw.npc_post(npc, character)
+ * mana.npc_post(npc, character)
*/
static int npc_post(lua_State *s)
{
@@ -248,7 +248,7 @@ static int npc_post(lua_State *s)
/**
* Enable a NPC if it has previously disabled
- * tmw.npc_enable(npc)
+ * mana.npc_enable(npc)
*/
static int npc_enable(lua_State *s)
{
@@ -265,7 +265,7 @@ static int npc_enable(lua_State *s)
/**
* Disable a NPC
- * tmw.npc_disable(npc)
+ * mana.npc_disable(npc)
*/
static int npc_disable(lua_State *s)
{
@@ -281,7 +281,7 @@ static int npc_disable(lua_State *s)
/**
* Callback for warping a player to another place.
- * tmw.chr_warp(character, nil/int map, int x, int y)
+ * mana.chr_warp(character, nil/int map, int x, int y)
*/
static int chr_warp(lua_State *s)
{
@@ -344,7 +344,7 @@ static int chr_warp(lua_State *s)
* the function returns false. Otherwise the function will return true. When
* the item identifier is zero, money is modified.
* Note: If an insertion fails, extra items are dropped on the floor.
- * tmw.chr_inv_change(character, (int id, int nb)...): bool success
+ * mana.chr_inv_change(character, (int id, int nb)...): bool success
*/
static int chr_inv_change(lua_State *s)
{
@@ -410,7 +410,7 @@ static int chr_inv_change(lua_State *s)
/**
* Callback for counting items in inventory.
* When an item identifier is zero, money is queried.
- * tmw.chr_inv_count(character, int id...): int count...
+ * mana.chr_inv_count(character, int id...): int count...
*/
static int chr_inv_count(lua_State *s)
{
@@ -439,7 +439,7 @@ static int chr_inv_count(lua_State *s)
/**
* Callback for trading between a player and an NPC.
- * tmw.npc_trade(npc, character, bool sell, table items)
+ * mana.npc_trade(npc, character, bool sell, table items)
*/
static int npc_trade(lua_State *s)
{
@@ -482,7 +482,7 @@ static int npc_trade(lua_State *s)
/**
* Applies a status effect with id to the being given for a amount of time
- * tmw.being_apply_status(Being *being, int id, int time)
+ * mana.being_apply_status(Being *being, int id, int time)
*/
static int being_apply_status(lua_State *s)
@@ -501,7 +501,7 @@ static int being_apply_status(lua_State *s)
/**
* Removes the given status effect
- * tmw.being_remove_status(Being *being, int id)
+ * mana.being_remove_status(Being *being, int id)
*/
static int being_remove_status(lua_State *s)
{
@@ -517,7 +517,7 @@ static int being_remove_status(lua_State *s)
/**
* Returns true if a being has the given status effect
- * tmw.being_has_status(Being *being, int id)
+ * mana.being_has_status(Being *being, int id)
*/
static int being_has_status(lua_State *s)
{
@@ -533,7 +533,7 @@ static int being_has_status(lua_State *s)
/**
* Returns the time left on the given status effect
- * tmw.being_get_status_time(Being *being, int id)
+ * mana.being_get_status_time(Being *being, int id)
*/
static int being_get_status_time(lua_State *s)
{
@@ -549,7 +549,7 @@ static int being_get_status_time(lua_State *s)
/**
* Sets the time left on the given status effect
- * tmw.being_set_status_time(Being *being, int id)
+ * mana.being_set_status_time(Being *being, int id)
*/
static int being_set_status_time(lua_State *s)
{
@@ -566,7 +566,7 @@ static int being_set_status_time(lua_State *s)
/**
* Returns the Thing type of the given Being
- * tmw.being_type(Being *being)
+ * mana.being_type(Being *being)
*/
static int being_type(lua_State *s)
{
@@ -610,7 +610,7 @@ static int being_walk(lua_State *s)
/**
* Makes the being say something
- * tmw.being_say(source, message)
+ * mana.being_say(source, message)
*/
static int being_say(lua_State *s)
{
@@ -637,7 +637,7 @@ static int being_say(lua_State *s)
/**
* Applies combat damage to a being
- * tmw.being_damage(victim, value, delta, cth, type, element)
+ * mana.being_damage(victim, value, delta, cth, type, element)
*/
static int being_damage(lua_State *s)
{
@@ -660,7 +660,7 @@ static int being_damage(lua_State *s)
/**
* Gets the attribute for a being
- * tmw.being_get_attribute(being, attribute)
+ * mana.being_get_attribute(being, attribute)
*/
static int being_get_attribute(lua_State *s)
{
@@ -689,7 +689,7 @@ static int being_get_attribute(lua_State *s)
/**
* Gets the being's name
- * tmw.being_get_name(being)
+ * mana.being_get_name(being)
*/
static int being_get_name(lua_State *s)
{
@@ -708,7 +708,7 @@ static int being_get_name(lua_State *s)
/**
* Gets the being's current action
- * tmw.being_get_action(being)
+ * mana.being_get_action(being)
*/
static int being_get_action(lua_State *s)
{
@@ -727,7 +727,7 @@ static int being_get_action(lua_State *s)
/**
* Sets the being's current action
- * tmw.being_set_action(being, action)
+ * mana.being_set_action(being, action)
*/
static int being_set_action(lua_State *s)
{
@@ -748,7 +748,7 @@ static int being_set_action(lua_State *s)
/**
* Gets the being's current direction
- * tmw.being_get_direction(being)
+ * mana.being_get_direction(being)
*/
static int being_get_direction(lua_State *s)
{
@@ -767,7 +767,7 @@ static int being_get_direction(lua_State *s)
/**
* Sets the being's current direction
- * tmw.being_set_direction(being, direction)
+ * mana.being_set_direction(being, direction)
*/
static int being_set_direction(lua_State *s)
{
@@ -816,7 +816,7 @@ static int posY(lua_State *s)
/**
* Callback for creating a monster on the current map.
- * tmw.monster_create(int type, int x, int y)
+ * mana.monster_create(int type, int x, int y)
*/
static int monster_create(lua_State *s)
{
@@ -859,7 +859,7 @@ static int monster_create(lua_State *s)
}
/**
- * tmw.monster_load_script(mob, scriptfilename)
+ * mana.monster_load_script(mob, scriptfilename)
* loads a LUA script given for mob
*/
static int monster_load_script(lua_State *s)
@@ -886,7 +886,7 @@ static int monster_load_script(lua_State *s)
/**
* Callback for getting a quest variable. Starts a recovery and returns
* immediatly, if the variable is not known yet.
- * tmw.chr_get_chest(character, string): nil or string
+ * mana.chr_get_chest(character, string): nil or string
*/
static int chr_get_quest(lua_State *s)
{
@@ -919,7 +919,7 @@ static int chr_get_quest(lua_State *s)
/**
* Callback for setting a quest variable.
- * tmw.chr_set_chest(character, string, string)
+ * mana.chr_set_chest(character, string, string)
*/
static int chr_set_quest(lua_State *s)
{
@@ -938,7 +938,7 @@ static int chr_set_quest(lua_State *s)
/**
* Creates a trigger area. Whenever an actor enters this area, a Lua function
* is called.
- * tmw.trigger_create (x, y, width, height, function, id)
+ * mana.trigger_create (x, y, width, height, function, id)
*/
static int trigger_create(lua_State *s)
{
@@ -989,8 +989,8 @@ static int trigger_create(lua_State *s)
/**
* Creates a chat message in the users chatlog(s)
- * global message: tmw.chatmessage (message)
- * private massage: tmw.chatmessage (recipent, message)
+ * global message: mana.chatmessage (message)
+ * private massage: mana.chatmessage (recipent, message)
*/
static int chatmessage(lua_State *s)
{
@@ -1020,7 +1020,7 @@ static int chatmessage(lua_State *s)
/**
* Gets a LUA table with the being IDs of all beings
* inside of a circular area of the current map.
- * tmw.get_beings_in_circle (x, y, radius)
+ * mana.get_beings_in_circle (x, y, radius)
*/
static int get_beings_in_circle(lua_State *s)
{
@@ -1083,7 +1083,7 @@ static int chr_get_post(lua_State *s)
* Makes the server call the lua functions deathEvent
* and removeEvent when the being dies or is removed
* from the map.
- * tmw.being_register (being)
+ * mana.being_register (being)
*/
static int being_register(lua_State *s)
{
@@ -1110,8 +1110,8 @@ static int being_register(lua_State *s)
/**
* Triggers a special effect from the clients effects.xml
- * tmw.effect_create (id, x, y)
- * tmw.effect_create (id,being)
+ * mana.effect_create (id, x, y)
+ * mana.effect_create (id,being)
*/
static int effect_create(lua_State *s)
{
@@ -1153,7 +1153,7 @@ static int effect_create(lua_State *s)
/**
* Gets the exp total in a skill of a specific character
- * tmw.chr_get_exp (being, skill)
+ * mana.chr_get_exp (being, skill)
*/
static int chr_get_exp(lua_State *s)
{
@@ -1177,7 +1177,7 @@ static int chr_get_exp(lua_State *s)
* Gives the character a certain amount of experience points
* in a skill. Can also be used to reduce the exp amount when
* desired.
- * tmw.chr_give_exp (being, skill, amount)
+ * mana.chr_give_exp (being, skill, amount)
*/
static int chr_give_exp(lua_State *s)
{
@@ -1199,7 +1199,7 @@ static int chr_give_exp(lua_State *s)
/**
* Sets the given character's hair style to the given style id
- * tmw.chr_set_hair_style (character, styleid)
+ * mana.chr_set_hair_style (character, styleid)
*/
static int chr_set_hair_style(lua_State *s)
{
@@ -1225,7 +1225,7 @@ static int chr_set_hair_style(lua_State *s)
/**
* Gets the hair style of the given character
- * tmw.chr_get_hair_style (character)
+ * mana.chr_get_hair_style (character)
*/
static int chr_get_hair_style(lua_State *s)
{
@@ -1244,7 +1244,7 @@ static int chr_get_hair_style(lua_State *s)
/**
* Set the hair color of the given character to the given color id
- * tmw.chr_set_hair_color (character, colorid)
+ * mana.chr_set_hair_color (character, colorid)
*/
static int chr_set_hair_color(lua_State *s)
{
@@ -1270,7 +1270,7 @@ static int chr_set_hair_color(lua_State *s)
/**
* Get the hair color of the given character
- * tmw.chr_get_hair_color (character)
+ * mana.chr_get_hair_color (character)
*/
static int chr_get_hair_color(lua_State *s)
{
@@ -1289,7 +1289,7 @@ static int chr_get_hair_color(lua_State *s)
/**
* Returns the rights level of a character.
- * tmw.chr_get_rights (being)
+ * mana.chr_get_rights (being)
*/
static int chr_get_rights(lua_State *s)
{
@@ -1305,7 +1305,7 @@ static int chr_get_rights(lua_State *s)
/**
* Returns the exp total necessary to reach a specific skill level.
- * tmw.exp_for_level (level)
+ * mana.exp_for_level (level)
*/
static int exp_for_level(lua_State *s)
{
@@ -1389,7 +1389,7 @@ static int get_map_id(lua_State *s)
/**
* Creates an item stack on the floor
- * tmw.drop_item(x, y, id[, number])
+ * mana.drop_item(x, y, id[, number])
*/
static int item_drop(lua_State *s)
{
@@ -1492,7 +1492,7 @@ LuaScript::LuaScript():
{ "npc_ask_string", &npc_ask_string },
{ NULL, NULL }
};
- luaL_register(mState, "tmw", callbacks);
+ luaL_register(mState, "mana", callbacks);
// Make script object available to callback functions.
lua_pushlightuserdata(mState, (void *)&registryKey);
@@ -1500,6 +1500,6 @@ LuaScript::LuaScript():
lua_settable(mState, LUA_REGISTRYINDEX);
lua_settop(mState, 0);
- loadFile("scripts/libs/libtmw.lua");
+ loadFile("scripts/libs/libmana.lua");
}
diff --git a/src/scripting/luascript.hpp b/src/scripting/luascript.hpp
index 398fbec..b5590cf 100644
--- a/src/scripting/luascript.hpp
+++ b/src/scripting/luascript.hpp
@@ -37,7 +37,7 @@ class LuaScript: public Script
public:
/**
* Constructor. Initializes a new Lua state, registers the native API
- * and loads the libtmw.lua file.
+ * and loads the libmana.lua file.
*/
LuaScript();
diff --git a/src/sql/mysql/createDatabase.sql b/src/sql/mysql/createDatabase.sql
index c40aa24..2a8ce6b 100644
--- a/src/sql/mysql/createDatabase.sql
+++ b/src/sql/mysql/createDatabase.sql
@@ -1,5 +1,5 @@
/*
- * The Mana World Server
+ * The Mana Server
* Copyright 2008 The Mana World Development Team
*
* This file is part of The Mana World.
@@ -16,19 +16,17 @@
* You should have received a copy of the GNU General Public License along
* with The Mana World; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id$
*/
-CREATE USER 'tmw'@'%' IDENTIFIED BY 'testtest';
-CREATE USER 'tmw'@'localhost' IDENTIFIED BY 'testtest';
+CREATE USER 'mana'@'%' IDENTIFIED BY 'testtest';
+CREATE USER 'mana'@'localhost' IDENTIFIED BY 'testtest';
-GRANT USAGE ON * . * TO 'tmw'@'%' IDENTIFIED BY 'testtest'
+GRANT USAGE ON * . * TO 'mana'@'%' IDENTIFIED BY 'testtest'
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
-GRANT USAGE ON * . * TO 'tmw'@'localhost' IDENTIFIED BY 'testtest'
+GRANT USAGE ON * . * TO 'mana'@'localhost' IDENTIFIED BY 'testtest'
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
-CREATE DATABASE IF NOT EXISTS `tmw` ;
+CREATE DATABASE IF NOT EXISTS `mana` ;
-GRANT ALL PRIVILEGES ON `tmw` . * TO 'tmw'@'%';
-GRANT ALL PRIVILEGES ON `tmw` . * TO 'tmw'@'localhost';
+GRANT ALL PRIVILEGES ON `mana` . * TO 'mana'@'%';
+GRANT ALL PRIVILEGES ON `mana` . * TO 'mana'@'localhost';
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 9d6a738..98fbbcc 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -1,8 +1,8 @@
--
--- table: `tmw_accounts`
+-- table: `mana_accounts`
--
-CREATE TABLE IF NOT EXISTS `tmw_accounts` (
+CREATE TABLE IF NOT EXISTS `mana_accounts` (
`id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(64) NOT NULL,
`password` varchar(64) NOT NULL,
@@ -20,13 +20,13 @@ DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_characters`
+-- table: `mana_characters`
--
-CREATE TABLE IF NOT EXISTS `tmw_characters` (
+CREATE TABLE IF NOT EXISTS `mana_characters` (
`id` int(10) unsigned NOT NULL auto_increment,
`user_id` int(10) unsigned NOT NULL,
- `name` varchar(32) NOT NULL,
+ `name` varchar(32) NOT NULL,
--
`gender` tinyint(3) unsigned NOT NULL,
`hair_style` tinyint(3) unsigned NOT NULL,
@@ -51,38 +51,38 @@ CREATE TABLE IF NOT EXISTS `tmw_characters` (
UNIQUE KEY `name` (`name`),
KEY `user_id` (`user_id`),
FOREIGN KEY (`user_id`)
- REFERENCES `tmw_accounts` (`id`)
+ REFERENCES `mana_accounts` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_char_skills`
+-- table: `mana_char_skills`
--
-CREATE TABLE IF NOT EXISTS `tmw_char_skills` (
+CREATE TABLE IF NOT EXISTS `mana_char_skills` (
`char_id` int(10) unsigned NOT NULL,
`skill_id` smallint(5) unsigned NOT NULL,
`skill_exp` smallint(5) unsigned NOT NULL,
--
PRIMARY KEY (`char_id`, `skill_id`),
FOREIGN KEY (`char_id`)
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
--
--- table: `tmw_char_status_effects`
+-- table: `mana_char_status_effects`
--
-CREATE TABLE IF NOT EXISTS `tmw_char_status_effects` (
+CREATE TABLE IF NOT EXISTS `mana_char_status_effects` (
`char_id` int(10) unsigned NOT NULL,
`status_id` smallint(5) unsigned NOT NULL,
`status_time` int(10) signed NOT NULL,
--
PRIMARY KEY (`char_id`, `status_id`),
FOREIGN KEY (`char_id`)
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGING=InnoDB
DEFAULT CHARSET=utf8;
@@ -91,9 +91,9 @@ DEFAULT CHARSET=utf8;
--
--- table: `tmw_items`
+-- table: `mana_items`
--
-CREATE TABLE IF NOT EXISTS `tmw_items` (
+CREATE TABLE IF NOT EXISTS `mana_items` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL,
`description` varchar(255) NOT NULL,
@@ -110,24 +110,24 @@ DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_item_instances`
+-- table: `mana_item_instances`
--
-CREATE TABLE IF NOT EXISTS `tmw_item_instances` (
+CREATE TABLE IF NOT EXISTS `mana_item_instances` (
`item_id` int(10) unsigned NOT NULL auto_increment,
`itemclass_id` int(10) unsigned NOT NULL,
`amount` tinyint(3) unsigned NOT NULL,
--
PRIMARY KEY (`item_id`),
FOREIGN KEY (`itemclass_id`)
- REFERENCES `tmw_items` (`id`)
+ REFERENCES `mana_items` (`id`)
) ENGINE=InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_item_attributes`
+-- table: `mana_item_attributes`
--
-CREATE TABLE IF NOT EXISTS `tmw_item_attributes` (
+CREATE TABLE IF NOT EXISTS `mana_item_attributes` (
`attribute_id` int(10) unsigned NOT NULL auto_increment,
`item_id` int(10) unsigned NOT NULL,
`attribute_class` tinyint(3) unsigned NOT NULL,
@@ -135,17 +135,17 @@ CREATE TABLE IF NOT EXISTS `tmw_item_attributes` (
--
PRIMARY KEY (`attribute_id`),
FOREIGN KEY (`item_id`)
- REFERENCES `tmw_item_instances` (`item_id`)
+ REFERENCES `mana_item_instances` (`item_id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_inventories`
--- todo: remove class_id and amount and reference on tmw_item_instances
+-- table: `mana_inventories`
+-- todo: remove class_id and amount and reference on mana_item_instances
--
-CREATE TABLE IF NOT EXISTS `tmw_inventories` (
+CREATE TABLE IF NOT EXISTS `mana_inventories` (
`id` int(10) unsigned NOT NULL auto_increment,
`owner_id` int(10) unsigned NOT NULL,
`slot` tinyint(3) unsigned NOT NULL,
@@ -155,16 +155,16 @@ CREATE TABLE IF NOT EXISTS `tmw_inventories` (
PRIMARY KEY (`id`),
UNIQUE KEY `owner_id` (`owner_id`, `slot`),
FOREIGN KEY (`owner_id`)
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_world_states`
+-- table: `mana_world_states`
--
-CREATE TABLE IF NOT EXISTS `tmw_world_states` (
+CREATE TABLE IF NOT EXISTS `mana_world_states` (
`state_name` varchar(100) NOT NULL,
`map_id` int(10) unsigned default NULL,
`value` varchar(255) default NULL,
@@ -174,14 +174,14 @@ CREATE TABLE IF NOT EXISTS `tmw_world_states` (
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
-INSERT INTO tmw_world_states VALUES('accountserver_startup',NULL,NULL,UNIX_TIMESTAMP());
-INSERT INTO tmw_world_states VALUES('accountserver_version',NULL,NULL,UNIX_TIMESTAMP());
-INSERT INTO tmw_world_states VALUES('database_version', NULL,'3', UNIX_TIMESTAMP());
+INSERT INTO mana_world_states VALUES('accountserver_startup',NULL,NULL,UNIX_TIMESTAMP());
+INSERT INTO mana_world_states VALUES('accountserver_version',NULL,NULL,UNIX_TIMESTAMP());
+INSERT INTO mana_world_states VALUES('database_version', NULL,'3', UNIX_TIMESTAMP());
--
--- table: `tmw_guilds`
+-- table: `mana_guilds`
--
-CREATE TABLE IF NOT EXISTS `tmw_guilds` (
+CREATE TABLE IF NOT EXISTS `mana_guilds` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(35) NOT NULL,
--
@@ -192,44 +192,44 @@ DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_guild_members`
+-- table: `mana_guild_members`
--
-CREATE TABLE IF NOT EXISTS `tmw_guild_members` (
+CREATE TABLE IF NOT EXISTS `mana_guild_members` (
`guild_id` int(10) unsigned NOT NULL,
`member_id` int(10) unsigned NOT NULL,
`rights` int(10) unsigned NOT NULL,
--
PRIMARY KEY (`guild_id`, `member_id`),
FOREIGN KEY (`guild_id`)
- REFERENCES `tmw_guilds` (`id`)
+ REFERENCES `mana_guilds` (`id`)
ON DELETE CASCADE,
FOREIGN KEY (`member_id`)
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
--
--- table: `tmw_quests`
+-- table: `mana_quests`
--
-CREATE TABLE IF NOT EXISTS `tmw_quests` (
+CREATE TABLE IF NOT EXISTS `mana_quests` (
`owner_id` int(10) unsigned NOT NULL,
`name` varchar(100) NOT NULL,
`value` varchar(200) NOT NULL,
--
PRIMARY KEY (`owner_id`, `name`),
FOREIGN KEY (`owner_id`)
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
--
--- table: `tmw_auctions`
+-- table: `mana_auctions`
--
-CREATE TABLE IF NOT EXISTS `tmw_auctions` (
+CREATE TABLE IF NOT EXISTS `mana_auctions` (
`auction_id` int(10) unsigned NOT NULL auto_increment,
`auction_state` tinyint(3) unsigned NOT NULL,
`char_id` int(10) unsigned NOT NULL,
@@ -247,17 +247,17 @@ CREATE TABLE IF NOT EXISTS `tmw_auctions` (
KEY (`itemclass_id`),
KEY (`char_id`),
FOREIGN KEY (`char_id`)
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_auction_bids`
+-- table: `mana_auction_bids`
--
-CREATE TABLE IF NOT EXISTS `tmw_auction_bids` (
+CREATE TABLE IF NOT EXISTS `mana_auction_bids` (
`bid_id` int(10) unsigned NOT NULL auto_increment,
`auction_id` int(10) unsigned NOT NULL,
`char_id` int(10) unsigned NOT NULL,
@@ -268,17 +268,17 @@ CREATE TABLE IF NOT EXISTS `tmw_auction_bids` (
KEY (`auction_id`),
KEY (`char_id`),
FOREIGN KEY (`char_id`)
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_post`
+-- table: `mana_post`
--
-CREATE TABLE IF NOT EXISTS `tmw_post` (
+CREATE TABLE IF NOT EXISTS `mana_post` (
`letter_id` int(10) unsigned NOT NULL auto_increment,
`sender_id` int(10) unsigned NOT NULL,
`receiver_id` int(10) unsigned NOT NULL,
@@ -292,20 +292,20 @@ CREATE TABLE IF NOT EXISTS `tmw_post` (
INDEX `fk_letter_receiver` (`receiver_id` ASC) ,
--
FOREIGN KEY (`sender_id` )
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE,
FOREIGN KEY (`receiver_id` )
- REFERENCES `tmw_characters` (`id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE = InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_post_attachements`
+-- table: `mana_post_attachements`
--
-CREATE TABLE IF NOT EXISTS `tmw_post_attachments` (
+CREATE TABLE IF NOT EXISTS `mana_post_attachments` (
`attachment_id` int(10) unsigned NOT NULL auto_increment,
`letter_id` int(10) unsigned NOT NULL,
`item_id` int(10) unsigned NOT NULL,
@@ -315,32 +315,32 @@ CREATE TABLE IF NOT EXISTS `tmw_post_attachments` (
INDEX `fk_attachment_item` (`item_id` ASC),
--
FOREIGN KEY (`letter_id` )
- REFERENCES `tmw_post` (`letter_id`)
+ REFERENCES `mana_post` (`letter_id`)
ON DELETE CASCADE,
FOREIGN KEY (`item_id` )
- REFERENCES `tmw_item_instances` (`item_id`)
+ REFERENCES `mana_item_instances` (`item_id`)
ON DELETE RESTRICT
) ENGINE = InnoDB
DEFAULT CHARSET=utf8
AUTO_INCREMENT=1 ;
--
--- table: `tmw_online_list`
+-- table: `mana_online_list`
--
-CREATE TABLE IF NOT EXISTS `tmw_online_list` (
+CREATE TABLE IF NOT EXISTS `mana_online_list` (
`char_id` int(10) unsigned NOT NULL,
`login_date` int(10) NOT NULL,
--
PRIMARY KEY (`char_id`),
- FOREIGN KEY (`char_id`)
- REFERENCES `tmw_characters` (`id`)
+ FOREIGN KEY (`char_id`)
+ REFERENCES `mana_characters` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8 ;
-- create a view to show more details about online users
-CREATE VIEW tmw_v_online_chars
+CREATE VIEW mana_v_online_chars
AS
SELECT l.char_id as char_id,
l.login_date as login_date,
@@ -349,12 +349,12 @@ AS
c.gender as gender,
c.level as level,
c.map_id as map_id
- FROM tmw_online_list l
- JOIN tmw_characters c
+ FROM mana_online_list l
+ JOIN mana_characters c
ON l.char_id = c.id;
-
-CREATE TABLE IF NOT EXISTS `tmw_transactions` (
+
+CREATE TABLE IF NOT EXISTS `mana_transactions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`char_id` int(11) NOT NULL,
`action` int(11) NOT NULL,
diff --git a/src/sql/postgresql/createTables.sql b/src/sql/postgresql/createTables.sql
index 0d95f38..6767fff 100644
--- a/src/sql/postgresql/createTables.sql
+++ b/src/sql/postgresql/createTables.sql
@@ -1,19 +1,19 @@
-CREATE TABLE tmw_accounts
-(
- id SERIAL PRIMARY KEY,
- username TEXT NOT NULL UNIQUE,
- password TEXT NOT NULL,
- email TEXT NOT NULL,
- level SMALLINT NOT NULL,
- banned SMALLINT NOT NULL,
- registration INTEGER NOT NULL,
- lastlogin INTEGER NOT NULL
+CREATE TABLE mana_accounts
+(
+ id SERIAL PRIMARY KEY,
+ username TEXT NOT NULL UNIQUE,
+ password TEXT NOT NULL,
+ email TEXT NOT NULL,
+ level SMALLINT NOT NULL,
+ banned SMALLINT NOT NULL,
+ registration INTEGER NOT NULL,
+ lastlogin INTEGER NOT NULL
);
-CREATE INDEX tmw_accounts_username ON tmw_accounts ( username );
+CREATE INDEX mana_accounts_username ON mana_accounts ( username );
-CREATE TABLE tmw_characters
+CREATE TABLE mana_characters
(
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL,
@@ -46,10 +46,10 @@ CREATE TABLE tmw_characters
axe_exp INTEGER NOT NULL,
thrown_exp INTEGER NOT NULL,
--
- FOREIGN KEY (user_id) REFERENCES tmw_accounts(id)
+ FOREIGN KEY (user_id) REFERENCES mana_accounts(id)
);
-CREATE TABLE tmw_inventories
+CREATE TABLE mana_inventories
(
id SERIAL PRIMARY KEY,
owner_id INTEGER NOT NULL,
@@ -57,46 +57,46 @@ CREATE TABLE tmw_inventories
class_id INTEGER NOT NULL,
amount SMALLINT NOT NULL,
--
- FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
);
-CREATE TABLE tmw_guilds
+CREATE TABLE mana_guilds
(
id SERIAL PRIMARY KEY,
- name TEXT NOT NULL UNIQUE
+ name TEXT NOT NULL UNIQUE
);
-CREATE TABLE tmw_guild_members
+CREATE TABLE mana_guild_members
(
guild_id INTEGER NOT NULL,
member_id INTEGER NOT NULL,
rights INTEGER NOT NULL,
--
- FOREIGN KEY (guild_id) REFERENCES tmw_guilds(id),
- FOREIGN KEY (member_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (guild_id) REFERENCES mana_guilds(id),
+ FOREIGN KEY (member_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_guild_members_g ON tmw_guild_members ( guild_id );
-CREATE INDEX tmw_guild_members_m ON tmw_guild_members ( member_id );
+CREATE INDEX mana_guild_members_g ON mana_guild_members ( guild_id );
+CREATE INDEX mana_guild_members_m ON mana_guild_members ( member_id );
-CREATE TABLE tmw_quests
+CREATE TABLE mana_quests
(
owner_id INTEGER NOT NULL,
name TEXT NOT NULL,
value TEXT NOT NULL,
--
- FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
);
-CREATE TABLE tmw_world_states
-(
- state_name TEXT PRIMARY KEY,
- map_id INTEGER NULL,
- value TEXT NULL,
- moddate INTEGER NOT NULL
+CREATE TABLE mana_world_states
+(
+ state_name TEXT PRIMARY KEY,
+ map_id INTEGER NULL,
+ value TEXT NULL,
+ moddate INTEGER NOT NULL
);
-INSERT INTO "tmw_world_states" VALUES('accountserver_startup',NULL,NULL,1221633910);
-INSERT INTO "tmw_world_states" VALUES('accountserver_version',NULL,NULL,1221633910);
+INSERT INTO "mana_world_states" VALUES('accountserver_startup',NULL,NULL,1221633910);
+INSERT INTO "mana_world_states" VALUES('accountserver_version',NULL,NULL,1221633910);
diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql
index d71858f..9de3af3 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -1,5 +1,5 @@
--
--- The Mana World Server
+-- The Mana Server
-- Copyright 2009 The Mana World Development Team
--
-- This file is part of The Mana World.
@@ -22,7 +22,7 @@
-- Tables
-----------------------------------------------------------------------------
-CREATE TABLE tmw_accounts
+CREATE TABLE mana_accounts
(
id INTEGER PRIMARY KEY,
username TEXT NOT NULL UNIQUE,
@@ -36,12 +36,12 @@ CREATE TABLE tmw_accounts
expiration INTEGER NULL
);
-CREATE UNIQUE INDEX tmw_accounts_username ON tmw_accounts ( username );
-CREATE UNIQUE INDEX tmw_accounts_email ON tmw_accounts ( email );
+CREATE UNIQUE INDEX mana_accounts_username ON mana_accounts ( username );
+CREATE UNIQUE INDEX mana_accounts_email ON mana_accounts ( email );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_characters
+CREATE TABLE mana_characters
(
id INTEGER PRIMARY KEY,
user_id INTEGER NOT NULL,
@@ -63,41 +63,41 @@ CREATE TABLE tmw_characters
int INTEGER NOT NULL,
will INTEGER NOT NULL,
--
- FOREIGN KEY (user_id) REFERENCES tmw_accounts(id)
+ FOREIGN KEY (user_id) REFERENCES mana_accounts(id)
);
-CREATE INDEX tmw_characters_user ON tmw_characters ( user_id );
-CREATE UNIQUE INDEX tmw_characters_name ON tmw_characters ( name );
+CREATE INDEX mana_characters_user ON mana_characters ( user_id );
+CREATE UNIQUE INDEX mana_characters_name ON mana_characters ( name );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_char_skills
+CREATE TABLE mana_char_skills
(
char_id INTEGER NOT NULL,
skill_id INTEGER NOT NULL,
skill_exp INTEGER NOT NULL,
--
- FOREIGN KEY (char_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (char_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_char_skills_char ON tmw_char_skills ( char_id );
+CREATE INDEX mana_char_skills_char ON mana_char_skills ( char_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_char_status_effects
+CREATE TABLE mana_char_status_effects
(
char_id INTEGER NOT NULL,
status_id INTEGER NOT NULL,
status_time INTEGER NOT NULL,
--
- FOREIGN KEY (char_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (char_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_char_status_char on tmw_char_status_effects ( char_id );
+CREATE INDEX mana_char_status_char on mana_char_status_effects ( char_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_items
+CREATE TABLE mana_items
(
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
@@ -109,39 +109,39 @@ CREATE TABLE tmw_items
dyestring TEXT
);
-CREATE INDEX tmw_items_type ON tmw_items (itemtype);
+CREATE INDEX mana_items_type ON mana_items (itemtype);
-----------------------------------------------------------------------------
-CREATE TABLE tmw_item_instances
+CREATE TABLE mana_item_instances
(
item_id INTEGER PRIMARY KEY,
itemclass_id INTEGER NOT NULL,
amount INTEGER NOT NULL,
--
- FOREIGN KEY (itemclass_id) REFERENCES tmw_items(id)
+ FOREIGN KEY (itemclass_id) REFERENCES mana_items(id)
);
-CREATE INDEX tmw_item_instances_typ ON tmw_item_instances ( itemclass_id );
+CREATE INDEX mana_item_instances_typ ON mana_item_instances ( itemclass_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_item_attributes
+CREATE TABLE mana_item_attributes
(
attribute_id INTEGER PRIMARY KEY,
item_id INTEGER NOT NULL,
attribute_class INTEGER NOT NULL,
attribute_value TEXT,
--
- FOREIGN KEY (item_id) REFERENCES tmw_item_instances(item_id)
+ FOREIGN KEY (item_id) REFERENCES mana_item_instances(item_id)
);
-CREATE INDEX tmw_item_attributes_item ON tmw_item_attributes ( item_id );
+CREATE INDEX mana_item_attributes_item ON mana_item_attributes ( item_id );
-----------------------------------------------------------------------------
--- todo: remove class_id and amount and reference on tmw_item_instances
-CREATE TABLE tmw_inventories
+-- todo: remove class_id and amount and reference on mana_item_instances
+CREATE TABLE mana_inventories
(
id INTEGER PRIMARY KEY,
owner_id INTEGER NOT NULL,
@@ -149,14 +149,14 @@ CREATE TABLE tmw_inventories
class_id INTEGER NOT NULL,
amount INTEGER NOT NULL,
--
- FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_inventories_owner ON tmw_inventories ( owner_id );
+CREATE INDEX mana_inventories_owner ON mana_inventories ( owner_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_guilds
+CREATE TABLE mana_guilds
(
id INTEGER PRIMARY KEY,
name TEXT NOT NULL UNIQUE
@@ -164,33 +164,33 @@ CREATE TABLE tmw_guilds
-----------------------------------------------------------------------------
-CREATE TABLE tmw_guild_members
+CREATE TABLE mana_guild_members
(
guild_id INTEGER NOT NULL,
member_id INTEGER NOT NULL,
rights INTEGER NOT NULL,
--
- FOREIGN KEY (guild_id) REFERENCES tmw_guilds(id),
- FOREIGN KEY (member_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (guild_id) REFERENCES mana_guilds(id),
+ FOREIGN KEY (member_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_guild_members_g ON tmw_guild_members ( guild_id );
-CREATE INDEX tmw_guild_members_m ON tmw_guild_members ( member_id );
+CREATE INDEX mana_guild_members_g ON mana_guild_members ( guild_id );
+CREATE INDEX mana_guild_members_m ON mana_guild_members ( member_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_quests
+CREATE TABLE mana_quests
(
owner_id INTEGER NOT NULL,
name TEXT NOT NULL,
value TEXT NOT NULL,
--
- FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
);
-----------------------------------------------------------------------------
-CREATE TABLE tmw_world_states
+CREATE TABLE mana_world_states
(
state_name TEXT PRIMARY KEY,
map_id INTEGER NULL,
@@ -200,7 +200,7 @@ CREATE TABLE tmw_world_states
-----------------------------------------------------------------------------
-CREATE TABLE tmw_auctions
+CREATE TABLE mana_auctions
(
auction_id INTEGER PRIMARY KEY,
auction_state INTEGER NOT NULL,
@@ -214,16 +214,16 @@ CREATE TABLE tmw_auctions
buyout_price INTEGER,
description TEXT,
--
- FOREIGN KEY (char_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (char_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_auctions_owner ON tmw_auctions ( char_id );
-CREATE INDEX tmw_auctions_state ON tmw_auctions ( auction_state );
-CREATE INDEX tmw_auctions_item ON tmw_auctions ( itemclass_id );
+CREATE INDEX mana_auctions_owner ON mana_auctions ( char_id );
+CREATE INDEX mana_auctions_state ON mana_auctions ( auction_state );
+CREATE INDEX mana_auctions_item ON mana_auctions ( itemclass_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_auction_bids
+CREATE TABLE mana_auction_bids
(
bid_id INTEGER PRIMARY KEY,
auction_id INTEGER NOT NULL,
@@ -231,16 +231,16 @@ CREATE TABLE tmw_auction_bids
bid_time INTEGER NOT NULL,
bid_price INTEGER NOT NULL,
--
- FOREIGN KEY (auction_id) REFERENCES tmw_auctions(auction_id),
- FOREIGN KEY (char_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (auction_id) REFERENCES mana_auctions(auction_id),
+ FOREIGN KEY (char_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_auction_bids_auction ON tmw_auction_bids ( auction_id );
-CREATE INDEX tmw_auction_bids_owner ON tmw_auction_bids ( char_id );
+CREATE INDEX mana_auction_bids_auction ON mana_auction_bids ( auction_id );
+CREATE INDEX mana_auction_bids_owner ON mana_auction_bids ( char_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_post
+CREATE TABLE mana_post
(
letter_id INTEGER PRIMARY KEY,
sender_id INTEGER NOT NULL,
@@ -250,42 +250,42 @@ CREATE TABLE tmw_post
sending_date INTEGER NOT NULL,
letter_text TEXT NULL,
--
- FOREIGN KEY (sender_id) REFERENCES tmw_characters(id),
- FOREIGN KEY (receiver_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (sender_id) REFERENCES mana_characters(id),
+ FOREIGN KEY (receiver_id) REFERENCES mana_characters(id)
);
-CREATE INDEX tmw_post_sender ON tmw_post ( sender_id );
-CREATE INDEX tmw_post_receiver ON tmw_post ( receiver_id );
+CREATE INDEX mana_post_sender ON mana_post ( sender_id );
+CREATE INDEX mana_post_receiver ON mana_post ( receiver_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_post_attachments
+CREATE TABLE mana_post_attachments
(
attachment_id INTEGER PRIMARY KEY,
letter_id INTEGER NOT NULL,
item_id INTEGER NOT NULL,
--
- FOREIGN KEY (letter_id) REFERENCES tmw_post(letter_id),
- FOREIGN KEY (item_id) REFERENCES tmw_item_instances(item_id)
+ FOREIGN KEY (letter_id) REFERENCES mana_post(letter_id),
+ FOREIGN KEY (item_id) REFERENCES mana_item_instances(item_id)
);
-CREATE INDEX tmw_post_attachments_ltr ON tmw_post_attachments ( letter_id );
-CREATE INDEX tmw_post_attachments_itm ON tmw_post_attachments ( item_id );
+CREATE INDEX mana_post_attachments_ltr ON mana_post_attachments ( letter_id );
+CREATE INDEX mana_post_attachments_itm ON mana_post_attachments ( item_id );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_transaction_codes
+CREATE TABLE mana_transaction_codes
(
id INTEGER PRIMARY KEY,
description TEXT NOT NULL,
category TEXT NOT NULL
);
-CREATE INDEX tmw_transaction_codes_cat ON tmw_transaction_codes ( category );
+CREATE INDEX mana_transaction_codes_cat ON mana_transaction_codes ( category );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_transactions
+CREATE TABLE mana_transactions
(
id INTEGER PRIMARY KEY,
char_id INTEGER NOT NULL,
@@ -293,22 +293,22 @@ CREATE TABLE tmw_transactions
message TEXT,
time INTEGER NOT NULL,
--
- FOREIGN KEY (char_id) REFERENCES tmw_characters(id),
- FOREIGN KEY (action) REFERENCES tmw_transaction_codes(id)
+ FOREIGN KEY (char_id) REFERENCES mana_characters(id),
+ FOREIGN KEY (action) REFERENCES mana_transaction_codes(id)
);
-CREATE INDEX tmw_transactions_char ON tmw_transactions ( char_id );
-CREATE INDEX tmw_transactions_action ON tmw_transactions ( action );
-CREATE INDEX tmw_transactions_time ON tmw_transactions ( time );
+CREATE INDEX mana_transactions_char ON mana_transactions ( char_id );
+CREATE INDEX mana_transactions_action ON mana_transactions ( action );
+CREATE INDEX mana_transactions_time ON mana_transactions ( time );
-----------------------------------------------------------------------------
-CREATE TABLE tmw_online_list
+CREATE TABLE mana_online_list
(
char_id INTEGER PRIMARY KEY,
login_date INTEGER NOT NULL,
--
- FOREIGN KEY (char_id) REFERENCES tmw_characters(id)
+ FOREIGN KEY (char_id) REFERENCES mana_characters(id)
);
-----------------------------------------------------------------------------
@@ -317,7 +317,7 @@ CREATE TABLE tmw_online_list
-- List all online users
-CREATE VIEW tmw_v_online_chars
+CREATE VIEW mana_v_online_chars
AS
SELECT l.char_id as char_id,
l.login_date as login_date,
@@ -326,14 +326,14 @@ AS
c.gender as gender,
c.level as level,
c.map_id as map_id
- FROM tmw_online_list l
- JOIN tmw_characters c
+ FROM mana_online_list l
+ JOIN mana_characters c
ON l.char_id = c.id;
-- Show all stored transactions
-CREATE VIEW tmw_v_transactions
+CREATE VIEW mana_v_transactions
AS
SELECT t.id as transaction_id,
t.time as transacition_time,
@@ -345,12 +345,12 @@ AS
tc.description as action,
tc.category as category,
t.message as message
- FROM tmw_transactions t
- JOIN tmw_characters c
+ FROM mana_transactions t
+ JOIN mana_characters c
ON t.char_id = c.id
- JOIN tmw_accounts a
+ JOIN mana_accounts a
ON c.user_id = a.id
- JOIN tmw_transaction_codes tc
+ JOIN mana_transaction_codes tc
ON t.action = tc.id;
-----------------------------------------------------------------------------
@@ -359,41 +359,41 @@ AS
-- initial world states and database version
-INSERT INTO tmw_world_states VALUES('accountserver_startup',NULL,NULL, strftime('%s','now'));
-INSERT INTO tmw_world_states VALUES('accountserver_version',NULL,NULL, strftime('%s','now'));
-INSERT INTO tmw_world_states VALUES('database_version', NULL,'6', strftime('%s','now'));
+INSERT INTO mana_world_states VALUES('accountserver_startup',NULL,NULL, strftime('%s','now'));
+INSERT INTO mana_world_states VALUES('accountserver_version',NULL,NULL, strftime('%s','now'));
+INSERT INTO mana_world_states VALUES('database_version', NULL,'7', strftime('%s','now'));
-- all known transaction codes
-INSERT INTO tmw_transaction_codes VALUES ( 1, 'Character created', 'Character' );
-INSERT INTO tmw_transaction_codes VALUES ( 2, 'Character selected', 'Character' );
-INSERT INTO tmw_transaction_codes VALUES ( 3, 'Character deleted', 'Character' );
-INSERT INTO tmw_transaction_codes VALUES ( 4, 'Public message sent', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 5, 'Public message annouced', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 6, 'Private message sent', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 7, 'Channel joined', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 8, 'Channel kicked', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 9, 'Channel MODE', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 10, 'Channel QUIT', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 11, 'Channel LIST', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 12, 'Channel USERLIST', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 13, 'Channel TOPIC', 'Chat' );
-INSERT INTO tmw_transaction_codes VALUES ( 14, 'Command BAN', 'Commands' );
-INSERT INTO tmw_transaction_codes VALUES ( 15, 'Command DROP', 'Commands' );
-INSERT INTO tmw_transaction_codes VALUES ( 16, 'Command ITEM', 'Commands' );
-INSERT INTO tmw_transaction_codes VALUES ( 17, 'Command MONEY', 'Commands' );
-INSERT INTO tmw_transaction_codes VALUES ( 18, 'Command SETGROUP', 'Commands' );
-INSERT INTO tmw_transaction_codes VALUES ( 19, 'Command SPAWN', 'Commands' );
-INSERT INTO tmw_transaction_codes VALUES ( 20, 'Command WARP', 'Commands' );
-INSERT INTO tmw_transaction_codes VALUES ( 21, 'Item picked up', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 22, 'Item used', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 23, 'Item dropped', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 24, 'Item moved', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 25, 'Target attacked', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 26, 'ACTION Changed', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 27, 'Trade requested', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 28, 'Trade ended', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 29, 'Trade money', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 30, 'Trade items', 'Actions' );
-INSERT INTO tmw_transaction_codes VALUES ( 31, 'Attribute increased', 'Character' );
-INSERT INTO tmw_transaction_codes VALUES ( 32, 'Attribute decreased', 'Character' );
+INSERT INTO mana_transaction_codes VALUES ( 1, 'Character created', 'Character' );
+INSERT INTO mana_transaction_codes VALUES ( 2, 'Character selected', 'Character' );
+INSERT INTO mana_transaction_codes VALUES ( 3, 'Character deleted', 'Character' );
+INSERT INTO mana_transaction_codes VALUES ( 4, 'Public message sent', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 5, 'Public message annouced', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 6, 'Private message sent', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 7, 'Channel joined', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 8, 'Channel kicked', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 9, 'Channel MODE', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 10, 'Channel QUIT', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 11, 'Channel LIST', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 12, 'Channel USERLIST', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 13, 'Channel TOPIC', 'Chat' );
+INSERT INTO mana_transaction_codes VALUES ( 14, 'Command BAN', 'Commands' );
+INSERT INTO mana_transaction_codes VALUES ( 15, 'Command DROP', 'Commands' );
+INSERT INTO mana_transaction_codes VALUES ( 16, 'Command ITEM', 'Commands' );
+INSERT INTO mana_transaction_codes VALUES ( 17, 'Command MONEY', 'Commands' );
+INSERT INTO mana_transaction_codes VALUES ( 18, 'Command SETGROUP', 'Commands' );
+INSERT INTO mana_transaction_codes VALUES ( 19, 'Command SPAWN', 'Commands' );
+INSERT INTO mana_transaction_codes VALUES ( 20, 'Command WARP', 'Commands' );
+INSERT INTO mana_transaction_codes VALUES ( 21, 'Item picked up', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 22, 'Item used', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 23, 'Item dropped', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 24, 'Item moved', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 25, 'Target attacked', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 26, 'ACTION Changed', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 27, 'Trade requested', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 28, 'Trade ended', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 29, 'Trade money', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 30, 'Trade items', 'Actions' );
+INSERT INTO mana_transaction_codes VALUES ( 31, 'Attribute increased', 'Character' );
+INSERT INTO mana_transaction_codes VALUES ( 32, 'Attribute decreased', 'Character' );
diff --git a/src/sql/sqlite/updates/update_6_to_7.sql b/src/sql/sqlite/updates/update_6_to_7.sql
new file mode 100644
index 0000000..2a8b90e
--- /dev/null
+++ b/src/sql/sqlite/updates/update_6_to_7.sql
@@ -0,0 +1,122 @@
+
+-- rename tables to new prefix
+
+ALTER TABLE tmw_accounts RENAME TO mana_accounts;
+ALTER TABLE tmw_characters RENAME TO mana_characters;
+ALTER TABLE tmw_char_skills RENAME TO mana_char_skills;
+ALTER TABLE tmw_char_status_effects RENAME TO mana_char_status_effects;
+ALTER TABLE tmw_items RENAME TO mana_items;
+ALTER TABLE tmw_item_instances RENAME TO mana_item_instances;
+ALTER TABLE tmw_item_attributes RENAME TO mana_item_attributes;
+ALTER TABLE tmw_inventories RENAME TO mana_inventories;
+ALTER TABLE tmw_guilds RENAME TO mana_guilds;
+ALTER TABLE tmw_guild_members RENAME TO mana_guild_members;
+ALTER TABLE tmw_quests RENAME TO mana_quests;
+ALTER TABLE tmw_world_states RENAME TO mana_world_states;
+ALTER TABLE tmw_auctions RENAME TO mana_auctions;
+ALTER TABLE tmw_auction_bids RENAME TO mana_auction_bids;
+ALTER TABLE tmw_post RENAME TO mana_post;
+ALTER TABLE tmw_post_attachments RENAME TO mana_post_attachments;
+ALTER TABLE tmw_transaction_codes RENAME TO mana_transaction_codes;
+ALTER TABLE tmw_transactions RENAME TO mana_transactions;
+ALTER TABLE tmw_online_list RENAME TO mana_online_list;
+
+-- rename indexes (apparently have to drop and recreate)
+
+DROP INDEX tmw_accounts_username;
+DROP INDEX tmw_accounts_email;
+DROP INDEX tmw_characters_user;
+DROP INDEX tmw_characters_name;
+DROP INDEX tmw_char_skills_char;
+DROP INDEX tmw_char_status_char;
+DROP INDEX tmw_items_type;
+DROP INDEX tmw_item_instances_typ;
+DROP INDEX tmw_item_attributes_item;
+DROP INDEX tmw_inventories_owner;
+DROP INDEX tmw_guild_members_g;
+DROP INDEX tmw_guild_members_m;
+DROP INDEX tmw_auctions_owner;
+DROP INDEX tmw_auctions_state;
+DROP INDEX tmw_auctions_item;
+DROP INDEX tmw_auction_bids_auction;
+DROP INDEX tmw_auction_bids_owner;
+DROP INDEX tmw_post_sender;
+DROP INDEX tmw_post_receiver;
+DROP INDEX tmw_post_attachments_ltr;
+DROP INDEX tmw_post_attachments_itm;
+DROP INDEX tmw_transaction_codes_cat;
+DROP INDEX tmw_transactions_char;
+DROP INDEX tmw_transactions_action;
+DROP INDEX tmw_transactions_time;
+
+CREATE UNIQUE INDEX mana_accounts_username ON mana_accounts ( username );
+CREATE UNIQUE INDEX mana_accounts_email ON mana_accounts ( email );
+CREATE INDEX mana_characters_user ON mana_characters ( user_id );
+CREATE UNIQUE INDEX mana_characters_name ON mana_characters ( name );
+CREATE INDEX mana_char_skills_char ON mana_char_skills ( char_id );
+CREATE INDEX mana_char_status_char on mana_char_status_effects ( char_id );
+CREATE INDEX mana_items_type ON mana_items (itemtype);
+CREATE INDEX mana_item_instances_typ ON mana_item_instances ( itemclass_id );
+CREATE INDEX mana_item_attributes_item ON mana_item_attributes ( item_id );
+CREATE INDEX mana_inventories_owner ON mana_inventories ( owner_id );
+CREATE INDEX mana_guild_members_g ON mana_guild_members ( guild_id );
+CREATE INDEX mana_guild_members_m ON mana_guild_members ( member_id );
+CREATE INDEX mana_auctions_owner ON mana_auctions ( char_id );
+CREATE INDEX mana_auctions_state ON mana_auctions ( auction_state );
+CREATE INDEX mana_auctions_item ON mana_auctions ( itemclass_id );
+CREATE INDEX mana_auction_bids_auction ON mana_auction_bids ( auction_id );
+CREATE INDEX mana_auction_bids_owner ON mana_auction_bids ( char_id );
+CREATE INDEX mana_post_sender ON mana_post ( sender_id );
+CREATE INDEX mana_post_receiver ON mana_post ( receiver_id );
+CREATE INDEX mana_post_attachments_ltr ON mana_post_attachments ( letter_id );
+CREATE INDEX mana_post_attachments_itm ON mana_post_attachments ( item_id );
+CREATE INDEX mana_transaction_codes_cat ON mana_transaction_codes ( category );
+CREATE INDEX mana_transactions_char ON mana_transactions ( char_id );
+CREATE INDEX mana_transactions_action ON mana_transactions ( action );
+CREATE INDEX mana_transactions_time ON mana_transactions ( time );
+
+-- rename views (have to drop and recreate as well)
+
+DROP VIEW tmw_v_online_chars;
+DROP VIEW tmw_v_transactions;
+
+CREATE VIEW mana_v_online_chars
+AS
+ SELECT l.char_id as char_id,
+ l.login_date as login_date,
+ c.user_id as user_id,
+ c.name as name,
+ c.gender as gender,
+ c.level as level,
+ c.map_id as map_id
+ FROM mana_online_list l
+ JOIN mana_characters c
+ ON l.char_id = c.id;
+
+CREATE VIEW mana_v_transactions
+AS
+ SELECT t.id as transaction_id,
+ t.time as transacition_time,
+ a.id as user_id,
+ a.username as username,
+ c.id as char_id,
+ c.name as charname,
+ tc.id as action_id,
+ tc.description as action,
+ tc.category as category,
+ t.message as message
+ FROM mana_transactions t
+ JOIN mana_characters c
+ ON t.char_id = c.id
+ JOIN mana_accounts a
+ ON c.user_id = a.id
+ JOIN mana_transaction_codes tc
+ ON t.action = tc.id;
+
+
+-- update the database version, and set date of update
+UPDATE mana_world_states
+ SET value = '7',
+ moddate = strftime('%s','now')
+ WHERE state_name = 'database_version';
+
diff --git a/tools/monitor/main.cpp b/tools/monitor/main.cpp
index 194e08c..7f6eb5d 100644
--- a/tools/monitor/main.cpp
+++ b/tools/monitor/main.cpp
@@ -1,5 +1,5 @@
/**
- * A monitor application that runs tmwserv-account and tmwserv-game.
+ * A monitor application that runs manaserv-account and manaserv-game.
* (C) 2009 Thorbjørn Lindeijer
*
* When a server crashes, a gdb process is spawned to create a backtrace,
@@ -217,8 +217,8 @@ private:
int ServerMonitor::sigtermFd[2];
ServerMonitor::ServerMonitor()
- : mAccountServer("src/tmwserv-account")
- , mGameServer("src/tmwserv-game")
+ : mAccountServer("src/manaserv-account")
+ , mGameServer("src/manaserv-game")
{
if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermFd))
qFatal("Couldn't create TERM socketpair");