Nexuiz startup vs network stability

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Wed Mar 25, 2009 1:56 pm

  • So if I understand everything right, on startup nexuiz checks master server for a list of IPs of public servers.

    The problem is, if my DNS server is down, or my router is down/dying, nexuiz freezes for some 1-2 minutes without any signs of life. This also happens on computers connected to internet via http proxy.

    Can this be fixed, like maybe start downloading server list only when user presses a button?

    Thanks.
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Wed Mar 25, 2009 1:58 pm

  • The only real fix would be doing that DNS resolve in a separate thread. Which is not easy to do in a platform independent way, but might be done in the future.

    And there is no simple way to avoid loading the server list on startup anyway, as the menu immediately shows it.

    Well, there is ONE way: telling your OS that there is no DNS for it to query (e.g. by emptying /etc/resolv.conf on Linux). Then it won't try and time out.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Wed Mar 25, 2009 1:59 pm

  • divVerent wrote:The menu immediately shows it.

    Then maybe it shouldn't? I think this bug is really annoying.
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Wed Mar 25, 2009 2:41 pm

Wed Mar 25, 2009 3:14 pm

  • Plus, it's a feature and not a bug, as it's convenient for most people.

    Another thing that would solve it would be not using DNS for the master servers, but hardcoded IPs. But servers might move...
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Wed Mar 25, 2009 5:34 pm

  • divVerent wrote:Plus, it's a feature and not a bug, as it's convenient for most people.

    Another thing that would solve it would be not using DNS for the master servers, but hardcoded IPs. But servers might move...


    Don't you think that it's wrong to ASSUME that user is connected to internet whenever nexuiz starts?
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Wed Mar 25, 2009 6:30 pm

  • Nope, as Nexuiz is a multiplayer game. If you were talking about Zymotic, on the other hand, you'd be right.

    Also, if you are NOT connected to the internet, you shouldn't have a DNS server address set up, and then it wouldn't wait.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Wed Mar 25, 2009 7:52 pm

  • divVerent wrote:Nope, as Nexuiz is a multiplayer game. If you were talking about Zymotic, on the other hand, you'd be right.

    Also, if you are NOT connected to the internet, you shouldn't have a DNS server address set up, and then it wouldn't wait.


    Allow me to point certain flaws in your thinking.

    Firstly, nexuiz isn't just a multiplayer game. You can play bots for (basic) skills and aim practice. And second, more important (for me at least) -- nexuiz is also a trickjump/speed game, and these things you can practice on your own without internet.

    And about DNS thing - consider a situation where internet service provider's DNS server suddenly gets DoSed and stops responding? This is the kind of situation I have from time to time. And, frustrating as it is, it does not get any better when my nexuiz(which I start to spend some time while ISP gets his stuff together) freezes on startup.
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Wed Mar 25, 2009 11:51 pm

  • alpha wrote:Don't you think that it's wrong to ASSUME that user is connected to internet whenever nexuiz starts?


    I agree with this.

    If possible, perhaps when the multiplayer window is selected the internet connection takes place, that would make more sense.
    User avatar
    [-z-]
    Site Admin and Nexuiz Ninja
     
    Posts: 1794
    Joined: Mon Nov 13, 2006 12:20 am
    Location: Florida

Thu Mar 26, 2009 12:42 am

  • But you should focus on what the majority of ppl do with this game: play online.

    Alpha can be right talking logically, but actually no. This is the point. When I start Nexuiz, if I click the multiplayer window after some seconds, I have some chance to see quickly the servers already in the list. Only this matters. If in rare cases happens some weird things, IMO this is perfectly acceptable. Even if that would happen to me. The advantages are more then the disadvantages, this matter.
    User avatar
    terencehill
    Alien
     
    Posts: 176
    Joined: Thu Jul 10, 2008 10:33 pm
    Location: Italy

Thu Mar 26, 2009 2:12 am

  • ?
    Perhaps add a new variable: ultra_net_covert, where , if set to 1, nexuiz doesn't check the master servers, only searches for lan server. If set to 2, nexuiz doesn't search out any servers (it, ofcourse, would accept that a server exists on the lan if the server is broadcasting that), If set to 3, nexuiz won't accept anything other than localhost servers (127.0.0.* (yes it can be anything in the 127.0.0.x net). AND IF 4, oh boy, then Nexuiz doesn't even accept localhost! (So one can only browse the menus, not play a game :P). Maybe also cache the last known good IPs of both the DNS master servers and the list of servers: this way if DNS fails you can still connect to master servers, if master servers fail you can still connect to regular servers?

    Ultra_net_covert shouldn't be able to be "pushed" by servers, only the user shouldbeable to set it.

    ?
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Thu Mar 26, 2009 6:55 am

  • sv_masterextra1 ""
    sv_masterextra2 ""
    sv_masterextra3 ""
    sv_masterextra4 ""

    Then the DNS resolving should be gone.

    To turn off networking completely, use:

    cl_netport 445

    or any other port number already used on your system (445 is always in use on Windows, and allowed to root only on Linux and Mac, so this one should always work for this purpose). Then ONLY local connections will work.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Thu Mar 26, 2009 7:00 am

  • Anyway, the big issue isn't that these queries are done. They should be done.

    The only issue we have is that DNS resolving blocks the game until it's done. This is by design of the DNS resolve functions in the least common denonimator of all operating systems. Fixing this would mean writing lots of OS specific code for it, and also rewriting functions like connect to queue up the connection, wait for the result, and connect then.

    A library for this already exists, but it's on unix only - it is libadns. The Windows port of it apparently is very outdated and unmaintained.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Thu Mar 26, 2009 10:33 am

  • Alright, so to fix this problem, we have 3 options:

    1. "Download server list" button aka warsow style
    2. Download server list on "multiplayer" window click ([-z-]'s idea)
    3. Manually mess with autoexec config and play with console on every game launch

    How about we don't enforce a use of solution #3 ?
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Thu Mar 26, 2009 10:43 am

  • 1. sucks totally, extra waiting time for anyone except you
    2. still sucks, as the list then does not fill. It is an important part of the UI design that the list DOES fill, so you know there's the server list. Really makes it more intuitive. And still, much more waiting time for most people.
    3. only in your specific case

    For most players, the current solution is just perfect. You are the exception here.

    So I propose:

    4. do resolving in a separate thread (should certainly be done in the future)

    This could e.g. be some task for the C coders who join this forum and ask what to do.

    Also, maybe this is simpler:

    5. do a one second timeout for DNS resolving

    This is simple on Unix systems (the common denominator is fork(), do gethostbyname() in the child, send it over a pipe, and from the parent process, read the pipe with a timeout, then kill the child process), but I know that fork() does not exist on Windows, so I won't implement it simply as I don't know how.
    Last edited by divVerent on Thu Mar 26, 2009 10:58 am, edited 1 time in total.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Thu Mar 26, 2009 10:58 am

  • why not add a cvar "cl_me_has_crappy_net_connection_so_please_do_not_use_any_internet_features_kthxbye", defaults to 0 and when set to 1 no internet connectivity is used. Of course I do not know at how many places that "if" would have to be placed in the DP code.

    OTOH, I think that setting the master-server to "" is a fairly easy solution for you alpha, you can simply create two launch configurations (on windows: 2 launch shortcuts), where one sets the master servers to "" and one to their original value. That's quickly done for setup and very easy when starting the game, too.
    IRC quote:
    [kojn] I've been coming a bit more recently
    [kojn] she took it the dirty way
    GreEn`mArine
    Forum addon
     
    Posts: 1509
    Joined: Tue Feb 28, 2006 9:33 pm
    Location: Germany

Thu Mar 26, 2009 10:59 am

  • GreEn`mArine wrote:why not add a cvar "cl_me_has_crappy_net_connection_so_please_do_not_use_any_internet_features_kthxbye", defaults to 0 and when set to 1 no internet connectivity is used. Of course I do not know at how many places that "if" would have to be placed in the DP code.


    cl_netport 445

    does exactly that already
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Thu Mar 26, 2009 11:03 am

  • Somehow I don't think I am the only one who is affected.
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Thu Mar 26, 2009 11:31 am

  • Let's say you're apparently the first to notice it since Nexuiz 1.0.

    So this is certainly not critical for the next release.

    This can wait till someone of the people who always complain about parts of Nexuiz being written in QuakeC notice that the engine is actually written in C, and that they could help by implementing a background DNS resolve feature.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Thu Mar 26, 2009 12:06 pm

  • alpha wrote:Somehow I don't think I am the only one who is affected.


    Since I updated from openSUSE 10.3 to 11 I have the same problem, and it can be quite annoying when working on maps and changing between Radiant and Nexuiz.

    BUT, I simply avoid launching Nexuiz when offline; problem solved. (That's the lazy way, but since this started with the OS update, I knew that I was the one who needs to resolve this, not Nexuiz)

    Something I noticed is that when pressing a bind to open a map on startup, the freeze time decreases from about 90 to about 15 seconds.
    User avatar
    sev
    Alien
     
    Posts: 248
    Joined: Sat Mar 29, 2008 3:03 pm
    Location: Switzerland

Thu Mar 26, 2009 12:29 pm

  • divVerent wrote:Let's say you're apparently the first to notice it since Nexuiz 1.0.


    No not really, see sev's post. And also keep in mind that only a small part of community is active on forum/irc.
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Thu Mar 26, 2009 1:37 pm

Thu Mar 26, 2009 1:55 pm

  • Well, the simplest solution should be the DNS resolve timeout... so someone who knows how to do that on Windows please do it.

    Just demanding will get you nowhere, though.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Mar 27, 2009 1:51 pm

  • cl_netport 445 is the best solution, What I would recommend is an automatic GUI popup explaining the freeze and offering a switch to "offline mode" if Nexuiz cannot connect to the master server. At least a "connecting to master server..." prompt would solve the problem.
    I rebooted the PC (hit the power button) the first time this happened to me, I saw the GUI appear just before windows switched to the logging off screen.
    It is DISASTROUS if your user thinks that your software is broken when it is working perfectly.

    P.S. The context of this incident is probably worth mentioning: I was showing a friend that Nexuiz has both Mac and Windows binaries in the same folder, required no installation and we could play across OSes. This LONG freeze occured on both OSes and had I not launched Nexuiz on the PC first I may have come to the conclusion that Nexuiz just freezes on macs. In the end my friend and I had a 2 hour fragfest. My friend was very impressed.
    User avatar
    ihsan
    Alien trapper
     
    Posts: 305
    Joined: Fri Mar 03, 2006 3:33 pm
    Location: Trinidad (Where Obama met Chavez)

Fri Mar 27, 2009 1:58 pm

  • Yes, but this is a problem from the BSD sockets API providing no way to even set a timeout for name server queries.

    Now, if there were a platform independent way to create a thread, this would be so easy...
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Mar 27, 2009 2:52 pm

  • divVerent wrote:Yes, but this is a problem from the BSD sockets API providing no way to even set a timeout for name server queries.

    Now, if there were a platform independent way to create a thread, this would be so easy...


    I wonder if we can use a stripped version of APR for this (just guessing)
    User avatar
    mand1nga
    Alien trapper
     
    Posts: 321
    Joined: Mon May 12, 2008 12:19 am

Fri Mar 27, 2009 2:53 pm

  • Ok, but surely a "connecting to master server" prompt and a button to set cl_netport 445 is not too difficult.
    User avatar
    ihsan
    Alien trapper
     
    Posts: 305
    Joined: Fri Mar 03, 2006 3:33 pm
    Location: Trinidad (Where Obama met Chavez)

Fri Mar 27, 2009 3:27 pm

  • ihsan wrote:Ok, but surely a "connecting to master server" prompt and a button to set cl_netport 445 is not too difficult.


    Well I gave up. Apparently the solution to this MAJOR issue could not be found on this forum.
    quit for good
    alpha
    Alien trapper
     
    Posts: 492
    Joined: Tue Jun 17, 2008 7:18 pm

Fri Mar 27, 2009 3:50 pm

  • Yes, it can't be found due to lack of knowledge to do it RIGHT.

    Maybe when we have more developers. At the current state of the project, it's out of scope (unless LordHavoc knows a better way).

    A prompt can't be displayed at that point, as a redraw of the menu can't be forced at a specific point.

    For now, just configure your computer so this problem does not happen (by simply not entering a DNS server if you can't reach any, or by setting the master server cvars not to host names but to IP addresses). In the next release, you'll be able to add these lines to autoexec.cfg to get rid of ALL name resolving:

    menu_updatecheck 0
    sv_masterextra1 69.59.212.88
    sv_masterextra2 64.22.107.125
    sv_masterextra3 92.62.40.6

    Alternatively, enter these lines into your "hosts" file (/etc/hosts on Linux, on Windows it's somewhere inside system32) - this will work even in 2.4.2:

    69.59.212.88 ghdigital.com
    64.22.107.125 dpmaster.deathmask.net
    92.62.40.6 dpmaster.tchr.no
    64.22.107.122 update.alientrap.org

    In both cases, note that these IPs may be subject to change, so if your server list no longer fills, try to find the current IPs of these hosts using the "nslookup" command.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Mar 27, 2009 8:37 pm

  • I think that if not the separate thread to download server list then"warsow style" "Download server list" button would be the best thing to do. There are situations where I have few minutes waiting for something which I could spent playing Nexuiz and I don't have Internet connection (or the connection is flooded by other traffic) at this time and sometimes I have only local connection to few other computers and I want to make quick LAN game. I don't want to clear my resolve.conf or use any autoexec/config/console commands for that. This button would be an improvement.
    xeros
    Member
     
    Posts: 10
    Joined: Sun Mar 23, 2008 12:29 am
    Location: PL

Next


Return to Nexuiz - Development




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest