Game Development Community

HTTPObject

by Anthony McCrary · in Torque Game Engine · 11/29/2002 (3:25 pm) · 2 replies

%server = "testServer.com:80";
          %path = "/";
          %script = %path @ "auth.php";
          %upd = new HTTPObject(authObject){};
          %upd.get(%server, %script, %clientparameters);

function authObject::onLine(%line) {

      echo(%line);

}

This is echoing an id number , not what the server returns.

Is there a function in %line's object that I need to call?

Thanks.

#1
11/29/2002 (3:47 pm)
I already figured this out. the "onLine" function is supposed to have 2 parameters, %this and %line.
#2
11/29/2002 (4:40 pm)
Ok, I have another problem.

%clientparameters = "username=" @ %username @ "&password=" @ %password;

          %server = "theserver.com:80";
          
          %path = "/";
          
          %script = %path @ "auth.php";
          
          %upd = new HTTPObject(authObject){};
          
          %upd.get(%server, %script, %clientparameters);

I want to be able to pass a %client variable to the authObject, so when the onLine function is called, is can check the servers results and tell the client. This would be something like authResult(%client, %result).

Can anyone give me any hints on how to do this?

Thanks!