gamedig / node-gamedig

Query game servers and not only! Node.JS/Deno/Bun or Bash (via the CLI).
https://www.npmjs.com/package/gamedig
MIT License
614 stars 144 forks source link

feat: Adding Toxikk as supported Game / Adding UDK Games Support for LAN Mode #628

Open Hornochs opened 2 months ago

Hornochs commented 2 months ago

What is this feature about? Add Toxikk, an Areana FPS as supported Protocol. For this UDK Games (Unreal Engine 3) needs to be addes as supported protocol

Additional context/references Toxikk uses Unreal 3 / UDK Engine with additional Support for the Valve Protocol.

Hornochs commented 2 months ago

UDK Games using different SubSystems, for the networking stuff as well. In the Engine itself are systems integrated for LAN Servers and for Steam. The Developer can decide if Subsystems like steam are enabled or not. Toxikk uses Steam.

The Caviot: The Steam Subsystem gets only loaded on Dedicated Servers which are ment for Internethosting, equals startparamenter bIsLanMatch=false and make it possible to query by Valve Protocol. As soon as the servers are startet with bIsLanMatch=true the Steam Subsystem won't be loaded. Then a different Subsystem gets loaded, if I unterstand correctly it's [IpDrv.OnlineGameInterfaceImpl]

Having a look in Toxikk at UDKGame/Config/UDKEngine.ini seeing two references on Port 14001:

[IpDrv.OnlineGameInterfaceImpl]
LanAnnouncePort=14001
LanQueryTimeout=5.0
LanPacketPlatformMask=1
LanGameUniqueId=0x4D5707DB

[OnlineSubsystemLive.OnlineSubsystemLive]
LanAnnouncePort=14001
VoiceNotificationDelta=0.2
NumLogins=1
CurrentNotificationPosition=NNP_BottomRight
MaxLocalTalkers=2
MaxRemoteTalkers=9
bShouldLogArbitrationData=true
bShouldLogStatsData=true
LanQueryTimeout=3.0
LanPacketPlatformMask=1
LanGameUniqueId=1297287213
bShouldUseMcp=false

After digging in the Source Code of the Unreal Engine [OnlineSubsystemLive.OnlineSubsystemLive] referes to xBox 360 System. More Details about LAN Quering is written in the officiel UDK documentation. After messing around I noticed the following "flow" how UDK handles LAN Discovery.

Sending the UDP Beacon Package to the server directly, results in the same behaviour: the Server sends an Broadcast with the Package