JACoders / OpenJK

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
GNU General Public License v2.0
2.01k stars 612 forks source link

[openjkded] `+set fs_game X` does not add `X` to search paths #813

Closed isair closed 6 years ago

isair commented 8 years ago

When I run openjkded.x86_64 with +set fs_game MBII, and some other irrelevant parameters, I see this output at start:

] OpenJK-MP: v1.0.1.0 linux-x86_64 Mar 10 2016
] ----- FS_Startup -----
] Current search path:
] /root/.local/share/openjk/base/assets6.pk3 (29 files)
] /root/.local/share/openjk/base/assets3.pk3 (16 files)
] /root/.local/share/openjk/base/assets2.pk3 (62 files)
] /root/.local/share/openjk/base/assets1.pk3 (8320 files)
] /root/.local/share/openjk/base/assets0.pk3 (15346 files)
] /root/.local/share/openjk/base
] /opt/ja-server/base
] 
] ----------------------
] 23773 files in pk3 files
] execing mpdefault.cfg
] execing openjk_server.cfg
] couldn't exec autoexec.cfg
] ----- Initializing Renderer ----
] --- Common Initialization Complete ---
] Hostname: default
] Alias: localhost
] Alias: localhost.local
] IP: 127.0.0.1
] Opening IP socket: localhost:29071
] net_port will be changed upon restarting.
] execing duel_server.cfg
] WARNING: cvar 'sv_privateClients' must be numeric, setting to 0
] Can't find map maps/mb2_duel_ravager.bsp

The map would have been found if the server had /root/.local/share/openjk/MBII in its search paths. Am I missing something?

Directory information

ensiform commented 8 years ago

Can you verify its being passed to the game? It looks like it's not even used since there's no search path. And as far as I know no checks are performed on read/write test.

Chances are you'd also need to match the case of the folder to what's on the filesystem as well.

xycaleth commented 8 years ago

@isair Are you still having problems with this?

isair commented 8 years ago

Been a while since I could continue working on my project, I'll check again with the latest build and post an update.

For reference, a PR from the branch where I'm facing this issue: https://github.com/isair/jedi-academy-server/pull/9

isair commented 8 years ago

Still seeing this issue. It works fine with jampded and sees the MBII folder and every pk3 file in it.

I am using docker cloud to host my servers, while this stack file works:

open:
  environment:
    - FS_GAME=MBII
    - NET_PORT=29072
    - RTVRTM_CFG=open_rtvrtm.cfg
    - SERVER_CFG=open_server.cfg
  image: 'bsencan/jedi-academy-server:latest'
  ports:
    - '29072:29072/udp'
  restart: always
  volumes:
    - '/root/jedi-academy:/jedi-academy'

This one doesn't:

open:
  environment:
    - FS_GAME=MBII
    - NET_PORT=29072
    - RTVRTM_CFG=open_rtvrtm.cfg
    - SERVER_CFG=open_server.cfg
  image: 'bsencan/jedi-academy-server:openjk-beta'
  ports:
    - '29072:29072/udp'
  restart: always
  volumes:
    - '/root/jedi-academy:/jedi-academy'

The only difference being the images they use. In my docker image this is the script used to start the OpenJK server:

#! /bin/bash

# Environment variables and their default values.
[ -z "$NET_PORT" ] && NET_PORT=29070
[ -z "$FS_GAME" ] && FS_GAME=base
[ -z "$SERVER_CFG" ] && SERVER_CFG=server.cfg

# Symlink directories under /jedi-academy to /root/.local/share/openjk.
mkdir -p /root/.local/share/openjk
find /jedi-academy -maxdepth 1 -mindepth 1 -type d -exec ln -s "{}" /root/.local/share/openjk \; 2>/dev/null

# Configuration files need to be under /opt/ja-server/base directory.
cp /jedi-academy/*.cfg /opt/ja-server/base

# Shouldn't +set fs_game for base.
SET_FS_GAME="+set fs_game $FS_GAME"
if [ "$FS_GAME" = base ]; then
  SET_FS_GAME=""
fi

# If an rtvrtm configuration file has been defined and it exists, start rtvrtm.
RTVRTM_CFG_PATH="/jedi-academy/$RTVRTM_CFG"
if [ -f "$RTVRTM_CFG_PATH" ]; then
  cp /jedi-academy/*.txt /opt/rtvrtm
  cp "$RTVRTM_CFG_PATH" /opt/rtvrtm/rtvrtm.cfg
  (sleep 10; python /opt/rtvrtm/rtvrtm.py -c /opt/rtvrtm/rtvrtm.cfg) &
fi

# Start the server.
/opt/ja-server/openjkded.x86_64 \
  +set dedicated 2 \
  +set net_port "$NET_PORT" \
  "$SET_FS_GAME" \
  +exec "$SERVER_CFG"
ensiform commented 8 years ago

I would suggest making the fs_game the first of the set options and see if that makes any difference.

ensiform commented 6 years ago

Did the above suggestion help or is there still issues?

isair commented 6 years ago

I can let you know next month when I start working on my jedi-academy-server project again. From: Ensiform Sent: Monday, December 25, 2017 9:46 PM To: JACoders/OpenJK Cc: Baris Sencan; Mention Subject: Re: [JACoders/OpenJK] [openjkded] +set fs_game X does not add Xto search paths (#813)

Did the above suggestion help or is there still issues? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

isair commented 6 years ago

This seems to be an issue still. Using the latest nightly build, with the proposed change applied.

Code: https://github.com/isair/jedi-academy-server/tree/feature/isair-openjk

ensiform commented 6 years ago

Honestly not sure what the issue would be, sorry. It works fine elsewhere. Docker probably does something strange with the arguments is all I can think of.

xycaleth commented 6 years ago

https://github.com/isair/jedi-academy-server/blob/feature/isair-openjk/server/start.sh#L33

This looks a bit suspicious. You're quoting the variable so your command will look like this:

openjkded.x86_64 "+set fs_game \"mod\"" ...

JKA will treat quoted strings as a single argument. Try removing the quotes.

ensiform commented 6 years ago

That makes sense why it is not working

isair commented 6 years ago

Thanks. That does make sense indeed. However it's different behavior than linuxjampded as my master branch works fine on a couple servers right now. I'll try this in a few hours and let you all know.

ensiform commented 6 years ago

Yes it is different because it fixes some issues with incorrect parsing of quoted arguments afaik.

isair commented 6 years ago

It worked. I'm closing the issue.

I'm getting a segfault when any player logs in to the server though. Using the latest 32-bit Linux build. I'll search around a bit and may open an issue.