flagflag  If you want to see English page, please click "English" Button at Left.

Landtool.php

  • このフォーラムに新しいトピックを立てることはできません
  • このフォーラムではゲスト投稿が禁止されています

なし Landtool.php

msg# 1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 .2 .3 .4 .5 .6 | 投稿日時 2014-11-27 14:25
lloy0076  Just popping in   投稿数: 5
Hi There,

I have the landfill.php and helper scripts that I've downloaded from NSL's 0.8.0 page.

I've noticed a number of unexpected issues:

1. The scripts assume that the money database is contained in the same MySQL database as the Robust database.

For example, the INSERT statement on Line 2217 of include/opensim.mysql.php simply does not work because it's trying to insert into the 'transactions' table that does not exist.

2. The scripts also assume that the estate information is also in the same MySQL database as the Robust database.

However, my estate information was setup to use an SQLite database living on a separate simulator server.

Now, here's the odd bit.

Once I fixed this -- principally by migrating the database onto the same database as the Robust server is using -- I can actually buy land if I purchase the coin before using the buy land and then purchase currency functionality. But if I use the 'Purchase Coin' (Buy Lindens) on the 'Buy Land' section I don't get any PHP errors any longer but no money gets purchased and the land doesn't transfer.

From what I can tell there's at least two pathways to "Purchase Coins" (in a LL viewer this would be called "Buy Lindens") in the helper scripts - the helper/currency.php one is working. But something -- and I'm not sure what -- is causing the land not to transfer and the money not to be purchased (or the transaction to get silently missed).

I have mangled some of the functions to get them to work, most specifically on Line 127 of helper/landtool.php I've done this:

if ($ret) {
if($amount>=0) {
// Kludge the real amount.
$real = isset($real) ? $real : $amount;
if(!process_transaction($agentid, $real, $ipAddress)) {

... this was because $real insisted on not being set causing the process_transaction(...) to fail.

I think the current issue is that one of the XML RPC calls is failing but it's not entirely clear to me, yet, which one it is.

I specifically say so because I have error_log(...) calls all over the place and currently the last thing I see is:

"PHP message: After opensim_get_estate_info(a69309dd-397f-458b-b46f-716ab118c40a, DB)"

This is an error_log after the call to get the region information.

But the following code doesn't seem to run:

$sql = "INSERT INTO ".CURRENCY_TRANSACTION_TBL." (UUID,sender,receiver,amount,objectUUID,".
"regionHandle,type,time,secure,status,description) ".
"VALUES ('".
$UUID."','".
$sourceID."','".
$destID."','".
$amount."','".
"00000000-0000-0000-0000-000000000000','".
$handle."','".
$db->escape($type)."','".
time()."','".
$secure."','".
$db->escape($flags)."','".
$db->escape($description)."')";
error_log("Insert into currnency transation error_log SQL: $sql");
$db_ret = $db->query($sql);
error_log($db_ret);

To test this I have:

a) A Debian 7.0 Wheezy system
b) PHP 5.6 from dotted
c) Allowed everyone to buy as much money as they want (I'm rich - if only!)

MoneyServer.ini:
[Startup]
;
; Place to create a PID file
PIDFile = "/tmp/money.pid"


[MySql]
;
;Connection parameters of MySQL
hostname = localhost ; Name of MySQL Server
database = opensim
username = opensim
password = HAHA ; No the password isn't that bad!

pooling = false
port = 3306

;
; Max DB connections kept by money server.
MaxConnection = 10
;
; If "00000000-0000-0000-0000-000000000000" is specified, all avatars can get money from system.
; If "" is specified, nobody can get money.
BankerAvatar = "00000000-0000-0000-0000-000000000000"

;
; If you want to use llGiveMoney() function normally even when payer doesn't login to OpenSim,
; please set true to this valiable
EnableForceTransfer = true

;
; send money to avatar by MoneyScript (for Bonus)
EnableScriptSendMoney = true
MoneyScriptAccessKey = "davidslloyd" ;; specify same secret key in include/config.php or WI(XoopenSim/Modlos)
MoneyScriptIPaddress = "192.168.0.164" ;; not use 127.0.0.1

; If "" is specified, blue dialog is not displayed.
; You can use {0} and {1} in message string.
; {0} means amount and {1} means avatar name or object owner name
;BalanceMessageLandSale = "Paid the Money L${0} for Land." ;; for buy the land
;BalanceMessageScvLandSale = "" ;; for get the money of the sold land
;BalanceMessageSendGift = "Sent Gift L${0} to {1}." ;; for send gift to other avatar
;BalanceMessageReceiveGift = "Received Gift L${0} from {1}." ;; for receieve gift from other avatar
;BalanceMessagePayCharge = "" ;; for upload and group creation charge
;BalanceMessageBuyObject = "Bought the Object L${0} from {1}." ;; for buy the object
;BalanceMessageGetMoney = "Got the Money L${0} from {1}." ;; for get the money from object by llGiveMoney()
;BalanceMessageBuyMoney = "Bought the Money L${0}." ;; for buy the money from system
;BalanceMessageReceiveMoney = "Received L${0} from System." ;; for receive the money from system by send_money() script
;BalanceMessageRollBack = "RollBack the Transaction: L${0} from/to {1}." ;; when roll back ocuurred


;
;
; for HTTPS Server
ServerCertFilename = "SineWaveCert.pfx"
ServerCertPassword = "123"
;ServerCertFilename = "server_cert.p12"
;ServerCertPassword = ""

; for Client Authentication from MoneyModule
;CheckClientCert = true;
;CACertFilename = "cacert.crt"
;ClientCrlFilename = "clcrl.crt"
;


; for XML RPC Client Authentication to MoneyModule
;CheckServerCert = false;
;ClientCertFilename = "client_cert.p12"
;ClientCertPassword = ""

I have this in Robust.ini:

...
economy = http://192.168.0.164/currency/helper/
...

[Economy]
SellEnabled = "true"
UserServer = "http://192.168.0.164:8002/" ;; not use localhost or 127.0.0.1
CurrencyServer = "https://192.168.0.164:8008/" ;; not use localhost or 127.0.0.1
EconomyModule = "DTLNSLMoneyModule"

;; Money Unit fee to upload textures, animations etc
PriceUpload = 30

;; Money Unit fee to create groups
PriceGroupCreate = 200

...

root@grid1:~/opensim-0.8.0.3/bin# mono -V
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-8)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)

....

ii php5-cli 5.6.3-1~dotdeb.1 amd64 command-line interpreter for the php5 scripting language
ii php5-common 5.6.3-1~dotdeb.1 amd64 Common files for packages built from the php5 source
ii php5-curl 5.6.3-1~dotdeb.1 amd64 CURL module for php5
ii php5-fpm 5.6.3-1~dotdeb.1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php5-mysql 5.6.3-1~dotdeb.1 amd64 MySQL module for php5
ii php5-readline 5.6.3-1~dotdeb.1 amd64 Readline module for php5
ii php5-xmlrpc 5.6.3-1~dotdeb.1 amd64 XML-RPC module for php5

...

I can buy land but only if I buy the Lindens first. If I use the 'Purchase Money/Coin/LL $' from the Buy Land screen (when I don't have enough in a test account), I've managed to mangle the scripts enough such that they don't totally fall over but no money appears to get exchanged.

I'm not using any form of CC provider (I just return true for that bit as though the customer's card always succeeds).

NB. I do see the landtool.php script asking for the Avatar's balance over XML-RPC but it never actually sends a request to buy any money.

Is there anything obvious that I might be doing wrong here?


DSL
投票数:132 平均点:7.05

なし Re: Landtool.php

msg# 1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2014-11-27 14:27
lloy0076  Just popping in   投稿数: 5
Oh, the OpenSim I'm running is:

opensim-0.8.0.3

I got it from http://track.opensimulator.org/link_counter.php?url=http://opensimulator.org/dist/opensim-0.8.0.3.tar.gz (don't click that link unless you want to download it again :)).

DSL
投票数:58 平均点:4.66

なし Re: Landtool.php

msg# 1.2
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2014-11-27 18:13
iseki  Home away from home   投稿数: 1581
Hi,

You use SQLite database, aren't you?

Sorry. My tools does not support SQLite. I don't know about SQLite well.
投票数:97 平均点:4.23

なし Re: Landtool.php

msg# 1.2.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2014-11-28 9:59
lloy0076  Just popping in   投稿数: 5
No, I switched the whole configuration - including the simulator's OpenSim.ini to MySQL:

Robust.ini:

...
[DatabaseService]
; PGSQL
; Uncomment these lines if you want to use PGSQL storage
; Change the connection string to your db details
;StorageProvider = "OpenSim.Data.PGSQL.dll"
;ConnectionString = "Server=localhost;Database=opensim;User Id=opensim; password=***;"

; MySQL
; Uncomment these lines if you want to use MySQL storage
; Change the connection string to your db details
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=127.0.0.1;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
...

MoneyServer.ini

[MySql]
;
;Connection parameters of MySQL
hostname = localhost ; Name of MySQL Server
database = opensim
username = opensim
password = ***

pooling = false
port = 3306
...

/usr/share/nginx/www/currency/include/config.php

// Please set MySQL DB access information
define('OPENSIM_DB_HOST', 'localhost');
define('OPENSIM_DB_NAME', 'opensim');
define('OPENSIM_DB_USER', 'opensim');
define('OPENSIM_DB_PASS', '***');
//
define('OPENSIM_DB_MYSQLI', true); // if you use MySQLi interface, please set true
...

I know that the landtool.php can actually access the correct MySQL database because I have put a heap of error_log("") messages in currency/include/opensim.mysql.php; for example:

function opensim_get_region_info($region, &$db=null)
{
error_log("opensim_get_region_info for $region");
global $OpenSimVersion;

if (!isGUID($region)) return null;
if ($region=='00000000-0000-0000-0000-000000000000') return null;

if (!is_object($db)) $db = opensim_new_db();
if ($OpenSimVersion==null) opensim_get_db_version($db);

$sql = "SELECT regionHandle,regionName,regionSecret,serverIP,serverHttpPort,serverURI,locX,locY FROM regions WHERE uuid='$region'";
error_log("SQL: opensim_get_region_info '$sql'.");
$db->query($sql);

list($regionHandle, $regionName, $regionSecret, $serverIP, $serverHttpPort, $serverURI, $locX, $locY) = $db->next_record();

error_log("Region Handle $regionHandle and name $regionName.");
...

The $regionHandle and $regionName are set correctly both when run by the code and when I run the SQL (logged above $db->query($sql)).

Everything should I think be processing well however I have noticed that the code has a nasty tendency to silently fail on missing tables and such and am wondering if I am missing something from some other function.


DSL
投票数:104 平均点:4.52

なし Re: Re: Landtool.php

msg# 1.2.1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2014-11-28 10:02
lloy0076  Just popping in   投稿数: 5
I always forget one - here's OpenSim.ini:

[DatabaseService]
;
; ### Choose the DB
;

; SQLite
; Include-Storage = "config-include/storage/SQLiteStandalone.ini";

; MySql
; Uncomment these lines if you want to use mysql storage
; Change the connection string to your db details
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=192.168.0.164;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
; Uncomment this line if you are using MySQL and want to use a different database for estates
; The usual application for this is to allow estates to be spread out across multiple simulators by share the same database.
; Most people won't need to do this so only uncomment if you know what you're doing.
;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"

Note that the MySQL server is on 192.168.0.164 - and they're all using the same opensim account with the same password.

e.g.

root@grid1:~/opensim-0.8.0.3/bin# mysql -uopensim --p*** -h192.168.0.164 opensim
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 53
Server version: 5.5.40-0+wheezy1 (Debian)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables;

[shows about 40 tables]

+--------------------------+
| Tables_in_opensim |
+--------------------------+
| Avatars |
| Friends |
| GridUser |
| Presence |
| UserAccounts |
| assets |
| auth |
| balances |
| estate_groups |
| estate_managers |
| estate_map |
| estate_settings |
| estate_users |
| estateban |
| inventoryfolders |
| inventoryitems |
| land |
| landaccesslist |
| migrations |
| os_groups_groups |
| os_groups_invites |
| os_groups_membership |
| os_groups_notices |
| os_groups_principals |
| os_groups_rolemembership |
| os_groups_roles |
| primitems |
| prims |
| primshapes |
| regionban |
| regionenvironment |
| regionextra |
| regions |
| regionsettings |
| regionwindlight |
| spawn_points |
| terrain |
| tokens |
| transactions |
| userinfo |
+--------------------------+
40 rows in set (0.00 sec)

See that all the estate tables, grid tables and money tables (e.g. transactions) are all in the one database.

DSL
投票数:106 平均点:2.64

なし Re: Landtool.php

msg# 1.3
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2014-11-29 22:15
iseki  Home away from home   投稿数: 1581
Sorry, so I'm weak in English, your English is difficult.

In short, do you say that you can't buy money from a system?

If it is so, please show me config.php more.

Is CURRENCY_SCRIPT_KEY davidslloyd ?

----
If you use Linux/Unix, you can find setup_scripts.sh that is tool of download lastest helper scripts in opensim.curency/helper_scripts
投票数:124 平均点:2.90

なし Re: Landtool.php

msg# 1.4
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2014-11-30 2:07
lloy0076  Just popping in   投稿数: 5
I *can* buy money from the system.

I *can* buy land from the system if my avatar already has enough money.

I *cannot* buy money from the "Buy Land" dialog (see picture here: http://tinyurl.com/pup9dr5).

The CURRENCY_SCRIPT_KEYs are the same on MoneyServer.ini and in helper_scripts/config.
投票数:57 平均点:4.21

なし Re: Landtool.php

msg# 1.5
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2014-11-30 15:53
iseki  Home away from home   投稿数: 1581
I see.

I think that the function is not implemented.

I will check whether its function can be implemented.
投票数:79 平均点:6.58

なし Re: Landtool.php

msg# 1.6
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2014-11-30 23:04
iseki  Home away from home   投稿数: 1581
投票数:277 平均点:1.48

  条件検索へ


サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 5月翌月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
<今日>

オンライン状況

35 人のユーザが現在オンラインです。 (2 人のユーザが Forum を参照しています。)

登録ユーザ: 0
ゲスト: 35

もっと...

アクセスカウンタ

今日 : 355355355
昨日 : 4763476347634763
総計 : 2368898223688982236889822368898223688982236889822368898223688982
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com