This tutorial assumes that the previous tutorials on Installing Opensim, Migrating to MySQL, Working in Grid Mode, and Creating a Web Interface, have all been completed.
The previous tutorial on Creating a Web Interface detailed how to install and configure WAMP and the OpenSimWI (redux). These applications already contain all you need to implement currency in OpenSim, they just need configuring and enabling.
Before starting this tutorial, if you are using DynDNS, make sure that it is working correctly, and resolving to your true IP address, and not using any form of redirect.
Step 1: Configure php.ini
Navigate to wamp\bin\apache\apache2.2.8\bin\php.ini and open the file. Near the top of the file are the Language Options, ensure that the following are set:
short_open_tag = On
asp_tags = On
Near the middle of the file is the section Dynamic Extensions, under Windows Extensions uncomment the following:
( the extension=php_mysql.dll should have been set in the previous tutorial)
(php will need to be restarted for these changes to take effect [not applicable to Linux users], but we will do that later).
(Linux users should refer to this link to install php curl).
Step 2: Create a Banker Avatar
Using the Web Interface (but not using the opensim console or the user console), create a new user, call him Banker Avatar (the name can be anything you like, but it must be a name that you can immediately associate with currency in opensim).
Using Toad, phpMyAdmin, or the mysql console, look up this new user, and copy his UUID. Alternatively, you can go into the Web Interface admin, Manage Users, click on Edit beside the Banker Avatar, and his UUID will be shown in the user details. You will need the banker's UUID in the following steps. I will now assume a UUID for Banker Avatar of:
Step 3: Configure config.php
Navigate to wamp\www\settings\config.php and open the file. Go to the Money Settings section and insert the Banker's UUID:
Step 4: Configure opensim.ini
Go to the [Economy] section and set the hostname and path to the currency.php and landtool.php files, and set the Banker UUID to the Base Account, for example:
CurrencyServer = "http://anubia.servegame.org/currency.php"
Landserver = "http://anubia.servegame.org/landtool.php"
EconomyBaseAccount = d91452bf-c474-4bbe-a91f-f4629c5bac4f
In the [GridInfo] section of opensim.ini there is a helper uri setting. Set as follows:
economy = http://anubia.servegame.org/
Step 5: Set the Currency Conversion Value
The currency conversion is set at a default value of 1 cent = 1 currency unit. This can be changed by using Toad, phpMyAdmin, or the mysql console, to open the wi_economy_money table, and changing the CentsPerMoneyUnit value to whatever you like.
Step 6: Modify the Viewer Target Parameters
The following example values are for my anubia grid, which has the hostname,
This should be replaced with your grid's own hostname or IP address.
Right-click the viewer shortcut icon, Properties, and under the Shortcut tab you will have a Target similar to this:
"C:\Program Files\SecondLife\SecondLife.exe" -set SystemLanguage en-us -multiple -loginuri http://anubia.servegame.org:8002
Modify this to the following:
"C:\Program Files\SecondLife\SecondLife.exe" -set SystemLanguage en-us -multiple -loginuri http://anubia.servegame.org:8002 -loginpage http://anubia.servegame.org/loginscreen.php -helperuri http://anubia.servegame.org/
Set the following parameters for your grid:
Login URI: http://anubia.servegame.org:8002
Grid Nickname: anubia
Grid Name: anubia
Login Page: http://anubia.servegame.org/loginscreen.php
Helper URI: http://anubia.servegame.org/
Web Site: http://anubia.servegame.org/about
* For both viewers the trailing slash for the helper uri is important.
Step 7: Restart WAMP and the Services
To put all these changes into effect you must close down OpenSim and stop all the Wamp services, and the Wamp server. Restart the wamp server, restart all the services, and restart Opensim, and money should now be enabled.
Step 8: Update the Database
As only users that are created via the Web Interface can log in there and look at their transaction history you might want to consider 'converting' the existing users created via the console. To do this simply log into Web Interface Admin, and above the left-hand Menu you will see an option to Update Database. Clicking on this will synchronise the user table with the wi_user table, and make them all Active.
Known Bugs and Limitations
The currency modules in OpenSim are not without their bugs, but do not expect them to be fixed anytime soon, they are a low priority right now for many of the OpenSim development team, and a zero priority for some.
Users who have got money working in their grids report that money transfers and buying land both seem to work fine, but further report issues and limitations such as:
- Money goes missing for no apparent reason (often when crossing region borders). Relogging usually restores the correct balance.
- A random 'Transactions may not be available' error message.
- Buying from an object crashes the client.
- Uploads do not take any money.
Some people have reported that their installation did not work and eventually they found that either the wrong php.ini had been edited (as there is another in the php folder) or that xmlrpc was not running.
A handy check is to create the following php script in notepad (replacing the square brackets with chevrons):
Save this as testphp.php and place it in the wamp\www folder.
To use it just go into your browser and type your hostname, then the script name, for example:
This will tell you lots of information, including if php has been set up correctly, if curl and xmlrpc are running or not, and lots more besides.
Treat the whole issue of money in opensim with extreme caution, and at your own risk. The developers have repeatedly said that the current stage of opensim development does not support inworld currency, and the available modules should be used for testing and development only, and are not supported.