1
0
Fork 0

Avoid spurious listener fires.

When retrieving the dynamic server list, avoid spurious fires and noisy output.
This commit is contained in:
James Turner 2012-11-19 23:05:11 +00:00
parent 10c635752a
commit 234b20ee3b

View file

@ -24,10 +24,7 @@
var servers = props.globals.getNode("/sim/gui/dialogs/multiplay/servers", 1);
var updateServers = func {
servers.removeChildren("value");
debug.dump("Got server list");
servers.removeChildren("value");
# get the results list from the server
var serverlist = props.globals.getNode("/sim/multiplay/server-list", 1);
@ -54,8 +51,8 @@
}
# listen for results arriving
setlistener("/sim/multiplay/got-servers", updateServers, 1);
setlistener("/sim/multiplay/get-servers-failure", updateServersFailed, 1);
setlistener("/sim/multiplay/got-servers", updateServers);
setlistener("/sim/multiplay/get-servers-failure", updateServersFailed);
fgcommand("xmlhttprequest", props.Node.new({
"url" : "http://liveries.flightgear.org/mpstatus/mpservers.xml",