<< Back to Programming Forum   Search

Posts 1 - 10 of 10   
Create game API from HTTP GET parameters: 2013-08-25 19:34:37


HuBa 
Level 62
Report
Currently the CLOT interface requires some scripting language to communicate with the WL service.
It would be useful to have a simplified interface based on the HTTP GET parameters.
This would allow us to use the API from commandline or browser.

For example if I open the following URL:
http://warlight.net/API/CreateGame?hostEmail=your@email.com&hostAPIToken=yourApiToken&templateID=1234&gameName=Game%20name%20here%20&personalMessage=Include%20a%20description%20to%20include%20with%20the%20game&players=66553413;134314314;123456789;13453531543


Then I would expect it to return the newly created game with the Location URL being set to the game ID.
So when I enter this URL in the browser it would instantly show the lobby to the newly created game.
Create game API from HTTP GET parameters: 2013-08-26 01:13:17

Fizzer 
Level 64

Warzone Creator
Report
GET is inherently weak to cross-site scripting attacks. For example, an attacker could make a simple page that does a GET request to the "GetAPIToken" API, returns their API token back to the page and e-mails it to the attacker.

You mention wanting to do it from the command line. It should be pretty easy to send POST data by the command line, a simple search finds this: http://stackoverflow.com/questions/6865146/how-to-send-data-using-curl-from-linux-command-line

If you want to do it from your browser, you can set up your own service somewhere that just translates your URL into a POST request. It wouldn't be difficult to write. However, I encourage you to use some sort of authentication so other people can't call it, otherwise they could use it to launch an attack.
Create game API from HTTP GET parameters: 2013-08-26 07:00:28


HuBa 
Level 62
Report
No, the GetAPIKey shouldn't support GET parameters, only the CreateGame. So there is no security risk.

I know how to use curl, I just wanted to avoid the text processing for the results of the POST call.
Create game API from HTTP GET parameters: 2013-08-27 10:02:52


ps 
Level 61
Report
why dont you just do a localhost proxy server that serves you a customized query then? seems you want very specific return behaviors and it isnt too complex to deserialize the json to return just what you want.
Create game API from HTTP GET parameters: 2013-08-27 14:03:28


ChrisCMU 
Level 61
Report
I still can't get anywhere on my CLOT. Fizzer have you looked into that error I sent you?

http://s10.postimg.org/6ym1hr44p/Error.png

Has anyone else gotten this error?
Create game API from HTTP GET parameters: 2013-08-27 17:51:49


HuBa 
Level 62
Report
[WG] ChrisCMU: You are asking for help in my topic. How old are you?
Create game API from HTTP GET parameters: 2013-08-27 18:08:25


HuBa 
Level 62
Report
PS: " seems you want very specific return behaviors" No!
I just need a simple HTTP request.

This way I could just simply create a game using a browser bookmark or the command line.

The brouwser will simply send the parameters and open the resulting game without any more clicks.
Create game API from HTTP GET parameters: 2013-08-27 18:30:04


hedja 
Level 61
Report
[WG] ChrisCMU: You are asking for help in my topic. How old are you?


Haha you think that your thread is your own property? Grow up...

This is a thread about CLOT, and he has had an error and is asking if you too have come across this, so he can find ways around it and make a CLOT to play in with other people, don't get so mad...
Create game API from HTTP GET parameters: 2013-08-27 18:49:26


ps 
Level 61
Report
нυвα: so do a small page that takes your inputs, constructs the creategame, sends it to server, receives the json, parses it and returns the page link (if thats what you want it to return) to the sender. you can check my sourcecode for the greek 1vs1 realtime ladder, some of it's code can easily be repurposed to do what you're looking for, the create game button calls a php script that does the creategame thing and sends a reply to the page for update. https://github.com/psenough/wl_clot/tree/master/greece1vs1

ChrisCMU: you should probably create a thread about that specific bug.

hedja: its good netiquette not to sidetrack other peoples threads, especially when discussing development / debugging stuff. otherwise it's a just a mess for everybody.
Create game API from HTTP GET parameters: 2013-09-10 15:27:43


ChrisCMU 
Level 61
Report
My bad HUBA. BTW, my error is fixed now.
Posts 1 - 10 of 10