Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change "Hostname" Insurgency Sandstorm ? #80

Closed
D4rk56 opened this issue Dec 3, 2018 · 14 comments
Closed

How to change "Hostname" Insurgency Sandstorm ? #80

D4rk56 opened this issue Dec 3, 2018 · 14 comments

Comments

@D4rk56
Copy link

D4rk56 commented Dec 3, 2018

Hi

Is it possible to have an env to change the name of the server ?

Thanks

@joshhsoj1902
Copy link
Owner

That should be easy enough. Currently things are pretty hardcoded, my general rule of thumb is to look at the official config for a game:

https://github.com/GameServerManagers/LinuxGSM/blob/master/lgsm/config-default/config-lgsm/inssserver/_default.cfg

I look for a config name then manually add it in this file with LGSM_ on the front:
https://github.com/joshhsoj1902/linuxgsm-docker/blob/master/common.cfg.tmpl

I also likely need to update the base LGSM src for Insurgency since I think that was just added.

I might try to do this tonight, or more likely, I've been meaning to try to make the config building more dynamic, so that in this case you could have just set the env var "LGSM_SERVERNAME" and it would have automatically put into the common.cfg

@joshhsoj1902
Copy link
Owner

joshhsoj1902 commented Dec 4, 2018

I haven't yet tested it, but in theory, if you were to use the dynamic-config tag. you should be able to set the env `LGSM_SERVERNAME. I might not be able to test and merge #83 till later this week though

@D4rk56
Copy link
Author

D4rk56 commented Dec 4, 2018

I will wait thanks ;)

@joshhsoj1902
Copy link
Owner

ok, so I don't own the game and can't actually test it myself, but using https://github.com/joshhsoj1902/linuxgsm-docker/blob/master/examples/docker-compose.inss.yml

seemed to start the server and it looked happy enough.

Right now you'll be able to set any setting in

https://github.com/GameServerManagers/LinuxGSM/blob/ac6320114417754e96b08487fcc508c8b30babfa/lgsm/config-default/config-lgsm/inssserver/_default.cfg

using env vars, So if you want to set the servername then use the env var LGSM_SERVERNAME.

If the setting you want to change is part of a config file, I could also add support for that, just tell me where the config file lives.

@D4rk56
Copy link
Author

D4rk56 commented Dec 6, 2018

env var "LGSM_SERVERNAME" does not work for me.
I use "portainer"

@D4rk56
Copy link
Author

D4rk56 commented Dec 6, 2018

After update "LGSM_PORT" not work for left 4 dead 2
It sets the default port "27015" ..

Edit work after change :

ports:

  • 27016:27015/udp
  • 27016:27015/udp

Sorry for bad english, i'm french

@joshhsoj1902
Copy link
Owner

Your English is fine :)

Strange, admittedly I didn't test changing the ports after my change, I just used the default. I'll try it out tonight and see what I can find.

Same goes for L4D2, I've had a lot of trouble getting it to run inside this docker container, it always seems to fail for one reason or another...

I'll keep you posted!

@joshhsoj1902
Copy link
Owner

joshhsoj1902 commented Dec 7, 2018

I believe I found the issue with L4D2: #87

I released 0.1.1 to address this.

@joshhsoj1902
Copy link
Owner

joshhsoj1902 commented Dec 7, 2018

I just tried starting up sandstorm with LGSM_SERVERNAME set.

My compose file looks like this:

version: '3.1'
services:
  game:
    image: joshhsoj1902/linuxgsm-docker:latest
    ports:
      - 27102:27102/udp
      - 27131:27131/udp
    environment:
      - LGSM_GAMESERVERNAME=inssserver
      - LGSM_UPDATEINSTALLSKIP=UPDATE
      - LGSM_SERVERNAME=foobar
    volumes:
      - "/home/steam/linuxgsm/logs"

I started it like this:

docker-compose -f examples/docker-compose.inss.yml up

And it looks like the hostname is being set:

game_1  | Command-line Parameters
game_1  | ================================================================================
game_1  | ./InsurgencyServer-Linux-Shipping Oilfield?Scenario=Scenario_Oilfield_Push_Security?MaxPlayers=28?Port=27102?QueryPort=27131  -password= -hostname='foobar' -log

Are you seeing something different?

@D4rk56
Copy link
Author

D4rk56 commented Dec 7, 2018

I will give up, the servers are still in beta for the moment ..
I'll be back !!

@D4rk56
Copy link
Author

D4rk56 commented Dec 12, 2018

it works now ! thanks

Now it would be necessary to be able to change "defaultscenario" >__<
After an update they changed something about the name of the maps ..

Scenario_Refinery_Push_Security --> Scenario_Refinery_Push

So my server remains blocked to 8 players in coop .. :(

@joshhsoj1902
Copy link
Owner

So you should be able to the default scenario the same way

https://github.com/GameServerManagers/LinuxGSM/blob/master/lgsm/config-default/config-lgsm/inssserver/_default.cfg
(any fields in there should follow the same model)

LGSM_DEFAULTSCENARIO foo

Max players can be set the same way.

LGSM_MAXPLAYERS

I'll need to look at the code, something might be defaulting to 8 players instead of the 28 in the file above.

@D4rk56
Copy link
Author

D4rk56 commented Dec 12, 2018

Oh Nice !
I did not know that "env" was walking like this.

Thanks ! Close issue :)

@joshhsoj1902
Copy link
Owner

The env walking is a pretty new feature. but the old way of me manually adding each config that each game could support was getting a little out of hand =D.

If you run into any issues let me know. I'm going to be slowly changing this project to potentially become the official image for LinuxGSM (#85). so if there are any areas that you feel need improvement let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants