2011-06-16 22:33:06 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
<PropertyList>
|
|
|
|
<name>multiplayer</name>
|
|
|
|
<layout>vbox</layout>
|
2012-01-03 23:33:26 +00:00
|
|
|
<resizable>false</resizable>
|
2011-06-16 22:33:06 +00:00
|
|
|
|
|
|
|
<nasal>
|
2017-04-02 16:31:56 +00:00
|
|
|
<open>
|
|
|
|
<![CDATA[
|
2012-01-03 23:33:26 +00:00
|
|
|
if ((getprop("/sim/multiplay/selected-server") == nil) or
|
|
|
|
(getprop("/sim/multiplay/selected-server") == "" ) ){
|
|
|
|
var tx = getprop("/sim/multiplay/txhost");
|
|
|
|
var dlg = cmdarg();
|
|
|
|
var servers = cmdarg().getChildren("group")[1].getChildren("combo")[0].getChildren("value");
|
|
|
|
foreach (var s; servers) {
|
|
|
|
var server = s.getValue();
|
|
|
|
var host = split(" ", server)[0];
|
|
|
|
if (host == tx) {
|
|
|
|
setprop("/sim/multiplay/selected-server", server);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-05-14 15:48:03 +00:00
|
|
|
if (getprop("/sim/multiplay/rxport") == nil or getprop("/sim/multiplay/rxport") == 0)
|
|
|
|
setprop("/sim/multiplay/rxport",5000);
|
|
|
|
|
|
|
|
if (getprop("/sim/multiplay/txport") == nil or getprop("/sim/multiplay/txport") == 0)
|
|
|
|
setprop("/sim/multiplay/txport",5000);
|
|
|
|
|
2017-04-02 16:31:56 +00:00
|
|
|
if (getprop("/sim/multiplay/protocol-version") == 2)
|
|
|
|
setprop("/sim/gui/dialogs/multiplay/protocol-version", "Visible to only 2017+");
|
|
|
|
else
|
|
|
|
setprop("/sim/gui/dialogs/multiplay/protocol-version", "Visible to all");
|
|
|
|
|
2012-11-12 12:49:23 +00:00
|
|
|
var servers = props.globals.getNode("/sim/gui/dialogs/multiplay/servers", 1);
|
2015-03-15 21:22:13 +00:00
|
|
|
var updateServers = func(n) {
|
|
|
|
if( !n.getValue() ) return;
|
2012-11-19 23:05:11 +00:00
|
|
|
servers.removeChildren("value");
|
2012-11-12 12:49:23 +00:00
|
|
|
# get the results list from the server
|
|
|
|
var serverlist = props.globals.getNode("/sim/multiplay/server-list", 1);
|
|
|
|
|
|
|
|
var i=0;
|
|
|
|
foreach (var s; serverlist.getChildren("server")) {
|
|
|
|
|
2016-11-09 11:51:23 +00:00
|
|
|
# prepare some default values
|
|
|
|
s.initNode("online", 1, "BOOL" );
|
|
|
|
s.initNode("location", "unknown", "STRING" );
|
|
|
|
s.initNode("name", s.getNode("hostname").getValue(), "STRING" );
|
2012-11-12 12:49:23 +00:00
|
|
|
if (!s.getNode("online").getBoolValue()) {
|
|
|
|
continue; # skip offline servers
|
|
|
|
}
|
|
|
|
|
|
|
|
# label is name and location, for the moment
|
|
|
|
# should we include the number of users? or wait until we
|
|
|
|
# have a better UI toolkit?
|
|
|
|
var nm = s.getNode("hostname").getValue() ~ " - " ~ s.getNode("location").getValue();
|
|
|
|
servers.getNode("value[" ~ i ~ "]", 1).setValue(nm);
|
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
gui.dialog_update("multiplayer", "host");
|
|
|
|
}
|
|
|
|
|
2012-12-29 14:39:26 +00:00
|
|
|
var static_serverList = [
|
|
|
|
['mpserver01.flightgear.org', 'Frankfurt, Germany'],
|
|
|
|
['mpserver02.flightgear.org', 'Kansas, USA'],
|
|
|
|
['mpserver03.flightgear.org', 'Germany'],
|
|
|
|
['mpserver04.flightgear.org', 'United Kingdom'],
|
|
|
|
['mpserver05.flightgear.org', 'Chicago, USA'],
|
|
|
|
['mpserver07.flightgear.org', 'Wisconsin, USA'],
|
|
|
|
['mpserver08.flightgear.org', 'Frankfurt am Main, Germany'],
|
|
|
|
['mpserver09.flightgear.org', 'Koln, Germany'],
|
|
|
|
['mpserver10.flightgear.org', 'Montpellier, France'],
|
|
|
|
['mpserver11.flightgear.org', 'Vilnius, Lithuania'],
|
|
|
|
['mpserver12.flightgear.org', 'Amsterdam, Netherlands'],
|
|
|
|
['mpserver13.flightgear.org', 'Grenoble, France']
|
|
|
|
];
|
|
|
|
|
2015-03-15 21:22:13 +00:00
|
|
|
var updateServersFailed = func(n) {
|
|
|
|
if( !n.getValue() ) return;
|
2012-11-12 12:49:23 +00:00
|
|
|
debug.dump("Failed to retrieve server list!");
|
2012-12-29 14:39:26 +00:00
|
|
|
|
|
|
|
servers.removeChildren("value");
|
|
|
|
var i=0;
|
|
|
|
foreach (var s; static_serverList) {
|
|
|
|
# create the node the PUI combo
|
|
|
|
var nm = s[0] ~ " - " ~ s[1];
|
|
|
|
servers.getNode("value[" ~ i ~ "]", 1).setValue(nm);
|
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
gui.dialog_update("multiplayer", "host");
|
2012-11-12 12:49:23 +00:00
|
|
|
}
|
|
|
|
|
2015-03-12 08:50:16 +00:00
|
|
|
# listen for results arriving
|
2012-11-19 23:05:11 +00:00
|
|
|
setlistener("/sim/multiplay/got-servers", updateServers);
|
|
|
|
setlistener("/sim/multiplay/get-servers-failure", updateServersFailed);
|
2015-03-12 08:50:16 +00:00
|
|
|
fgcommand("multiplayer-refreshserverlist");
|
2012-11-12 12:49:23 +00:00
|
|
|
]]>
|
2011-06-16 22:33:06 +00:00
|
|
|
</open>
|
|
|
|
|
|
|
|
<close>
|
|
|
|
</close>
|
|
|
|
</nasal>
|
|
|
|
|
|
|
|
<!-- titlebar -->
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<empty><stretch>1</stretch></empty>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<label>Multiplayer Settings</label>
|
|
|
|
</text>
|
|
|
|
|
|
|
|
<empty><stretch>1</stretch></empty>
|
|
|
|
|
|
|
|
<button>
|
|
|
|
<pref-width>16</pref-width>
|
|
|
|
<pref-height>16</pref-height>
|
|
|
|
<legend></legend>
|
|
|
|
<keynum>27</keynum>
|
|
|
|
<border>2</border>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
</group>
|
|
|
|
<hrule/>
|
|
|
|
|
2012-05-01 09:10:37 +00:00
|
|
|
<!-- main dialog area -->
|
2011-06-16 22:33:06 +00:00
|
|
|
<group>
|
|
|
|
<layout>table</layout>
|
|
|
|
<halign>center</halign>
|
2012-05-01 09:10:37 +00:00
|
|
|
|
|
|
|
<text>
|
|
|
|
<row>0</row>
|
|
|
|
<col>0</col>
|
2015-05-03 16:13:50 +00:00
|
|
|
<label> Options:</label>
|
2012-05-01 09:10:37 +00:00
|
|
|
<halign>right</halign>
|
|
|
|
</text>
|
|
|
|
<checkbox>
|
|
|
|
<row>0</row>
|
|
|
|
<col>1</col>
|
|
|
|
<colspan>2</colspan>
|
|
|
|
<halign>left</halign>
|
|
|
|
<name>hide-replay</name>
|
|
|
|
<label>Hide replay sessions over MP (less annoying to other players)</label>
|
|
|
|
<property>/sim/multiplay/freeze-on-replay</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>hide-replay</object-name>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
|
|
|
<checkbox>
|
|
|
|
<row>1</row>
|
|
|
|
<col>1</col>
|
|
|
|
<colspan>2</colspan>
|
|
|
|
<halign>left</halign>
|
|
|
|
<name>ai-traffic</name>
|
|
|
|
<label>Show AI Traffic (mixing MP and AI traffic may be confusing)</label>
|
|
|
|
<property>/sim/traffic-manager/enabled</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>ai-traffic</object-name>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
2020-06-08 22:52:50 +00:00
|
|
|
|
2020-12-18 16:58:41 +00:00
|
|
|
<checkbox>
|
|
|
|
<row>2</row>
|
|
|
|
<col>1</col>
|
|
|
|
<colspan>2</colspan>
|
|
|
|
<halign>left</halign>
|
|
|
|
<name>mpcarrier-auto-attach</name>
|
|
|
|
<label>Automatically enable AI scenarios and attach to multiplayer carriers</label>
|
|
|
|
<property>/sim/mp-carriers/auto-attach</property>
|
|
|
|
<binding>
|
|
|
|
<command>property-toggle</command>
|
|
|
|
<property>/sim/mp-carriers/auto-attach</property>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
2020-06-08 22:52:50 +00:00
|
|
|
<checkbox>
|
|
|
|
<row>4</row>
|
|
|
|
<col>1</col>
|
|
|
|
<colspan>2</colspan>
|
|
|
|
<halign>left</halign>
|
2018-01-28 14:45:52 +00:00
|
|
|
<visible>
|
2018-02-04 15:55:50 +00:00
|
|
|
<property>sim/multiplay/transmit-filter-property-base-available</property>
|
2018-01-28 14:45:52 +00:00
|
|
|
</visible>
|
|
|
|
<property>sim/multiplay/transmit-filter-property-base</property>
|
|
|
|
<live>true</live>
|
|
|
|
<label>Emesary only multiplayer mode</label>
|
|
|
|
<binding>
|
|
|
|
<command>property-toggle</command>
|
|
|
|
<property>sim/multiplay/transmit-filter-property-base</property>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
2020-06-08 22:52:50 +00:00
|
|
|
<text>
|
|
|
|
<row>5</row>
|
|
|
|
<col>0</col>
|
|
|
|
<halign>right</halign>
|
|
|
|
<label>Compatibility</label>
|
|
|
|
</text>
|
2018-01-28 14:45:52 +00:00
|
|
|
<combo>
|
2020-06-08 22:52:50 +00:00
|
|
|
<row>5</row>
|
2018-01-28 14:45:52 +00:00
|
|
|
<col>1</col>
|
2017-04-02 16:31:56 +00:00
|
|
|
<halign>left</halign>
|
|
|
|
<name>protocol-version</name>
|
|
|
|
<pref-width>300</pref-width>
|
|
|
|
<property>/sim/gui/dialogs/multiplay/protocol-version</property>
|
|
|
|
<value>Visible to all</value>
|
|
|
|
<value>Visible to only 2017+</value>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>protocol-version</object-name>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
|
|
|
var val = getprop("/sim/gui/dialogs/multiplay/protocol-version");
|
|
|
|
if (val == "Visible to all") {
|
|
|
|
setprop("/sim/multiplay/protocol-version", 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (val == "Visible to only 2017+") {
|
|
|
|
setprop("/sim/multiplay/protocol-version", 2);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</binding>
|
|
|
|
</combo>
|
|
|
|
|
|
|
|
<text>
|
2020-06-08 22:52:50 +00:00
|
|
|
<row>6</row>
|
2017-04-02 16:31:56 +00:00
|
|
|
<col>0</col>
|
|
|
|
<halign>right</halign>
|
|
|
|
<label> Callsign:</label>
|
2011-06-16 22:33:06 +00:00
|
|
|
</text>
|
|
|
|
<input>
|
2020-06-08 22:52:50 +00:00
|
|
|
<row>6</row>
|
2017-04-02 16:31:56 +00:00
|
|
|
<col>1</col>
|
|
|
|
<halign>left</halign>
|
|
|
|
<property>/sim/multiplay/callsign</property>
|
|
|
|
<enable>
|
|
|
|
<not>
|
|
|
|
<property>/sim/multiplay/online</property>
|
|
|
|
</not>
|
|
|
|
</enable>
|
2011-06-16 22:33:06 +00:00
|
|
|
</input>
|
2017-05-14 15:48:03 +00:00
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
2020-06-08 22:52:50 +00:00
|
|
|
<row>6</row>
|
2017-05-14 15:48:03 +00:00
|
|
|
<col>1</col>
|
|
|
|
<text>
|
|
|
|
<width>2</width>
|
|
|
|
<halign>right</halign>
|
|
|
|
<label>rxPort</label>
|
|
|
|
</text>
|
|
|
|
<input>
|
|
|
|
<pref-width>50</pref-width>
|
|
|
|
<halign>left</halign>
|
|
|
|
<property>/sim/multiplay/rxport</property>
|
|
|
|
<enable>
|
|
|
|
<not>
|
|
|
|
<property>/sim/multiplay/online</property>
|
|
|
|
</not>
|
|
|
|
</enable>
|
|
|
|
</input>
|
|
|
|
</group>
|
2012-05-01 09:10:37 +00:00
|
|
|
<!-- status area -->
|
2020-06-08 22:52:50 +00:00
|
|
|
|
|
|
|
<combo>
|
|
|
|
<name>host</name>
|
|
|
|
<halign>left</halign>
|
|
|
|
<row>7</row>
|
|
|
|
<col>1</col>
|
|
|
|
<colspan>2</colspan>
|
|
|
|
<pref-width>350</pref-width>
|
|
|
|
<property>/sim/multiplay/selected-server</property>
|
|
|
|
<editable>true</editable>
|
|
|
|
|
|
|
|
<properties>/sim/gui/dialogs/multiplay/servers</properties>
|
|
|
|
</combo>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<row>8</row>
|
|
|
|
<col>0</col>
|
|
|
|
<halign>right</halign>
|
|
|
|
<label>Server:</label>
|
|
|
|
</text>
|
2011-06-16 22:33:06 +00:00
|
|
|
<text>
|
|
|
|
<visible>
|
|
|
|
<not><property>/sim/multiplay/online</property></not>
|
|
|
|
</visible>
|
2020-06-08 22:52:50 +00:00
|
|
|
<row>8</row>
|
2011-06-16 22:33:06 +00:00
|
|
|
<col>1</col>
|
2012-01-03 23:33:26 +00:00
|
|
|
<halign>left</halign>
|
2012-05-01 09:10:37 +00:00
|
|
|
<label>Not connected</label>
|
2011-06-16 22:33:06 +00:00
|
|
|
</text>
|
|
|
|
<text>
|
2020-06-08 22:52:50 +00:00
|
|
|
<row>8</row>
|
|
|
|
<col>1</col>
|
2011-06-16 22:33:06 +00:00
|
|
|
<visible>
|
|
|
|
<property>/sim/multiplay/online</property>
|
|
|
|
</visible>
|
2012-01-03 23:33:26 +00:00
|
|
|
<halign>left</halign>
|
2011-06-16 22:33:06 +00:00
|
|
|
<label>MMMMMMMMMMMMMMMMM</label>
|
|
|
|
<format>Connected to %s</format>
|
|
|
|
<property>/sim/multiplay/txhost</property>
|
|
|
|
<live>true</live>
|
|
|
|
</text>
|
|
|
|
</group>
|
2012-05-01 09:10:37 +00:00
|
|
|
|
|
|
|
<!-- button area -->
|
2012-01-03 23:33:26 +00:00
|
|
|
<hrule/>
|
2011-06-16 22:33:06 +00:00
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<default-padding>10</default-padding>
|
|
|
|
<empty><stretch>true</stretch></empty>
|
|
|
|
|
|
|
|
<button>
|
2012-01-03 23:33:26 +00:00
|
|
|
<legend>Connect</legend>
|
2012-01-04 21:53:25 +00:00
|
|
|
<equal>true</equal>
|
2012-01-03 23:33:26 +00:00
|
|
|
<enable>
|
|
|
|
<not>
|
|
|
|
<property>/sim/multiplay/online</property>
|
|
|
|
</not>
|
|
|
|
</enable>
|
2011-06-16 22:33:06 +00:00
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
2012-01-03 23:33:26 +00:00
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
2017-05-14 15:48:03 +00:00
|
|
|
fgcommand("multiplayer-connect", props.Node.new({
|
|
|
|
"servername": getprop("/sim/multiplay/selected-server"),
|
|
|
|
"rxport": getprop("/sim/multiplay/rxport"),
|
|
|
|
"txport": getprop("/sim/multiplay/txport")
|
|
|
|
}));
|
2012-01-03 23:33:26 +00:00
|
|
|
</script>
|
|
|
|
</binding>
|
2011-06-16 22:33:06 +00:00
|
|
|
</button>
|
2012-05-01 09:10:37 +00:00
|
|
|
|
2012-01-03 23:33:26 +00:00
|
|
|
<button>
|
|
|
|
<legend>Disconnect</legend>
|
2012-01-04 21:53:25 +00:00
|
|
|
<equal>true</equal>
|
2012-01-03 23:33:26 +00:00
|
|
|
<enable>
|
|
|
|
<property>/sim/multiplay/online</property>
|
|
|
|
</enable>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
2015-03-12 08:50:16 +00:00
|
|
|
<command>multiplayer-disconnect</command>
|
2012-01-03 23:33:26 +00:00
|
|
|
<subsystem>mp</subsystem>
|
|
|
|
</binding>
|
|
|
|
</button>
|
2012-05-01 09:10:37 +00:00
|
|
|
|
2012-01-04 21:53:25 +00:00
|
|
|
<button>
|
|
|
|
<row>1</row><col>2</col>
|
|
|
|
<legend>Server Status</legend>
|
|
|
|
<binding>
|
|
|
|
<command>open-browser</command>
|
|
|
|
<path>http://mpmap01.flightgear.org/mpstatus/</path>
|
|
|
|
</binding>
|
|
|
|
</button>
|
2012-05-01 09:10:37 +00:00
|
|
|
|
2012-01-03 23:33:26 +00:00
|
|
|
<button>
|
|
|
|
<legend>Close</legend>
|
2012-01-04 21:53:25 +00:00
|
|
|
<default>true</default>
|
2012-01-03 23:33:26 +00:00
|
|
|
<equal>true</equal>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<empty><stretch>true</stretch></empty>
|
2011-06-16 22:33:06 +00:00
|
|
|
</group>
|
|
|
|
|
2012-01-03 23:33:26 +00:00
|
|
|
</PropertyList>
|