View previous topic :: View next topic |
Author |
Message |
theWeird
|
Posted: Sun Jul 19, 2009 10:53 pm Post subject: Custom startfile |
|
|
Hey there
I've got a small problem with the game "Teeworlds"
I'd like to run some instances with different mods.
By default teeworlds is started using the file teeworlds_srv.
But if you want to use a mod - e.g. the ball mod - you have to start the modified binary ball_srv instead.
I can't modify the full command line that is used to start the server.
It is only possible to modify the parameters.
Could you make it possible to change the file a server is started with? |
|
Back to top |
|
 |
adbot
|
Posted: Thu Mar 31, 2011 3:57 am |
|
|
|
|
|
Kybber
|
Posted: Mon Jul 20, 2009 4:00 am Post subject: |
|
|
Are you using Linux? If so, then simply make a wrapper-script with the name
of the original exe, which fires off the correct exe based on the an argument
on the command line. Rename the original exe to e.g. teeworlds_srv_orig.
You can then let e.g. the first argument be "default" og "ballmod", and have
a case-select statement in the script to select which exe to run. Or even simpler:
Use the name of which exe to run as the argument to avoid the case-select. |
|
Back to top |
|
 |
Andrew Mammoth
|
Posted: Mon Jul 20, 2009 1:00 pm Post subject: |
|
|
99% of games do not need this feature; and its also a security risk (run arbitrary executables).
Kybber's suggestion is good; you can run the game in a screen (see Game Configuration) to ensure when the server is Stopped via gamecreate, the game is shutdown (the screen and everything in it). |
|
Back to top |
|
 |
theWeird
|
Posted: Tue Jul 21, 2009 1:33 am Post subject: |
|
|
Thank you for this hint.
Now I wrote a script to start the server with.
But there is one problem with screen.
It seems user 'gamecreate' is not allowed to open a screen session on the server.
If I just type 'screen' as user gamecreate, the answer is
Cannot open your terminal '/dev/pts/0' - please check.
Any idea what I can do? |
|
Back to top |
|
 |
Andrew Mammoth
|
Posted: Tue Jul 21, 2009 9:31 am Post subject: |
|
|
I'm not too sure, it sounds like you don't have permission to do that.
I've encountered this myself when I logged in as one user, and sudo'd to another user and tried to run a screen as them directly.
I would check Google. |
|
Back to top |
|
 |
|