From The Mana World

The Mana World Account Manager

The Account Manager also known as TMWWeb is the web interface for users and administrators to manage their accounts from outside the game. Users can reset their password, see their character stats, and change the email associated with the account.

Installation

To install you need to clone TMWWeb from our sourcecode repository. See: Git repository.

You will need a web server running PHP 5.1 or later. If your accountserver uses SQLite as backend you have to enable pdo_sqlite for php. On FreeBSD you will need to install ports databases/php5-pdo_sqlite and security/pecl-hash along with lang/php5.

Configuration

To get TMWWeb up and running there are several configuration steps to do. After uploading all scripts to your wwwroot, navigate with your browser to the root of the scripts ending with setup.php. This script will guide you through the setup progress and will tell you what to do next and why. If a task is red, fix it and reload the page until everything is in status green.

Single tasks

There are several config files that have to be prepared for your specific environment. You can find all config files under ./system/application/config

TMWWeb comes with a default configuration file called "config.default.php" You should use this file as template to set up your individual configuration. Make a copy of this file and name rename it to "config.php". In general you have to modify the following settings:

   set the "base_url" to the URL of your installation.
   define the desired "log_threshold" to your needs

Do the same with the file "database.default.php" and "email.default.php". Rename them to "database.php" and "email.php" configure the options inside for your needs.

The following configuration files are shipped with defaults that may or may not be suitable for you.

   menu.php
   tmw_config.php
   

Instead of modifying the files directly you should make a copy of them and rename them to <prefix>.user.php, so "menu.php" gets "menu.user.php". Tmwweb first loads menu.php, afterwards menu.user.php (if it exists) and overrides the default values with your custom settings. The advantage of this method is, that upgrading TMWWeb won't break your configuration.

Warning: You should only keep the configuration settings you want to change in the *.user.php files. Anything you don't want to change should be removed.

None of the other files in the config directory should be altered by you!

After proper configuration of all files you have to ensure that the webserver has write access to the ./system/logs, the ./images/items and ./data directory.

   chmod 777 ./system/logs
   chmod 777 ./data
   chmod 777 ./images/items
   

TMWWeb tries to store cached data read from other modules like TMWServ in the data directory for faster access. Therefore you should allow the web server to create files there. The logs directory is used for logging as you can think.

Troubleshooting

After uploading and configuring TMWWeb, every page might show up white and blank. Lets set loglevel in config.php to 4 and after refreshing your site in the browser have a look at the logfiles under ./system/logs If there is no file except index.html please recheck your directory permissions. Again, the web server needs write permissions to ./system/logs. If you cannot find a file that is named "config.php", please go back to the Configuration chapter and read it more carefully!

Translations

TMWWeb has a simple multilingual support integrated. During login into your account you can choose one of the currently translated languages. If your native language is not available yet, feel free to support the dev team and translate TMWWeb.

How-to translate into your language

To start with a new language there are two simple steps to do:

Copy the directoy ./system/application/language/english as it is the shipped language with TMWWeb and should contain all necessary strings. Also you have to copy ./system/language/english to your new language. This directory contains strings coming from CodeIgniter, the used PHP framework.

Each php file ending with *_lang.php needs to be translated.

      $lang['character'] = '<put your translation here>';        

Make sure that you double quote inside of your strings, if necessary.


Lastly you have to add your new language to the configuration file tmwweb/system/application/config/tmw_config.php. Just add your language to the array $_tmw_languages like shown below. The parameter 'dir' has to be the name of your added directory, e.g. 'german'. The parameter 'name' is the displayed string during login. This should be the native name of the language, like 'deutsch'.

Don't forget a comma to separate language arrays.

      $_tmw_languages = array( 
         array('dir'=>'english', 'name'=>'English'),
         array('dir'=>'german', 'name'=>'deutsch')
      );

Maintenance

The intention of TMWWeb is to be a slim, administrative front-end for TMWServ. Therefore it is natural to use as much as data, information and configuration we can get from TMWServ. Because TMWServ makes extensive use of XML configuration files, which would be too expensive to parse on every page request, TMWWeb uses different methods to cache those informations for faster access.

From time to time, if the data in TMWServ was modified, an administrator has to refresh the caches of TMWWeb. Therefor you can find a menu option "maintenance" when logged in with an administrative account. This page shows you all caches and allows you to refresh them with a single click.

items.xml

Refreshing the items database is a bit special, thats why it is mentioned here additionally. To show the inventory of a character, the images of those items have to be available for a web browser. Therefore they have to reside somewhere under the DOCUMENT_ROOT of your web server. To keep all things together, we decided to store them under ./images/items. When refreshing the items database, TMWWeb looks in that directory and compares the images located there to all items in the database. If a image is missing, TMWWeb tries to copy this image from your TMWData path, you can configure in tmw_config.php (see Configuration).

To copy those images, the web server needs write permission to the images/items directory. If TMWWeb can't find the image in the TMWData directory or it is not allowed to write to the ./images/items directory, the refresh procedure will show you a list with all missing images. Then you will have to copy those images yourself.


TMWWeb Connector

The TMWWeb Connector is a package of methods provided by TMWWeb to allow foreign applications to access data of the running TMWServ server. A common example is a list of online users that are currently connected to the server. See TMWWeb Connector for a detailed description of available methods.