View previous topic :: View next topic |
Author |
Message |
levko
|
Posted: Fri Jul 24, 2009 9:48 pm Post subject: how to change command line properties |
|
|
i'd like to know is there anyway to change name of command line parameter which starts the server e.g. cod2_lnxded to let's say cod2_lnxded_test |
|
Back to top |
|
 |
adbot
|
Posted: Thu Mar 31, 2011 3:57 am |
|
|
|
|
|
Andrew Mammoth
|
Posted: Mon Jul 27, 2009 11:51 am Post subject: |
|
|
No you cannot change what executable is ran at this time.
What you may want to do is create your own cod2_lnxded script and let it act as a wrapper that decides what to run. |
|
Back to top |
|
 |
levko
|
Posted: Wed Jul 29, 2009 1:11 am Post subject: |
|
|
Okay can you give me one example of wrapper script?  |
|
Back to top |
|
 |
Andrew Mammoth
|
Posted: Wed Jul 29, 2009 4:08 pm Post subject: |
|
|
What you need to do is create a simple bash script with the same name as the file GameCreate tries to start, cod2_lnxded, and inside it decide (based upon the argument supplied) choose what executable to then run.
Be sure GC is configured to run the game inside a screen (via Game Config area) so that the process does not become rogue.
You will need to do some research on bash scripting (simplest I can think of), it's been a while since I have had to use it. |
|
Back to top |
|
 |
levko
|
Posted: Wed Jul 29, 2009 10:19 pm Post subject: |
|
|
okay but where do i tell in GC which binary i wanna start? i mean how does the script get the argument? via command line parameter in GC? |
|
Back to top |
|
 |
Andrew Mammoth
|
Posted: Thu Jul 30, 2009 10:15 am Post subject: |
|
|
GameCreate is *always* going to start cod2_lnxded - so you need to write a wrapper script called that (and rename the 'real' cod2_lnxded to something else, like cod2_lnxded_real) that your wrapper script starts (or decides instead to start cod2_lnxded_test as per your example) instead.
You can then make your wrapper script decide what executable to start (_real or _test) based upon what command line arguments are sent (and make GC send different one/s depending on what executable you want it to start).
This will take a bit of technical know-how. |
|
Back to top |
|
 |
levko
|
Posted: Tue Aug 04, 2009 3:16 am Post subject: |
|
|
i'm planning to try out this script today
Code: |
#!/bin/bash
if [ $# -lt 1 ]
then
echo "missing arguments"
exit 1
fi
if [ $1 = "test" ]
then
shift
./cod2_lnxded_test $@
elif [ $1 = "real" ]
then
shift
./cod2_lnxded_real $@
else
echo "invalid first argument - use real or test as the first argument"
exit 1
fi |
|
|
Back to top |
|
 |
|