11. Using Money in OpenSim

Before embarking on this tutorial I would urge you to read my blog entry, 'Money, that's, what I want', in the Chapter & Metaverse blog for the 29th November.

==================================================

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:

extension=php_curl.dll

extension=php_xmlrpc.dll

( the extension=php_mysql.dll should have been set in the previous tutorial)

Save.

(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:

d91452bf-c474-4bbe-a91f-f4629c5bac4f


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:

$economy_sink_account="d91452bf-c474-4bbe-a91f-f4629c5bac4f";

$economy_source_account="d91452bf-c474-4bbe-a91f-f4629c5bac4f";

Save.


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/

Save.

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,

http://anubia.servegame.org

This should be replaced with your grid's own hostname or IP address.

SL Viewer
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/


Hippo Viewer
Set the following parameters for your grid:

Login URI: http://anubia.servegame.org:8002

Platform: Opensim

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.

Troubleshooting
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):

[?php
phpinfo()
?]



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:

http://anubia.servegame.org/testphp.php

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.


Finally
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.




18 comments:

  1. Rock,
    re. [GridInfo] This section has no direct effect on the operation, unless user clicks "Get Grid Info" button on Hippo viewer, then the settings are passed onto the viewer and become active.
    This whole section facilitates the user being able to load all settings to his viewer, simply by inserting the grid uri. Leaving helper uri commented out will disable that part of the getgridinfo call and leave user having to manually insert helper uri.
    Regards
    Cam C

    ReplyDelete
  2. Thanks CamC. the tutorial has been updated according.

    Rock

    ReplyDelete
  3. Rock,
    I have done several tests now and can confirm (in my own experience), the following.
    1.Buying from object would crash "inactive" user. Inactive users cannot buy land (no crash)
    2.However "active" users seem to be able to buy from object once, if the users balance does not update, a second purchase would crash viewer, if the balance DOES update then further object purchases seem to be successful.
    Findings..case 2. scenario...
    Active user buys from object, receives object, Balance on screen does not change immediately, a check of that users trans. history shows true balance but inworld balance is still wrong, eventually inworld balance will correct itself.
    workaround ...if balance does not reflect first purchase, dont make 2nd purchase until balance onscreen is correct,(upload or give money to another av usually fixes it, sim crossing sometimes fixes it) restart restores correct balance. Hope this helps,
    (inactive user defined as user created other than via the WI, who shows up under WIadmin user list(in red), as opposed to unverified, which is a user created by WI but not yet activated, these users also show up as inactive but cannot even log in to grid)
    Regards CamC

    ReplyDelete
  4. Users created using the user console and show up in WI in red, can still login using the viewer but CAN NOT login to the WI.

    ReplyDelete
  5. Thanks. I have now found how to 'convert' users created before Wiredux was installed into fully active users. There is a new step now, Step 8, that shows how to synchronise the two user tables (users and wi-users).

    ReplyDelete
  6. I need help, Ive done everything above but it works until it says "Despite out best efforts something has gone wrong" The about XXXX usd$ works also, but buy does not.

    ReplyDelete
  7. Okay, I got the thing working but when I click buy now, it just doesn't pay me but it shows on my transaction history. Can you help? The bank account I made doesn't pay any L$

    ReplyDelete
  8. Shouldn't OpenSim be careful about using the term $L if that gets trademarked by Lindens? One less reason for LL to sue the heck out of anyone competing with them..

    ReplyDelete
  9. I've a problem: when clicking buy, amount is credited to me, but i don't go to payment page! How to make that?

    ReplyDelete
  10. Ok. Things seem to work, but :

    When i purchase inWorld, nothing happen.
    If I go in my transaction history, I see this purchase credited.
    If I go in the database and table wi_economy_transactions I have two lines; One I am credited and the second i am debited. So it is a null transaction.
    Is somebody have an answer about that ?

    ReplyDelete
  11. I have the same issue any help?

    ReplyDelete
  12. Is there any way i can make opensim remember everyones L$ balance after sim restarted?
    I have a few sims in stand alone setting and a few casino games, and just a few friends and family play for free,,, just a bit of fun thats all, but its a pain when have to restart server :-(

    ReplyDelete
  13. Can you Update the Tutorial to the Current Opensim Version?

    ReplyDelete
  14. take a view to http://www.nsl.tuis.ac.jp/xoops/modules/xpwiki/?XoopenSim%20%28E%29

    is a module for to do with new versions and work fine

    ReplyDelete
  15. Opensim ist super: www.danicx.com

    ReplyDelete
  16. Some link to money module on the current version?

    ReplyDelete
  17. Is there any solution to the debit/credit problem? I've been trying to use web_interface with currency, but whenever I buy money, it gets debited right away, even for the Bank Account user. Please Help!

    ReplyDelete
  18. Hello i am using DTL Money server and i was unable to understand the process of Banker Avatar in that . can anyone help me out regarding this settings.

    ReplyDelete