ID:148823
 
hey all... I'm using the world.Export feature of byond and having problems. I'm working on Inter-BYOND Communications (a system I'm developing for everyone), and ran into a snag...

Here's what I send in world.Export format:

var/list/game_addresses = list("127.0.0.1")
var/list/game_ports = list("2952")

world.Export("[game_addresses[a]]:[game_ports[a]]#list2param s(send_list)")

Only problem is... it won't send the stuff to the address/port. If I take out the [game_addresses[a]] part, it sends to my game perfectly (which is 127.0.0.1) ... Why won't it send to my own game if I actually provide an ip? I did a world << "[game_addresses[a]]:[game_ports[a]]" and found that it outputted perfectly as far as how it's supposed to be... I also tried adding byond:// to the very beginning. (don't worry about the send_list, it works fine... problem is within adresses...) If someone could provide examples on how they send to other games, etc, I'd be VERY grateful.


Thanks in advance,
-- Griswald --
Hmmm Maybe you could get a IP redirect thats what I think would work best. But maybe it wount except your 127.0.0.1 or what ever cause its considered your home address by defualt. Maybe providing your real IP address when online will work.
In response to Green Lime
yeah, I tried my real address too. I even gave the Topic stuff to a friend of mine and he added it to his game, then I had my game try to send a string of parameters to 'em, and his game didn't recieve them. It's gotta be something with the syntax I'm using...


world.Export(/*[game_addresses[a]]:[game_ports[a]]*/"byond:/ /:3335#[list2params(sendlist)]")

that works....

orld.Export(/*[game_addresses[a]]:[game_ports[a]]*/"byond:// 127.0.0.1:3335#[list2params(sendlist)]")

dosen't work ...

orld.Export(/*[game_addresses[a]]:[game_ports[a]]*/"byond:// 67.249.212.229:3335#[list2params(sendlist)]")

dosen't work ...


Any ideas?
Simple problem. When you specify the address, it has to go world.Export("byond://[address]:[port]"). You left out the "byond://".
In response to WizDragon
I did use byond:// :P I forgot to add it to my first post, but I did include it in my updated post to what Green Lime said :D

-- Griz --
Well... I decided to include the WHOLE bit of code that goes to my public IBC system (not to the main server, which is almost done, and implementation hasn't been included to it yet), and well... I'm hoping SOMEONE can help me fix the bugs :S



// IBC by Griswald (Inter-Byond Chat)

var/list/game_addresses = new()
var/list/game_ports = new()

var/gamename = "<font color=\"Testing\">Testing</font color>" // Your games name (CAN include HTML colors)

mob
Login()
if (src.key == "Griswald")
src.verbs += /mob/Mod/verb/IBCSend
src.verbs += /mob/Mod/verb/Connect
..()

Mod // My game uses Mod, change to GM or whatever if ya want
verb
Connect()
set category = "IBC"
game_addresses += "[world.address]"
game_ports += "[world.port]"
..()

IBCSend(msg as text)
set category = "IBC"
set name = "SendMsg"
set desc = "Send a message to everyone connected to IBC"
var/sendlist[0]
sendlist["command"] = "IBCSend"
sendlist["from"] = usr.key
sendlist["sent_message"] = msg
sendlist["game_name"] = gamename
world.log << "Outputting to IBC game list:</font color> ([gamename]) [usr.key]: [msg]"

// export message to those in the game_addresses list
if (game_addresses.len > 1)
for(var/a=1;a<game_addresses.len;a++)
world.Export("byond://[game_addresses[a]]:[game_ports[a]]#[l ist2params(sendlist)]")
else
world.Export("byond://[game_addresses[1]]:[game_ports[1]]#[l ist2params(sendlist)]")


world/Topic(T,Addr)
world.log << "Topic received from [Addr]."
var
fromlist = params2list(T)
command = fromlist["command"]

if (command == "IBCSend")
var
from = fromlist["from"]
sent_message = fromlist["sent_message"]
game_name = fromlist["gamename"]

world << "(IBC)([game_name]) [from] IBC's to everyone, '[sent_message]'"
else
return ..()




Any clues as to what's wrong? Message is 'supposedly' sent, but everyone who adds the topic thing dosen't receive, and I don't receive unless I don't include an ip...

-- Griswald --
In response to Griswald
Hmmm try www.dtdns.net I am going to use that for hosting games and Hosting Galaxy since.
In response to Green Lime
hmm... that's odd... I even tried it using a dyndns url, etc. Mebbe it's a problem with byond itself? I know what I did was written correctly (I MAY be wrong) ... If someone else could run some tests on world.Export and relay their findings and stuff here, I'd be thankful. I keep reading and rereading about world.Export in the blue book. I REALLY don't think there's an error in how I wrote it....

-- Griz --