Przeglądaj źródła

fix(details): correct port tables checked against live servers (#5228)

Corrects the details port tables and the matching servers.json entries after checking them against running game servers (sockets, configs and console logs).

- LISTEN check matches the ss protocol and local port exactly; unset or zero ports show "-".
- QuakeC config parser skips comment lines, fixing values read from stock configs on cod, cod2, cod4, coduo, codwaw and ql.
- A2S query is UDP for GoldSrc and Source games, including cs2, csgo and ins; col and sb game ports are TCP; rw query is UDP and TCP; sol game port is UDP and TCP.
- hz RCON read from RConPort, ut query fixed at 7787, armar RCON from the JSON config, l4d and l4d2 now pass +tv_port.
- Adds jk2 HTTP Downloads, pz Direct Connection and RCON, and pw RCON and REST API.
- Removes rows for ports that never open (GoldSrc Client, pw Unknown, arma3 Voice (unused), dst Steam: Auth, ac and sol Query, Steam on jc3, kf, ro and tu, Query on hcu and ut3).
- servers.json notes for ports that are off until enabled.

Related to #5196
Daniel Gibbs 1 dzień temu
rodzic
commit
2b4dc64d60

+ 2 - 1
lgsm/config-default/config-lgsm/l4d2server/_default.cfg

@@ -12,11 +12,12 @@
 ip="0.0.0.0"
 port="27015"
 clientport="27005"
+sourcetvport="27020"
 defaultmap="c5m1_waterfront"
 maxplayers="8"
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+startparameters="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
 
 ## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
 # Added to the end of startparameters.

+ 2 - 1
lgsm/config-default/config-lgsm/l4dserver/_default.cfg

@@ -12,11 +12,12 @@
 ip="0.0.0.0"
 port="27015"
 clientport="27005"
+sourcetvport="27020"
 defaultmap="l4d_hospital01_apartment"
 maxplayers="8"
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}"
+startparameters="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} -maxplayers ${maxplayers}"
 
 ## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
 # Added to the end of startparameters.

+ 90 - 228
lgsm/data/servers.json

@@ -10,12 +10,6 @@
           "default": 9600,
           "protocols": ["udp", "tcp"]
         },
-        {
-          "label": "Query",
-          "variable": "queryport",
-          "default": 8081,
-          "protocols": ["udp"]
-        },
         {
           "label": "HTTP",
           "variable": "httpport",
@@ -36,7 +30,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -70,12 +64,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -104,7 +92,8 @@
           "label": "RCON",
           "variable": "rconport",
           "default": 27020,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Add RCONEnabled=True to the start parameters to open it."
         }
       ]
     },
@@ -134,12 +123,6 @@
           "default": 2304,
           "protocols": ["udp"]
         },
-        {
-          "label": "Voice (unused)",
-          "variable": "voiceunusedport",
-          "default": 2305,
-          "protocols": ["udp"]
-        },
         {
           "label": "BattleEye",
           "variable": "battleeyeport",
@@ -163,10 +146,10 @@
           "protocols": ["udp"]
         },
         {
-          "label": "BattleEye",
-          "variable": "battleeyeport",
-          "default": 2005,
-          "protocols": ["tcp"]
+          "label": "RCON",
+          "variable": "rconport",
+          "default": 19999,
+          "protocols": ["udp"]
         }
       ]
     },
@@ -226,7 +209,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -260,12 +243,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -282,12 +259,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -358,7 +329,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -418,7 +389,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -468,7 +439,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -637,18 +608,6 @@
           "label": "Game",
           "variable": "port",
           "default": 27004,
-          "protocols": ["udp"]
-        },
-        {
-          "label": "Query",
-          "variable": "queryport",
-          "default": 27004,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Steam",
-          "variable": "steamport",
-          "default": 27005,
           "protocols": ["tcp"]
         }
       ]
@@ -665,7 +624,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         }
       ]
     },
@@ -681,12 +640,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -703,7 +656,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -737,12 +690,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -759,7 +706,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -794,12 +741,6 @@
           "variable": "queryport",
           "default": 27015,
           "protocols": ["udp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
-          "protocols": ["udp"]
         }
       ]
     },
@@ -825,7 +766,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -887,12 +828,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -925,12 +860,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -947,7 +876,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -981,7 +910,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1022,12 +951,6 @@
           "variable": "steamport",
           "default": 27016,
           "protocols": ["udp"]
-        },
-        {
-          "label": "Steam: Auth",
-          "variable": "steamauthport",
-          "default": 8766,
-          "protocols": ["udp"]
         }
       ]
     },
@@ -1043,7 +966,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1105,7 +1028,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1197,7 +1120,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1231,7 +1154,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1260,12 +1183,6 @@
           "variable": "port",
           "default": 7777,
           "protocols": ["udp"]
-        },
-        {
-          "label": "Query",
-          "variable": "queryport",
-          "default": 27015,
-          "protocols": ["tcp"]
         }
       ]
     },
@@ -1281,7 +1198,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1315,12 +1232,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -1337,7 +1248,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1372,12 +1283,6 @@
           "variable": "queryport",
           "default": 27015,
           "protocols": ["udp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
-          "protocols": ["udp"]
         }
       ]
     },
@@ -1424,8 +1329,9 @@
         {
           "label": "RCON",
           "variable": "rconport",
-          "default": 7779,
-          "protocols": ["tcp"]
+          "default": 8888,
+          "protocols": ["tcp"],
+          "note": "Off by default. Set RCONEnabled=true in GameServerSettings.ini to open it."
         }
       ]
     },
@@ -1441,7 +1347,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1497,7 +1403,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1531,7 +1437,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1583,12 +1489,6 @@
           "default": 4201,
           "protocols": ["udp"]
         },
-        {
-          "label": "Steam",
-          "variable": "steamport",
-          "default": 4202,
-          "protocols": ["udp"]
-        },
         {
           "label": "HTTP",
           "variable": "httpport",
@@ -1604,6 +1504,12 @@
           "variable": "port",
           "default": 27960,
           "protocols": ["udp"]
+        },
+        {
+          "label": "HTTP Downloads",
+          "variable": "httpport",
+          "default": 18200,
+          "protocols": ["tcp"]
         }
       ]
     },
@@ -1635,7 +1541,8 @@
           "label": "Web Interface",
           "variable": "httpport",
           "default": 8080,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Set bEnabled=true in KFWeb.ini to open it."
         }
       ]
     },
@@ -1677,12 +1584,6 @@
           "variable": "lanport",
           "default": 10707,
           "protocols": ["udp"]
-        },
-        {
-          "label": "Steam",
-          "variable": "steamport",
-          "default": 20610,
-          "protocols": ["udp"]
         }
       ]
     },
@@ -1698,7 +1599,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1732,7 +1633,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1799,7 +1700,8 @@
           "label": "RCON",
           "variable": "rconport",
           "default": 25575,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Set enable-rcon=true in server.properties to open it."
         }
       ]
     },
@@ -1815,7 +1717,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1925,7 +1827,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -1969,7 +1871,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -2053,12 +1955,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -2097,12 +1993,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -2191,7 +2081,8 @@
           "label": "RCON",
           "variable": "rconport",
           "default": 25575,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Set enable-rcon=true in server.properties to open it."
         }
       ]
     },
@@ -2207,7 +2098,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -2266,10 +2157,18 @@
           "protocols": ["udp"]
         },
         {
-          "label": "Unknown",
-          "variable": "unknownport",
-          "default": 1985,
-          "protocols": ["tcp"]
+          "label": "RCON",
+          "variable": "rconport",
+          "default": 25575,
+          "protocols": ["tcp"],
+          "note": "Off by default. Set RCONEnabled=True in PalWorldSettings.ini to open it."
+        },
+        {
+          "label": "REST API",
+          "variable": "restapiport",
+          "default": 8212,
+          "protocols": ["tcp"],
+          "note": "Off by default. Set RESTAPIEnabled=True in PalWorldSettings.ini to open it."
         }
       ]
     },
@@ -2281,11 +2180,23 @@
           "default": 16261,
           "protocols": ["udp"]
         },
+        {
+          "label": "Direct Connection",
+          "variable": "udpport",
+          "default": 16262,
+          "protocols": ["udp"]
+        },
         {
           "label": "Query",
           "variable": "queryport",
           "default": 16261,
           "protocols": ["udp"]
+        },
+        {
+          "label": "RCON",
+          "variable": "rconport",
+          "default": 27015,
+          "protocols": ["tcp"]
         }
       ]
     },
@@ -2388,12 +2299,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -2422,19 +2327,14 @@
           "label": "Web Interface",
           "variable": "httpport",
           "default": 8075,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Set bEnabled=True under [UWeb.WebServer] in roserver.ini to open it."
         },
         {
           "label": "LAN",
           "variable": "lanport",
           "default": 10757,
           "protocols": ["udp"]
-        },
-        {
-          "label": "Steam",
-          "variable": "steamport",
-          "default": 20610,
-          "protocols": ["udp"]
         }
       ]
     },
@@ -2508,13 +2408,14 @@
           "label": "Query",
           "variable": "queryport",
           "default": 4254,
-          "protocols": ["tcp"]
+          "protocols": ["udp", "tcp"]
         },
         {
           "label": "RCON",
           "variable": "rconport",
           "default": 4253,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Set RCON_Enabled=True in server.properties to open it."
         }
       ]
     },
@@ -2556,7 +2457,7 @@
           "label": "Game",
           "variable": "port",
           "default": 21025,
-          "protocols": ["udp"]
+          "protocols": ["tcp"]
         },
         {
           "label": "Query",
@@ -2568,7 +2469,8 @@
           "label": "RCON",
           "variable": "rconport",
           "default": 21026,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Set runRconServer to true and an rconServerPassword in starbound_server.config to open it."
         }
       ]
     },
@@ -2628,7 +2530,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -2716,13 +2618,7 @@
           "label": "Game",
           "variable": "port",
           "default": 23073,
-          "protocols": ["udp"]
-        },
-        {
-          "label": "Query",
-          "variable": "queryport",
-          "default": 23083,
-          "protocols": ["udp"]
+          "protocols": ["udp", "tcp"]
         },
         {
           "label": "Files",
@@ -2750,7 +2646,8 @@
           "label": "RCON",
           "variable": "rconport",
           "default": 21114,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off until a password is set in Rcon.cfg."
         }
       ]
     },
@@ -2820,12 +2717,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -2858,7 +2749,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -2892,7 +2783,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -2926,12 +2817,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -3032,7 +2917,8 @@
           "label": "Query (https)",
           "variable": "httpsqueryport",
           "default": 10443,
-          "protocols": ["tcp"]
+          "protocols": ["tcp"],
+          "note": "Off by default. Add https to query_protocols in ts3server.ini to open it."
         },
         {
           "label": "File Transfer",
@@ -3060,12 +2946,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -3083,12 +2963,6 @@
           "variable": "queryport",
           "default": 27015,
           "protocols": ["udp"]
-        },
-        {
-          "label": "Steam",
-          "variable": "steamport",
-          "default": 7778,
-          "protocols": ["udp"]
         }
       ]
     },
@@ -3173,12 +3047,6 @@
           "default": 7777,
           "protocols": ["udp"]
         },
-        {
-          "label": "Query",
-          "variable": "queryport",
-          "default": 6500,
-          "protocols": ["udp"]
-        },
         {
           "label": "Web Interface",
           "variable": "httpport",
@@ -3226,7 +3094,7 @@
         {
           "label": "Query",
           "variable": "queryport",
-          "default": 7778,
+          "default": 7787,
           "protocols": ["udp"]
         }
       ]
@@ -3301,12 +3169,6 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
-        },
-        {
-          "label": "Client",
-          "variable": "clientport",
-          "default": 27005,
           "protocols": ["udp"]
         }
       ]
@@ -3415,7 +3277,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",
@@ -3449,7 +3311,7 @@
           "label": "Query",
           "variable": "queryport",
           "default": 27015,
-          "protocols": ["tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "RCON",

+ 0 - 3
lgsm/modules/command_dev_parse_game_details.sh

@@ -117,7 +117,6 @@ declare -A server_details=(
 	['Sharding']="${sharding}"
 	['Shutdown Port']="${shutdownport}"
 	['Stats Port']="${statsport}"
-	['Steam Auth Port']="${steamauthport}"
 	['Steam Port']="${steamport}"
 	['Steamworks Port']="${steamworksport}"
 	['Telnet Enabled']="${telnetenabled}"
@@ -125,10 +124,8 @@ declare -A server_details=(
 	['Telnet Password']="${telnetpassword}"
 	['Telnet Port']="${telnetport}"
 	['Tickrate']="${tickrate}"
-	['Unknown Port']="${unknownport}"
 	['Version Count']="${versioncount}"
 	['Voice Port']="${voiceport}"
-	['Voice Unused Port']="${voiceunusedport}"
 	['World Name']="${worldname}"
 	['World Size']="${worldsize}"
 	['World Type']="${worldtype}"

+ 0 - 12
lgsm/modules/command_dev_query_raw.sh

@@ -156,12 +156,6 @@ fn_messages_separator
 		echo -e "Steamworks P2P:"
 	fi
 
-	if [ -n "${steamauthport}" ]; then
-		echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl | grep -c "${steamauthport}") \t$(ss -tupl | grep "${steamauthport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamauthport}" | grep udp | awk '{ print $2 }')"
-	else
-		echo -e "Steam: Auth:"
-	fi
-
 	if [ -n "${telnetport}" ]; then
 		echo -e "Telnet: \t${telnetport} \t$(ss -tupl | grep -c "${telnetport}") \t$(ss -tupl | grep "${telnetport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${telnetport}" | grep udp | awk '{ print $2 }')"
 	else
@@ -192,12 +186,6 @@ fn_messages_separator
 		echo -e "Voice:"
 	fi
 
-	if [ -n "${voiceunusedport}" ]; then
-		echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl | grep -c "${voiceunusedport}") \t$(ss -tupl | grep "${voiceunusedport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${voiceunusedport}" | grep udp | awk '{ print $2 }')"
-	else
-		echo -e "Voice (Unused):"
-	fi
-
 } \
 	| column -s $'\t' -t
 

+ 18 - 14
lgsm/modules/info_game.sh

@@ -89,7 +89,7 @@ fn_info_game_keyvalue_pairs_space() {
 # Comment: // or /* */
 fn_info_game_quakec() {
 	# -n: Suppresses automatic printing of pattern space.
-	# /^[[:space:]]*\<'"${2}"'\>/: Matches lines starting with optional leading whitespace and the word provided as the second argument ($2), considering it as a whole word.
+	# /^[[:space:]]*\(set[asu]\?[[:space:]]\+\)\?\<'"${2}"'\>/: Matches lines starting with optional leading whitespace, an optional set, seta, sets or setu, and the word provided as the second argument ($2), considering it as a whole word.
 	# { s/.*  *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern.
 	#   - s/.*  *"\?\([^"]*\)"\?/\1/: Matches and captures the value after any number of spaces, possibly surrounded by optional double quotes.
 	#     - .*: Matches any characters before the spaces.
@@ -106,7 +106,7 @@ fn_info_game_quakec() {
 	else
 		servercfgparse="${servercfgfullpath}"
 	fi
-	printf -v "${1}" '%s' "$(sed -n '/[[:space:]]\<'"${2}"'\>/ { s/.*  *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')"
+	printf -v "${1}" '%s' "$(sed -n '/^[[:space:]]*\(set[asu]\?[[:space:]]\+\)\?\<'"${2}"'\>/ { s/.*  *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')"
 	configtype="quakec"
 }
 
@@ -324,7 +324,6 @@ fn_info_game_arma3() {
 	serverpassword="${serverpassword:-"NOT SET"}"
 	steamport="$((port + 2))"
 	voiceport="${port:-"0"}"
-	voiceunusedport="$((port + 3))"
 }
 
 # Config Type: ini
@@ -424,7 +423,6 @@ fn_info_game_dodr() {
 fn_info_game_dst() {
 	if [ -f "${servercfgfullpath}" ]; then
 		fn_info_game_ini "port" "server_port"
-		fn_info_game_ini "steamauthport" "authentication_port"
 		fn_info_game_ini "steamport" "master_server_port"
 	fi
 	if [ -f "${clustercfgfullpath}" ]; then
@@ -449,7 +447,6 @@ fn_info_game_dst() {
 	serverpassword="${serverpassword:-"NOT SET"}"
 	shard="${shard:-"NOT SET"}"
 	sharding="${sharding:-"NOT SET"}"
-	steamauthport="${steamauthport:-"0"}"
 	steamport="${steamport:-"0"}"
 	tickrate="${tickrate:-"0"}"
 }
@@ -499,7 +496,6 @@ fn_info_game_kf() {
 	queryport=$((28902 + (port - 7757))) # Valve Query Port
 	servername="${servername:-"NOT SET"}"
 	serverpassword="${serverpassword:-"NOT SET"}"
-	steamport="20610"
 	unreal2queryport="$((port + 1))" # Unreal2 Query Port
 }
 
@@ -606,11 +602,16 @@ fn_info_game_pvr() {
 # Example: ServerName=SERVERNAME
 # Filetype: cfg
 fn_info_game_pw() {
+	if [ -f "${servercfgfullpath}" ]; then
+		rconport="$(sed -n 's/.*[(,]RCONPort=\([0-9]*\).*/\1/p' "${servercfgfullpath}" | tr -d '\r')"
+		restapiport="$(sed -n 's/.*[(,]RESTAPIPort=\([0-9]*\).*/\1/p' "${servercfgfullpath}" | tr -d '\r')"
+	fi
 	servername="${servername:-"NOT SET"}"
 	port="${port:-"0"}"
 	queryport="${port:-"0"}"
+	rconport="${rconport:-"25575"}"
+	restapiport="${restapiport:-"8212"}"
 	steamport="${steamport:-"0"}"
-	unknownport="1985"
 }
 
 # Config Type: ini
@@ -623,8 +624,10 @@ fn_info_game_pz() {
 		fn_info_game_ini "maxplayers" "MaxPlayers"
 		fn_info_game_ini "port" "DefaultPort"
 		fn_info_game_ini "rconpassword" "RCONPassword"
+		fn_info_game_ini "rconport" "RCONPort"
 		fn_info_game_ini "servername" "PublicName"
 		fn_info_game_ini "serverpassword" "Password"
+		fn_info_game_ini "udpport" "UDPPort"
 		fn_info_game_ini "worldname" "Map"
 
 	fi
@@ -632,9 +635,11 @@ fn_info_game_pz() {
 	maxplayers="${maxplayers:-"0"}"
 	port="${port:-"0"}"
 	queryport="${port:-"0"}"
+	rconport="${rconport:-"0"}"
 	rconpassword="${rconpassword:-"NOT SET"}"
 	servername="${servername:-"NOT SET"}"
 	serverpassword="${serverpassword:-"NOT SET"}"
+	udpport="${udpport:-"0"}"
 	worldname="${worldname:-"NOT SET"}"
 }
 
@@ -774,7 +779,6 @@ fn_info_game_tu() {
 	port="${port:-"0"}"
 	queryport="${queryport:-"0"}"
 	servername="${servername:-"NOT SET"}"
-	steamport="$((port + 1))"
 }
 
 # Config Type: ini
@@ -878,7 +882,7 @@ fn_info_game_ut() {
 	defaultmap="${defaultmap:-"NOT SET"}"
 	gametype="${gametype:-"NOT SET"}"
 	port="${port:-"0"}"
-	queryport="$((port + 1))"
+	queryport="7787"
 }
 
 # Config Type: ini
@@ -930,11 +934,11 @@ fn_info_game_armar() {
 		fn_info_game_json "rconport" ".rcon.port"
 	fi
 	adminpassword="${adminpassword:-"NOT SET"}"
-	battleeyeport="$((port + 4))"
 	configip="${configip:-"0.0.0.0"}"
 	maxplayers="${maxplayers:-"0"}"
 	port="${port:-"0"}"
 	queryport="${queryport:-"0"}"
+	rconport="${rconport:-"0"}"
 	servername="${servername:-"NOT SET"}"
 	serverpassword="${serverpassword:-"NOT SET"}"
 }
@@ -1405,12 +1409,13 @@ fn_info_game_hw() {
 fn_info_game_hz() {
 	if [ -f "${servercfgfullpath}" ]; then
 		fn_info_game_ini "adminpassword" "AdminPassword"
+		fn_info_game_ini "rconport" "RConPort"
 		fn_info_game_ini "servername" "ServerName"
 	fi
 	adminpassword="${adminpassword:-"NOT SET"}"
 	port="${port:-"0"}"
 	queryport="${queryport:-"0"}"
-	rconport="$((port + 2))"
+	rconport="${rconport:-"0"}"
 	servername="${servername:-"NOT SET"}"
 }
 
@@ -1489,7 +1494,6 @@ fn_info_game_jc3() {
 		fn_info_game_json "serverdescription" ".description"
 		fn_info_game_json "servername" ".name"
 		fn_info_game_json "serverpassword" ".password"
-		fn_info_game_json "steamport" ".steamPort"
 		fn_info_game_json "tickrate" ".maxTickRate"
 	fi
 	configip="${configip:-"0.0.0.0"}"
@@ -1500,7 +1504,6 @@ fn_info_game_jc3() {
 	serverdescription="${serverdescription:-"NOT SET"}"
 	servername="${servername:-"NOT SET"}"
 	serverpassword="${serverpassword:-"NOT SET"}"
-	steamport="${steamport:-"0"}"
 	tickrate="${tickrate:-"0"}"
 }
 
@@ -1511,6 +1514,7 @@ fn_info_game_jc3() {
 # Filetype: cfg
 fn_info_game_jk2() {
 	if [ -f "${servercfgfullpath}" ]; then
+		fn_info_game_quakec "httpport" "mv_httpserverport"
 		fn_info_game_quakec "maxplayers" "sv_maxclients"
 		fn_info_game_quakec "rconpassword" "rconpassword"
 		fn_info_game_quakec "servername" "sv_hostname"
@@ -1518,6 +1522,7 @@ fn_info_game_jk2() {
 		fn_info_game_quakec "serverversion" "mv_serverversion"
 	fi
 	defaultmap="${defaultmap:-"NOT SET"}"
+	httpport="${httpport:-"18200"}"
 	maxplayers="${maxplayers:-"0"}"
 	port="${port:-"0"}"
 	queryport="${port}"
@@ -1888,7 +1893,6 @@ fn_info_game_ro() {
 	queryport=$((28902 + (port - 7757))) # Valve Query Port
 	servername="${servername:-"NOT SET"}"
 	serverpassword="${serverpassword:-"NOT SET"}"
-	steamport="20610"
 	unreal2queryport="$((port + 1))" # Unreal2 Query Port
 }
 

+ 27 - 28
lgsm/modules/info_messages.sh

@@ -894,9 +894,19 @@ fn_port() {
 		echo -e "${lightblue}DESCRIPTION\tPORT\tPROTOCOL\tLISTEN${default}"
 	else
 		portname="${1}"
-		porttype="${2}"
+		portvalue="${!2}"
 		portprotocol="${3}"
-		echo -e "${portname}\t${!porttype}\t${portprotocol}\t$(echo "${ssinfo}" | grep "${portprotocol}" | grep -c "${!porttype}")"
+		portlisten="-"
+		if [[ "${portvalue}" =~ ^[0-9]+$ ]] && [ "${portvalue}" -gt 0 ]; then
+			portlisten="0"
+			while read -r netid _ _ _ localaddr _; do
+				if [ "${netid}" == "${portprotocol}" ] && [ "${localaddr##*:}" == "${portvalue}" ]; then
+					portlisten="1"
+					break
+				fi
+			done <<< "${ssinfo}"
+		fi
+		echo -e "${portname}\t${portvalue}\t${portprotocol}\t${portlisten}"
 	fi
 }
 
@@ -905,7 +915,6 @@ fn_info_messages_ac() {
 		fn_port "header"
 		fn_port "Game" port udp
 		fn_port "Game" port tcp
-		fn_port "Query" queryport udp
 		fn_port "HTTP" httpport tcp
 	} | column -s $'\t' -t
 }
@@ -927,7 +936,6 @@ fn_info_messages_arma3() {
 		fn_port "Voice" voiceport udp
 		fn_port "Query" queryport udp
 		fn_port "Steam" steamport udp
-		fn_port "Voice (unused)" voiceunusedport udp
 		fn_port "BattleEye" battleeyeport udp
 	} | column -s $'\t' -t
 }
@@ -937,7 +945,7 @@ fn_info_messages_armar() {
 		fn_port "header"
 		fn_port "Game" port udp
 		fn_port "Query" queryport udp
-		fn_port "BattleEye" battleeyeport tcp
+		fn_port "RCON" rconport udp
 	} | column -s $'\t' -t
 }
 
@@ -1072,9 +1080,7 @@ fn_info_messages_codwaw() {
 fn_info_messages_col() {
 	{
 		fn_port "header"
-		fn_port "Game" port udp
-		fn_port "Query" queryport tcp
-		fn_port "Steam" steamport tcp
+		fn_port "Game" port tcp
 	} | column -s $'\t' -t
 }
 
@@ -1082,7 +1088,7 @@ fn_info_messages_cs2() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Query" queryport tcp
+		fn_port "Query" queryport udp
 	} | column -s $'\t' -t
 }
 
@@ -1090,7 +1096,7 @@ fn_info_messages_csgo() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Query" queryport tcp
+		fn_port "Query" queryport udp
 		fn_port "RCON" rconport tcp
 		fn_port "SourceTV" sourcetvport udp
 		fn_port "Client" clientport udp
@@ -1129,7 +1135,6 @@ fn_info_messages_dst() {
 		fn_port "Game: Server" port udp
 		fn_port "Game: Master" masterport udp
 		fn_port "Steam" steamport udp
-		fn_port "Steam: Auth" steamauthport udp
 	} | column -s $'\t' -t
 }
 
@@ -1171,12 +1176,7 @@ fn_info_messages_goldsrc() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		if [ "${querytype}" == "protocol-valve-won" ]; then
-			fn_port "Query" queryport udp
-		else
-			fn_port "Query" queryport tcp
-		fi
-		fn_port "Client" clientport udp
+		fn_port "Query" queryport udp
 	} | column -s $'\t' -t
 }
 
@@ -1184,7 +1184,6 @@ fn_info_messages_hcu() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Query" queryport tcp
 	} | column -s $'\t' -t
 }
 
@@ -1216,7 +1215,7 @@ fn_info_messages_ins() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Query" queryport tcp
+		fn_port "Query" queryport udp
 		fn_port "RCON" rconport tcp
 		fn_port "SourceTV" sourcetvport udp
 		fn_port "Client" clientport udp
@@ -1245,7 +1244,6 @@ fn_info_messages_jc3() {
 		fn_port "header"
 		fn_port "Game" port udp
 		fn_port "Query" queryport udp
-		fn_port "Steam" steamport udp
 		fn_port "HTTP" httpport tcp
 	} | column -s $'\t' -t
 }
@@ -1254,6 +1252,7 @@ fn_info_messages_jk2() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
+		fn_port "HTTP Downloads" httpport tcp
 	} | column -s $'\t' -t
 }
 
@@ -1273,7 +1272,6 @@ fn_info_messages_kf() {
 		fn_port "Query - Gamespy" gamespyqueryport udp
 		fn_port "Web Interface" httpport tcp
 		fn_port "LAN" lanport udp
-		fn_port "Steam" steamport udp
 	} | column -s $'\t' -t
 	echo -e ""
 	echo -e "${bold}${lightgreen}${servername} Web Interface${default}"
@@ -1440,7 +1438,8 @@ fn_info_messages_pw() {
 		fn_port "header"
 		fn_port "Game" port udp
 		fn_port "Steam" steamport udp
-		fn_port "Unknown" unknownport tcp
+		fn_port "RCON" rconport tcp
+		fn_port "REST API" restapiport tcp
 	} | column -s $'\t' -t
 }
 
@@ -1448,7 +1447,9 @@ fn_info_messages_pz() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
+		fn_port "Direct Connection" udpport udp
 		fn_port "Query" queryport udp
+		fn_port "RCON" rconport tcp
 	} | column -s $'\t' -t
 }
 
@@ -1501,7 +1502,6 @@ fn_info_messages_ro() {
 		fn_port "Query - Unreal 2" unreal2queryport udp
 		fn_port "Web Interface" httpport tcp
 		fn_port "LAN" lanport udp
-		fn_port "Steam" steamport udp
 
 	} | column -s $'\t' -t
 	echo -e ""
@@ -1565,6 +1565,7 @@ fn_info_messages_rw() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
+		fn_port "Query" queryport udp
 		fn_port "Query" queryport tcp
 		fn_port "RCON" rconport tcp
 	} | column -s $'\t' -t
@@ -1581,7 +1582,7 @@ fn_info_messages_samp() {
 fn_info_messages_sb() {
 	{
 		fn_port "header"
-		fn_port "Game" port udp
+		fn_port "Game" port tcp
 		fn_port "Query" queryport tcp
 		fn_port "RCON" rconport tcp
 	} | column -s $'\t' -t
@@ -1669,7 +1670,7 @@ fn_info_messages_sol() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Query" queryport udp
+		fn_port "Game" port tcp
 		fn_port "Files" filesport tcp
 	} | column -s $'\t' -t
 }
@@ -1686,7 +1687,7 @@ fn_info_messages_source() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Query" queryport tcp
+		fn_port "Query" queryport udp
 		fn_port "RCON" rconport tcp
 		fn_port "SourceTV" sourcetvport udp
 		# Will not show if unavailable
@@ -1784,7 +1785,6 @@ fn_info_messages_tu() {
 		fn_port "header"
 		fn_port "Game" port udp
 		fn_port "Query" queryport udp
-		fn_port "Steam" steamport udp
 	} | column -s $'\t' -t
 }
 
@@ -1859,7 +1859,6 @@ fn_info_messages_ut3() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Query" queryport udp
 		fn_port "Web Interface" httpport tcp
 	} | column -s $'\t' -t
 	echo -e ""