no access to master server = no LAN query
by Robert Garrett · in Torque Game Engine · 07/11/2002 (7:38 am) · 6 replies
I've encountered an issue with the server query function and could use some help. While I've made graphical changes to the menu GUIs, the original GUI with the example scripts suffer the same symptoms.
First, I'd like to explain my network setup and the data gathered from testing several scenarios. A couple of notes about the setup:
- The server is always being run on one machine, while the client is always being run on a separate machine.
- The two machines are on the same LAN and are properly communicating via Windows networking.
- The results listed for each scenario are indicative of what occurs when the query server button is used.
-------------------------------------------------------
Scenario #1
-----------
Server - internet access enabled
Client - internet access enabled
Result - Client displays two iterations of the server in the list. I will assume one represents the LAN and one represents the server found through the GG master server.
Scenario #2
-----------
Server - internet access enabled (Internet Connection Sharing enabled)
Client - internet access gained through the server's ICS
Result - Client displays one iteration of the server in the list.
Scenario #3
-----------
Server - internet access disabled
Client - internet access enabled (ICS disabled)
Result - Client displays one iteration of the server in the list. Since the server has no means of communicating with the GG master server, and since the console verifies such, it's safe to assume the client successfully queries the LAN-only server in this scenario.
Scenario #4
-----------
Server - internet access disabled
Client - internet access disabled
Result - The console indicates an attempted LAN server ping, but no indication of communication with the server. The console also indicates, obviously, that it is unable to communicate with the GG master server. The query progress bar window hangs at the "Querying Master Server" stage, and does not respond to the CANCEL button.
-------------------------------------------------------
Based on the results of these scenarios, here is my theory: It appears the current server query code "breaks" if the client cannot communicate with the GG master server. The key scenarios to analyze are #3 and #4. These indicate a LAN server can only be properly queried when the client has access to the GG master server, *even if the game server itself does NOT have access to the master server*.
I've looked through both the source and scripts on this issue, and am uncertain of how to devise a solution, especially since I'm not even sure if this is how the code was intended to function. Honestly, the way it functions now doesn't make sense to me.
Any help would be appreciated.
-rob
EDIT: I'd also like to mention the console connect() command does work in all scenarios, but I'd rather not force players to type an IP address for LAN games.
First, I'd like to explain my network setup and the data gathered from testing several scenarios. A couple of notes about the setup:
- The server is always being run on one machine, while the client is always being run on a separate machine.
- The two machines are on the same LAN and are properly communicating via Windows networking.
- The results listed for each scenario are indicative of what occurs when the query server button is used.
-------------------------------------------------------
Scenario #1
-----------
Server - internet access enabled
Client - internet access enabled
Result - Client displays two iterations of the server in the list. I will assume one represents the LAN and one represents the server found through the GG master server.
Scenario #2
-----------
Server - internet access enabled (Internet Connection Sharing enabled)
Client - internet access gained through the server's ICS
Result - Client displays one iteration of the server in the list.
Scenario #3
-----------
Server - internet access disabled
Client - internet access enabled (ICS disabled)
Result - Client displays one iteration of the server in the list. Since the server has no means of communicating with the GG master server, and since the console verifies such, it's safe to assume the client successfully queries the LAN-only server in this scenario.
Scenario #4
-----------
Server - internet access disabled
Client - internet access disabled
Result - The console indicates an attempted LAN server ping, but no indication of communication with the server. The console also indicates, obviously, that it is unable to communicate with the GG master server. The query progress bar window hangs at the "Querying Master Server" stage, and does not respond to the CANCEL button.
-------------------------------------------------------
Based on the results of these scenarios, here is my theory: It appears the current server query code "breaks" if the client cannot communicate with the GG master server. The key scenarios to analyze are #3 and #4. These indicate a LAN server can only be properly queried when the client has access to the GG master server, *even if the game server itself does NOT have access to the master server*.
I've looked through both the source and scripts on this issue, and am uncertain of how to devise a solution, especially since I'm not even sure if this is how the code was intended to function. Honestly, the way it functions now doesn't make sense to me.
Any help would be appreciated.
-rob
EDIT: I'd also like to mention the console connect() command does work in all scenarios, but I'd rather not force players to type an IP address for LAN games.
#2
07/11/2002 (9:04 am)
Odd.. the masterServerQuery doesn't even try to connect to the master server until after it calls the function to query the Lan Servers.
#3
I have a mostly-complete solution now.
First, per John Folliard's code snippet in this thread, I added the console function to serverQuery.cc for querying LAN servers only. Next, in the same file, I commented out the queryLanServers() call within the queryMasterServer() function. Now we have separate functions for each type of query (master server and LAN) that are available to the scripts.
Next, I created two separate buttons in the joinServerGui.gui script. One for querying internet servers only, and one for querying LAN servers only. Also in the script, I renamed JoinServerGui::query(%this) to JoinServerGui::queryInternet(%this), and added the following function:
----------------------------------------------
function JoinServerGui::queryLan(%this)
{
queryLanServers(28000);
}
----------------------------------------------
The internet servers button calls queryInternet() and the LAN servers button calls queryLan().
The only issue now occurs when the client has no internet access and there is no LAN server running. The progress bar hangs while the client makes it's three attempts to ping for LAN servers. The progress bar DOES eventually go away, and functionally it's not a big deal, but it could seem like an error of sorts to a player who doesn't understand what's happening. Now that I think about it, I've seen this same thing in other games too.
So I guess it's a complete solution - woohoo!
-rob
07/11/2002 (10:42 am)
UPDATEI have a mostly-complete solution now.
First, per John Folliard's code snippet in this thread, I added the console function to serverQuery.cc for querying LAN servers only. Next, in the same file, I commented out the queryLanServers() call within the queryMasterServer() function. Now we have separate functions for each type of query (master server and LAN) that are available to the scripts.
Next, I created two separate buttons in the joinServerGui.gui script. One for querying internet servers only, and one for querying LAN servers only. Also in the script, I renamed JoinServerGui::query(%this) to JoinServerGui::queryInternet(%this), and added the following function:
----------------------------------------------
function JoinServerGui::queryLan(%this)
{
queryLanServers(28000);
}
----------------------------------------------
The internet servers button calls queryInternet() and the LAN servers button calls queryLan().
The only issue now occurs when the client has no internet access and there is no LAN server running. The progress bar hangs while the client makes it's three attempts to ping for LAN servers. The progress bar DOES eventually go away, and functionally it's not a big deal, but it could seem like an error of sorts to a player who doesn't understand what's happening. Now that I think about it, I've seen this same thing in other games too.
So I guess it's a complete solution - woohoo!
-rob
#4
07/11/2002 (10:47 am)
Sounds like a little Resource candidate, doesn't it... ;-)
#5
-rob
07/11/2002 (11:12 am)
Actually there is still one more issue to resolve. The cancel button can cause the progress bar to hang indefinitely until one of the query buttons are used again. Still looking into this one.-rob
#6
07/11/2002 (11:17 am)
Yeah, this would be a good resource when you get everything working how you want :)
Torque Owner Sabrecyd