Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Money und Landtool
#13
Landtool.php

PHP-Code:
<?php
#
#  Copyright (c)Melanie Thielker and Teravus Ovares (http://opensimulator.org/)
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are met:
#      * Redistributions of source code must retain the above copyright
#        notice, this list of conditions and the following disclaimer.
#      * Redistributions in binary form must reproduce the above copyright
#        notice, this list of conditions and the following disclaimer in the
#        documentation and/or other materials provided with the distribution.
#      * Neither the name of the OpenSim Project nor the
#        names of its contributors may be used to endorse or promote products
#        derived from this software without specific prior written permission.
#
#  THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
#  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#  DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
#  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
#  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
#  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#


//////////////////////////////////////////////////////////////////////////////
//
// Modified by Fumi.Iseki for CMS/LMS '09 5/31
//

require_once('../include/env_interface.php');
require_once(
'./helpers.php');



###################### No user serviceable parts below #####################
#
# The XMLRPC server object
#

$xmlrpc_server xmlrpc_server_create();

#
# Land purchase sections
#
# Functions are called by the viewer directly.
#

#
# Land buying functions
#

xmlrpc_server_register_method($xmlrpc_server"preflightBuyLandPrep""buy_land_prep");

function 
buy_land_prep($method_name$params$app_data)
{
    
$req          $params[0];
    
$agentid      $req['agentId'];
    
$sessionid      $req['secureSessionId'];
    
$amount          $req['currencyBuy'];
    
$billableArea $req['billableArea'];
    
$ipAddress       $_SERVER['REMOTE_ADDR'];

    
$ret opensim_check_secure_session($agentidnull$sessionid);

    if(
$ret) {
        
$confirmvalue get_confirm_value($ipAddress);
        
$membership_levels = array('levels' => array('id' => "00000000-0000-0000-0000-000000000000"'description' => "some level"));
        
$landUse    = array('upgrade' => False'action' => "".SYSURL."");
        
$currency   = array('estimatedCost' => convert_to_real($amount));
        
$membership = array('upgrade' => False'action' => "".SYSURL.""'levels' => $membership_levels);
        
$response_xml xmlrpc_encode(array('success'    => True,
                                            
'currency'  => $currency,
                                            
'membership'=> $membership,
                                            
'landUse'    => $landUse,
                                            
'currency'  => $currency,
                                            
'confirm'    => $confirmvalue));
    }
    else {
        
$response_xml xmlrpc_encode(array( 'success'          => False,
                                             
'errorMessage'    => "Unable to Authenticate\n\nClick URL for more info.",
                                             
'errorURI'        => "".SYSURL.""));
    }

    
header("Content-type: text/xml");
    echo 
$response_xml;

    return 
"";
}


#
# Perform the buy (所持金が足りないとき)
#

xmlrpc_server_register_method($xmlrpc_server"buyLandPrep""buy_land");

function 
buy_land($method_name$params$app_data)
{
    
$req          $params[0];
    
$agentid      $req['agentId'];
    
$sessionid      $req['secureSessionId'];
    
$amount          $req['currencyBuy'];
    
$cost          $req['estimatedCost'];
    
$billableArea $req['billableArea'];
    
$confim          $req['confirm'];
    
$ipAddress      $_SERVER['REMOTE_ADDR'];
     
    
//
    
if ($confim!=get_confirm_value($ipAddress)) {
        
$response_xml xmlrpc_encode(array('success'     => False,
                                            
'errorMessage'=> "\n\nMissmatch Confirm Value!!",
                                            
'errorURI'    => "".SYSURL.""));
        
header("Content-type: text/xml");
        echo 
$response_xml;
        return 
"";
    }

    
$ret opensim_check_secure_session($agentidnull$sessionid);

    if (
$ret) {
        if(
$amount>=0) {
             if (!
$cost$cost convert_to_real($amount);
            if(!
process_transaction($agentid$cost$ipAddress)) {
                
$response_xml xmlrpc_encode(array(
                        
'success'       => False,
                        
'errorMessage' => "\n\nThe gateway has declined your transaction. Please update your payment method AND try again later.",
                        
'errorURI'       => "".SYSURL.""));
            }
            
//
            
$enough_money false;
            
$res add_money($agentid$amount$sessionid);
            if (
$res["success"]) $enough_money true;
            
            if (
$enough_money) {
                
$amount += get_balance($agentid);
                
move_money($agentidnull$amount50020"Land Purchase"00$ipAddress);
                
update_simulator_balance($agentid, -1$sessionid);
                
$response_xml xmlrpc_encode(array('success' => True));
            }
            else {
                
$response_xml xmlrpc_encode(array('success'     => False,
                                                
'errorMessage'=> "\n\nYou do not have sufficient funds for this purchase",
                                                
'errorURI'      => "".SYSURL.""));
            }
        }
    }
    else {
        
$response_xml xmlrpc_encode(array('success'       => False,
                                            
'errorMessage' => "\n\nUnable to Authenticate\n\nClick URL for more info.",
                                            
'errorURI'       => "".SYSURL.""));
    }

    
header("Content-type: text/xml");
    echo 
$response_xml;

    return 
"";
}




#
# Process XMLRPC request
#

$request_xml $HTTP_RAW_POST_DATA;
//error_log("landtool.php: ".$request_xml);

xmlrpc_server_call_method($xmlrpc_server$request_xml'');
xmlrpc_server_destroy($xmlrpc_server);

?>
Zitieren


Nachrichten in diesem Thema
Money und Landtool - von soundi - 18.05.2017, 01:15
RE: Money und Landtool - von Bogus Curry - 18.05.2017, 01:26
RE: Money und Landtool - von soundi - 18.05.2017, 01:32
RE: Money und Landtool - von Bogus Curry - 18.05.2017, 11:50
RE: Money und Landtool - von soundi - 18.05.2017, 12:22
RE: Money und Landtool - von Bogus Curry - 18.05.2017, 12:28
Meine robust.ini - von soundi - 18.05.2017, 12:38
RE: Money und Landtool - von soundi - 18.05.2017, 12:41
RE: Money und Landtool - von soundi - 18.05.2017, 12:43
RE: Money und Landtool - von Dorena Verne - 18.05.2017, 12:48
RE: Money und Landtool - von soundi - 18.05.2017, 12:51
RE: Money und Landtool - von Bogus Curry - 18.05.2017, 12:54
RE: Money und Landtool - von soundi - 18.05.2017, 13:08
RE: Money und Landtool - von soundi - 18.05.2017, 13:18
RE: Money und Landtool - von Anachron - 20.05.2017, 09:28
RE: Money und Landtool - von Wollex Baily2 - 20.05.2017, 13:03
RE: Money und Landtool - von Bogus Curry - 18.05.2017, 17:37
RE: Money und Landtool - von Wollex Baily2 - 19.05.2017, 19:36
RE: Money und Landtool - von Mareta Dagostino - 20.05.2017, 09:37
RE: Money und Landtool - von soundi - 20.05.2017, 20:03
RE: Money und Landtool - von Wollex Baily2 - 20.05.2017, 20:49
RE: Money und Landtool - von Bogus Curry - 20.05.2017, 21:31
RE: Money und Landtool - von soundi - 24.05.2017, 23:10
RE: Money und Landtool - von Bogus Curry - 25.05.2017, 00:17
RE: Money und Landtool - von soundi - 25.05.2017, 00:20
RE: Money und Landtool - von Bogus Curry - 25.05.2017, 08:55
RE: Money und Landtool - von soundi - 12.06.2017, 18:53
RE: Money und Landtool - von Bogus Curry - 12.06.2017, 20:18
RE: Money und Landtool - von soundi - 12.06.2017, 22:19
RE: Money und Landtool - von Bogus Curry - 13.06.2017, 03:28
RE: Money und Landtool - von Dorena Verne - 13.06.2017, 08:57
RE: Money und Landtool - von soundi - 13.06.2017, 23:55
RE: Money und Landtool - von Bogus Curry - 14.06.2017, 01:09
RE: Money und Landtool - von soundi - 14.06.2017, 17:48

Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  Money Server - Classifieds Skimi 0 316 02.09.2023, 12:02
Letzter Beitrag: Skimi
  hilfe zum money server 9.0.1 hajo drechsler 11 13.194 22.01.2020, 13:50
Letzter Beitrag: Manfred Aabye
  DTL/NSL Money Server Wollex Baily2 5 7.300 27.02.2018, 20:29
Letzter Beitrag: Wollex Baily2
  Landtool.php und Helpers.php timrasa 0 3.820 13.05.2011, 16:52
Letzter Beitrag: timrasa

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste