Hackebein / docker-garrysmod

Dockerfiles for Garry's Mod
https://hub.docker.com/r/hackebein/garrysmod/
28 stars 2 forks source link

Server starts but can't connect #2

Closed LsHallo closed 4 years ago

LsHallo commented 4 years ago

Starting the container with:

docker run -d --name gmod \
    -p 27015:27015 \
    -e "AUTHKEY=****" \
    -e "GAMEMODE=terrortown" \
    -e "MAP=gm_flatgrass" \
    -e "WORKSHOPCOLLECTIONID=880783690" \
    -v /opt/garrysmod/:/opt/steam/garrysmod/cfg/ \
    hackebein/garrysmod

It downloads gmod and then starts it resulting in the following output:

Auto detecting CPUntinue to launch in 1 secondss
Using default binary: ./srcds_linux
Server will auto-restart if there is a crash.
Setting breakpad minidump AppID = 4000
[S_API] SteamAPI_Init(): Loaded 'steamclient.so' OK.
CAppInfoCacheReadFromDiskThread took 4 milliseconds to initialize
CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
[S_API FAIL] Tried to access Steam interface SteamUser020 before SteamAPI_Init succeeded.
[S_API] SteamAPI_Init(): Loaded 'steamclient.so' OK.
CAppInfoCacheReadFromDiskThread took 15 milliseconds to initialize
CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)

I suspect the error with the steam api is preventing me from connecting. It should not have to do with port forwarding or a firewall because I am running servers for factorio, minecraft and farming simulatur on the same server and they all work fine. I've forwarded port 27005-27015 to my server.

Hackebein commented 4 years ago

Can you run the server with the -i -t parameters? I forgot to add that information at the documentation.

Additional you need to forward udp and tcp.

example:

docker run -d -it \
    --name gmod \
    -p 27015:27015/tcp \
    -p 27015:27015/udp \
    -e "AUTHKEY=****" \
    -e "GAMEMODE=terrortown" \
    -e "MAP=gm_flatgrass" \
    -e "WORKSHOPCOLLECTIONID=880783690" \
    -v /opt/garrysmod/:/opt/steam/garrysmod/cfg/ \
    hackebein/garrysmod
LsHallo commented 4 years ago

That did the trick! Thank you.