ID:134346
 
BYOND Version: 351.910
Operating System: Windows XP Pro Service Pack 2

Detailed Problem Description:
world.internet_address doesn't work and broke world.url. Was this released a bit too early? xD

Code Snippet to Reproduce Problem:
mob
Login()
..()
world << world.internet_address
world << world.url


Does the problem occur:
Every time? Or how often? Every time.
In other games? Yes.
On other computers? Yes.
In other user accounts? Probably.
http://www.byond.com/docs/ref/info.html#/world/var/ internet_address
If it cannot be determined, it will be null; this will occur when the world is not hosted or when the world cannot contact the BYOND hub.

The world must contact the hub before this can be set. Thus it takes a few seconds after world startup before it has a value. If you check it during mob/Login() when running in DreamSeeker, the first person logged in (the host) will not get anything because the login happens too quickly.
BYOND Version: 351.910
Operating System: Windows XP Pro.
Detailed Problem Description:

<code>world.internet_address</code> will not set until you do something like <code>if(port)OpenPort(port)</code> in <code>world/New()</code>. When rebooting it should either preserve the previous value, or obtain the new value.
In response to Android Data
Mike H wrote:
The world must contact the hub before this can be set. Thus it takes a few seconds after world startup before it has a value. If you check it during mob/Login() when running in DreamSeeker, the first person logged in (the host) will not get anything because the login happens too quickly.
In response to Crashed
Crashed wrote:
Mike H wrote:
The world must contact the hub before this can be set. Thus it takes a few seconds after world startup before it has a value. If you check it during mob/Login() when running in DreamSeeker, the first person logged in (the host) will not get anything because the login happens too quickly.

Yes, I read that.

mob/Login()
.=..()
spawn()
while(!world.internet_address)
src<<"Not yet..."
sleep(5)
src<<world.internet_address


The following code will constantly return "Not yet..." until <code>world.OpenPort()</code> is called, appearantly.
Even if the game is already hosted, it loses the variable over a reboot and doesn't try to obtain the information again.
In response to Android Data
Whoops. I thought you made a seperate post.
In response to Crashed
Crashed wrote:
Whoops. I thought you made a seperate post.

I did. I posted a bug, since it was a bug.
In response to Android Data
Android Data wrote:
> mob/Login()
> .=..()
> spawn()
> while(!world.internet_address)
> src<<"Not yet..."
> sleep(5)
> src<<world.internet_address
>

The following code will constantly return "Not yet..." until <code>world.OpenPort()</code> is called, appearantly.

Yes, that's correct. If the world is not hosted, it has no reason to contact the hub, and thus it has no way of getting world.internet_address. Moreover, if it's not hosted, it has no reason to need world.internet_address!

Even if the game is already hosted, it loses the variable over a reboot and doesn't try to obtain the information again.

Not in my tests. The internet address is obtained again within a short period of time -- it only takes until the next time the world needs to contact the hub. Usually less than 30 seconds. Do you have a specific test case where this doesn't happen, but the world is hosted?