Jump to content

callRemote Error


Recommended Posts

Hello, first, sorry for ma bad english. I'am a german. xD

I tryed to script a license-system, but the function "callRemote" doesn't work. It returns a "nil"

Here the Server-Side code:

function getIPFromWebserver () 
  
    license = "testlic" 
    curVersions = "1.0" 
    remoteCall ( license, curVersions ) 
end 
  
function remoteCall () 
  
    callRemote ( "http://license.*******.net/license_check.php", result, license, curVersions ) 
end 
  
addCommandHandler ( "license", getIPFromWebserver ) 
  
function result ( val ) 
    print ( val ) 
end 

The wiki-example sais if it doesnt work, it returns "ERROR".. But the code returns "nil"..

The-PHP:

<?php 
     
    include ( "class/license.class.php" ); 
    include ( "class/ip.class.php" ); 
    include ( "mta_sdk.php" ); 
     
    $license = new license(); 
    $ip = new ip(); 
     
    $serverIP = $ip->getServerIP(); 
    $serverLicense = $license->getLicenseFromIP ( $serverIP ); 
    $licenseState = $license->getLicenseState ( $serverLicense ); 
     
    $scriptName = $license->getScriptNameFromLicense ( $serverLicense ); 
    $scriptVersion = $license->getScriptVersion ( $scriptName ); 
     
    $input = mta::getInput(); 
     
    if ( $license->isServerInLicenseDatabase ( $serverIP ) ) { 
         
        if ( $input[1] == $scriptVersion ){ 
             
            mta::doReturn ( $licenseState ); 
             
        }else{ 
             
            mta::doReturn ( "updateRequired" ); 
             
        } 
         
    }else{ 
         
        mta::doReturn ( "notExist" ); 
         
    } 
     
?> 

The-PHP-Script is working, when i go with my browser to check this, it returns the licenseState, but when i call this via lua-script, it returns a "nil"..

Pls help me ._.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...