ID:134189
 
I haven't done much in the area of socketing and blah, but I don't imagine this too be all too difficult really. I would like to see DS and DD support internet protocols (like HTTP) for all hosted games. It would only require attempting to recognize a different type of header when something tries to connect to the program. (Right?)

When such a connection is made, call a world proc like Topic(), or more preferably, a new proc. (WebRequest()?) If it returns a string, that would be the body. If a list, then the add the headers that are in the list, with "CONTENT" for the body.

This could really add some nice browser-based features to a game. High scores viewable from a web side, administrative control from a remote computer (idea by Polatrite), AJAX for communication with popups. (Not sure what protocol that uses really, if it even matters.)

Paramiters I'd like in the procedure:
  • The full GET data.
  • GET data in list form. (Optional)
  • The same for POST data. (Optional, but could be really nice.)
  • The IP of the client.
  • A /client, if the IP matches that of a client.
  • Whatever header data that could be used.
you can send data to popups. you can send a new html file to a client and refresh an invisible iframe to receive the data. the popup doesn't know when the new html file has been received by the client, but you do know when a request was made. so, when a request is made you can begin polling (repeatedly refresh the iframe every second, or so) until the refresh yields a new page. you can use javascript to transfer data between the iframe and the parent document.
In response to OneFishDown
That's a nice idea, but not the only reason I requested this feature.
In response to Yota
Yota wrote:
That's a nice idea, but not the only reason I requested this feature.

Couldn't such an effect be attained by using browse() to view a page on a website, and world.Export() to send relative data to that page?

For instance, I have ASDF.php sitting on my site, I can use world.Export() to transfer data to ASDF.php using a GET method. Which can then have a database script to do it's thing.

Then, using the method in id:394116, you could send data from the webpage back to the server and using world/Topic() to collect the data in much the same way and use it how you see fit?

Of coarse, this is granted you wanted to go through those time consuming steps. Personally, I'd love to see more browser support in DS.
In response to Tiberath
Wow, that could come in handy. Never even thought about DM's protocol. Thanks Tib, Mobius and Crispy!

My suggestion still stands however. PHP wouldn't be possible for games hosted on a PC. We probably could make an external application to communicate with the game, however it would require another open port on the firewall, a world that trusts external application calls, and a seperate PHP or CGI thingy for when the game is hosted on a server.

Would be nice to have it all in one package.
In response to Yota
Yota wrote:
Wow, that could come in handy. Never even thought about DM's protocol. Thanks Tib, Mobius and Crispy!

My suggestion still stands however. PHP wouldn't be possible for games hosted on a PC. We probably could make an external application to communicate with the game, however it would require another open port on the firewall, a world that trusts external application calls, and a seperate PHP or CGI thingy for when the game is hosted on a server.

Would be nice to have it all in one package.

Well, Icon Ultima uses tibbius.com to communicate to PHP. Or, at least, it would if tibbius.com's new server didn't want to charge me $30.00 so they would allow it to make a socket connection.

Pretty much, instead of using a local PHP source, use an external one and use a GET method. To save for malicious attacks, use some kind of encryption you can make for both DM and PHP.
In response to Tiberath
Such as AirMapster.Crypto.rc5Preview.

Just need to find out if PHP has a function for RC5.
In response to Tiberath
Tiberath wrote:
and use a GET method.

BYOND should really use POST.
In response to Android Data
Android Data wrote:
Tiberath wrote:
and use a GET method.

BYOND should really use POST.

I agree.
In response to A.T.H.K
A.T.H.K wrote:
Android Data wrote:
Tiberath wrote:
and use a GET method.

BYOND should really use POST.

I agree.

I say both
In response to Shlaklava
Shlaklava wrote:
A.T.H.K wrote:
Android Data wrote:
Tiberath wrote:
and use a GET method.

BYOND should really use POST.

I agree.

I say both

if you have a lot of data that you need to send from a popup window to BYOND, you can break it into chunks and use miltiple calls to send the data. its nice if you have an in-game message board that uses popups, you don't have to limit posts to 250 characters, or whatever the limit is.
In response to OneFishDown
Shameless self-promotion in 3...
2...
1...

http://members.byond.com/Jtgibson/forum?id=147
In response to YMIHere
YMIHere wrote:
Shameless self-promotion in 3...
2...
1...

Aborted.

I was referring to world.Export().
In response to Android Data
You could break that up as well if you're sending data to a script that you wrote - send it a chunk at a time, and store the previous chunks in a file or a database or something. When you're done sending, call a different page which then retrieves and processes the stored data.

You'll probably need to figure out a way of identifying each data stream, so that you can send multiple streams simultaneously. Not too hard, just use an ID number that your website script allocates (since only it knows which ID numbers are spare).