The online racing simulator
[Solved] HTTP(); as non player event
Why can I not use http out of a player event? This seems like a pointless restriction...

6/2/2018 11:32:11 PM -> Syntax error: in file ".\server\.\includes\.\webadmin.lpr" at line #148
You can't use http in this context, not a player event
Function 'onlapperstart_http' script aborted

I've located some files used for this function:

the main scriptFunctions.cs file contains the function defined as so:


<?php 
        
public void http(GLScript.unionVal valArrayList args)
        {
            
infoPlayer currInfoPlayer newCfg.getCurrInfoPlayer();
            
string ident val.nameFunction;
            if (
currInfoPlayer == null)
                throw new 
GLScript.GLApp.GLScriptException("You can't use " ident " in this context, not a player event");
            
testArgs(ident"S"args);
            
objWebCmd.sendWebCmd(currInfoPlayer.UCIDargs[0].ToString());
        }
?>

and sendWebCmd has the UCID parameter used like so:


<?php 
        
public void sendWebCmd(int UCIDstring url)
        {
            
Monitor.Enter(QwebCmd);
            
QwebCmd.Enqueue(new webCmd(UCIDurl));
            
Monitor.Exit(QwebCmd);
        }
?>

and it seems like the requirement to pass player information to this function is quite pointless... I wonder how hard it would be to remove that requirement entirely.
it may be as simple as removing that error throw in the http() function... If it is == null, make it 0 or something.
This thread is closed

FGED GREDG RDFGDR GSFDG