PhasecoreX / docker-ut2004-server

Docker image for a UT2004 server, running as a non-root user
GNU General Public License v3.0
31 stars 7 forks source link

Can't see Server in LAN browser #18

Closed ppaulis closed 10 months ago

ppaulis commented 10 months ago

Hi!

first of all, thanks for the great work and keeping those games alive! :-)

I'm running your image in a docker-compose setup for my upcoming LAN Party :

version: "3.7"

volumes:
  ut2004:
    name: ut2004

services:
  ut2004:
    image: phasecorex/ut2004-server
    container_name: ut2004
    ports:
      - 10.0.0.11:7777:7777/udp
      - 10.0.0.11:7778:7778/udp
      - 10.0.0.11:7787:7787/udp
    environment:
      CD_KEY: xxxxx-xxxxx-xxxxx-xxxxx
      PUID: 1000
    volumes:
      - type: volume
        source: ut2004
        target: /data

I changed the master server to openspy. But I can't see the server in UT2004's LAN browser.

Output of the container is :

Starting with UID/GID: 1000/1000
Starting server...
Executing Class Engine.ServerCommandlet
Browse: DM-Antalus?Name=Player?Class=Engine.Pawn?Character=Jakob?team=255?game=xGame.xDeathMatch
Collecting garbage
Purging garbage
Garbage: objects: 36651->36645; refs: 417402
Game class is 'xDeathMatch'
Fixing up DM-Antalus
Bringing Level DM-Antalus.myLevel up for play (35) appSeconds: 2.044885...
GameInfo::InitGame : bEnableStatLogging False
UdpServerQuery(crt): Port 7787 successfully bound.
Resolving master0.gamespy.com...
MasterServerUplink: MasterServerGameStats not found - stats uploading disabled.
Defaulting to false
Defaulting to false
Resolving utmaster.openspy.net...
Loading Available Maps
Loading Game Types
xWebAdmin.UTServerAdmin Initialized on port 8080
MasterServerUplink: Resolved utmaster.openspy.net as 157.245.212.59.
AInternetLink Resolve failed: Can't find host master0.gamespy.com (HOST_NOT_FOUND)
UdpGameSpyUplink: Failed to resolve master server address, aborting.
MasterServerUplink: Connection to utmaster.openspy.net established.
Approval APPROVED
Master server assigned our MatchID: 1234

Do you have any idea what I could be missing here..?

Thanks a lot, Best regards, Pascal

PhasecoreX commented 10 months ago

Hello! You're welcome!

The internet thinks that for LAN you need port 10777 UDP, can you see if adding

- 10.0.0.11:10777:10777/udp

to the port section fixes it? If it does I'll update the documentation. I'll also have to look into if it's the same port for the UT99 server as well.

PhasecoreX commented 10 months ago

I was able to test this locally, and there's some weird stuff happening.

Based on the config, internet was correct in thinking that port 10777 UDP needs to be opened:

[IpDrv.MasterServerLink]
LANPort=11777
LANServerPort=10777
MasterServerList=(Address="utmaster.openspy.net",Port=28902)

However when I add that to the ports section, I see this in the logs every time the game queries the server for information:

RecvFrom returned SOCKET_ERROR 111

If I run the container in host network mode, it works fine. If I run the UT99 server specifying the ports like above (it uses 8777/UDP for the LAN query port), it also runs fine. So there's something weird that UT2004 doesn't like having it's network ports mapped. I assume since UT99 is newer (469c was released recently) it doesn't exhibit the same behavior.

I'm not sure what to do at the moment for this. For you, you can either run it in host network mode, or you can manually type in the IP address to connect manually (only the query seems to be affected).

ppaulis commented 10 months ago

Thanks! Running in network mode host is (in my case) a perfectly viable solution!

I'll close the issue.