ID:2906308
 
What I am gathering about world.Topic() is that you can use it to communicate with other BYOND servers and pass information between games. However, what if I want to get information from a server, read into another (non-BYOND) server. Aka. a webserver. I am assuming there must be a way to http request the server and extract information something like
curl locahost:<my_byond_server_port>/Topic=mapname

and it should output
mymap.dmm


However I don't know where to read about how to do this or what the general process or syntax for doing this is. If anyone could please point me in the right direction or link to an example it'd be greatly appreciated. Thank you.
The incoming packet needs to be formatted correctly, more information can be found in this post https://www.byond.com/forum/post/33090
I do not recall the accuracy of this, or anything, but this is basic socket talk from something I was working on awhile back in NodeJS. I am a horrible documentation kinda guy.

const net = require('net');
const socket = new net.Socket();

const sleep = async (ms) => {return new Promise(resolve => setTimeout(resolve, ms));}

//Create connection and send hello
socket.connect(6699, '127.0.0.1',async ()=>{
  await SendTopic("?hello");
});



async function SendTopic(topic) {
        if(topic[0]==="?"){topic = topic.substr(1)}
        const header = Buffer.from([0x00, 0x83, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f]);
        header.writeUInt16BE(topic.length+7, 2);
        const data = Buffer.concat([header, Buffer.from(topic), Buffer.from([0x00])]);
        await socket.write(data);
}

async function receive(data) {
        console.log(data);
        console.log(data.toString());
}

socket.on('data', async (data) => {
        console.log(data);
        switch(data[4]){
                case 42:
                        await receive(Buffer.from(data).slice(7));
                case 6:
                        await receive(Buffer.from(data).slice(5));
                default:
                        return null;
        }
});
Very interesting, thank you... those hex values and specific bytes are just what you need to parse the data properly?
I'll experiment with this.