Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

MasterServer timeouts for registered (idle) servers?

Discussion in 'Multiplayer' started by jashan, Jan 15, 2008.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi there,

    I've set up my game server now, and it works with UTs MasterServer. However, even though the server is still running and functional, it seems to be removed from the MasterServer's host list after a while. That makes a lot of sense, of course ;-)

    Is there a defined timeout, or recommended procedure to keep the entry in the MasterServer alive? In the documentation, I only found the updateRate which I think is something different...

    When the same server registers multiple times, does that have any negative side effects? If not, I could simply do that every X minutes to keep the entry alive. If that doesn't work, I could also wait with that until all players have signed off ("idle-mode"), then Unregister and immediately re-register...

    What's recommended for this?

    Jashan
     
  2. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    277
    Hmm, he shouldn't be dropping your server, even if it is idle. There is a back and forth ping communication between the game server and master server, which should keep the connection alive and your server registered. Do you see a connection lost message in your debug log on your game server at some point (containing the master server IP/port)? Is there a specific time where you get dropped? I just tested for 10 minutes and it was persistent.
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Larus,

    hm... there seems to be something wrong with that.

    I've just opened my server and let it run in the background. I'm putting out log messages every 5 minutes to see if it's really "still there". I haven't checked the exact time, yet (which is kind of a time-consuming thing to figure out ;-) ). What I know so far: after a few minutes, it's always still there, but after 45 minutes, it's gone.

    I get no connection lost message in the debug log. I just can't find it from the client anymore, after this amount of time. Right now, I'm testing this in a local network with NAT punchthrough, but it originally happened on a server with a direct connection.

    The game type name I'm using for this test is JCsUMTRON_V0.7 - not sure if that helps, maybe there's something in the MasterServer logfile?

    I'll keep on narrowing down the time when this "drop" happens and see if there's any pattern.

    Jashan
     
  4. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    277
    OK, I think I found one of the offending cases in the log. I see you register, then about 40 minutes later a client requests the server and its gone. The servers connection is however, alive and well and I can see the server unregistering a moment later. So the server is registered, sort of, but can't be retrieved by clients.

    I'll look into this, this might be a master server side bug. Meanwhile, a workaround might be to re-register the server every 10 minutes or so, you shouldn't need to unregister first. Sending a re-register should just update the host information (even though nothing has changed and the info is identical).
     
  5. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Larus, thanks - that's cool, I already have the re-register code there, just had it commented out for a while.

    One more thing I've noticed: It seems that there is no obvious pattern for the time. I had one case, where it was "gone" after 6 minutes, and another one where it was still there after 11 minutes. I'll set my "re-register time" to two minutes - hoping that won't clutter you're logfiles...

    Does it help you guys if I file a bug report (for myself, I always find it quite motivating crushing down the buglists, and I have a tendency to forget stuff when I don't have a task/bug for it ;-) )?

    Jashan
     
  6. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    277
    Feel free to file a bug if you want to follow the issue in the bug tracker.
     
  7. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Filed as 17535
     
  8. JohnGalt

    JohnGalt

    Joined:
    Nov 27, 2007
    Posts:
    85
    aaaha!! good to read I'm not the only one.

    :) :)