ID:2017937
 
(See the best response by Super Saiyan X.)
Is there a way to make a BYOND server and a non DMCGI webserver talk back and forth?

Best response
Sure. BYOND can do GET (world.Export) calls to anything that will accept a GET. PHP can easily do this.

Then, a server can accept topic calls through this snippet:
http://www.byond.com/forum/?post=33090

It's a bit old though, so I'm not sure if the messaging format has changed.
Hey. Thanks for the quick response. I've been messing with this, and PHP isn't my cup of tea so would you (or anyone) mind looking over my setup?

http://plnkr.co/edit/PMwP1Adp8mBlxfHjDTKF?p=preview
Thats the html and php side.

world/New()
OpenPort(1337)

world/Topic(T)
world << T

mob/Login()
world << src

And the very simple DM receiver.

Thanks in advance!
I just tested it like this...

I had this on a webserver.
<?php

// export will execute as soon as the world starts, since
// it's a function call outside of a function definition.

export("IP of your BYOND world", 3000, "hi");

function export($addr,$port,$str)
{
if($str{0} != "?") $str = ("?" . $str);
$query = "\x00\x83" . pack("n",strlen($str)+6) . "\x00\x00\x00\x00\x00" . $str . "\x00";
$server = socket_create(AF_INET,SOCK_STREAM,SOL_TCP) or exit('Unable to create export socket; ' . socket_strerror(socket_last_error()));
socket_connect($server,$addr,$port) or exit('Unable to establish socket connection; ' . socket_strerror(socket_last_error()));
$bytessent = 0;
while($bytessent < strlen($query))
{
$result = socket_write($server,substr($query,$bytessent),strlen($query)-$bytessent);
if($result === FALSE) exit('Unable to transfer requested data; ' . socket_strerror(socket_last_error()));
$bytessent += $result;
}
socket_close($server);
}

?>


Then, I had the same world/Topic as you - everytime I refreshed my webpage, I would get a topic message on the BYOND server.

Page me if you want to join my hosted world and a link to the web page, so you can see it work.

Other than that, what kind of communication do you want the two servers to do?
Ok thanks for the help appreciate it.
Looking at your current plnkr.co, looks like that should work. When BYOND 510 hits, it might make sense to wrap the string with a json_encode (so you can send multiple kinds of data with a single standard), and then you could use the upcoming DM json_decode function with it.