Server Help

Trash Talk - HOW-TO: A guide to installing subgame2 in linux (debian)

Doc Flabby - Thu Aug 03, 2006 7:11 am
Post subject: HOW-TO: A guide to installing subgame2 in linux (debian)
As good as ASSS is sometimes subgame has its advantages. This is how I got it running on the linux.

First you need a working wine installation of wine version 0.9.12 or later. This is in the testing package repositry in debian. to install (assuming you are running a testing version of debian you would type as root)
Code: Show/Hide
apt-get install wine

Similarly installing on other linux is there is normally a similar way such as emerge of gentoo
Code: Show/Hide
emerge wine

To check if wine is setup correctly switch to a non-root user
type
Code: Show/Hide
wine --version

It should display the version number of wine
If that happens all is good. and wine is setup.
The next stage is to create a user in which subgame will run
switch to root (or use sudo) type
Code: Show/Hide
adduser

choose a name and password for the user. Im gonna call it subgame, with password docflabbyiscool. I suggest u use a different password tongue.gif
now you need to change to the user of the newly created user so either login as subgame or type
Code: Show/Hide
su - subgame
as root
if u type
Code: Show/Hide
whoami
it should say
subgame
switch to subgames home folder and run wine to set it up
Code: Show/Hide
cd #
wine anything

alot of crap and errors will appear on the screen but thats normal wait for it to go away.
Code: Show/Hide
mkdir ~/.wine/drive_c/subgame
cd ~/.wine/drive_c/subgame 

copy all the subgame files in the subgames zip to this directory
now fire up nano or vim or whatever you edit text files with and setup server.ini for subgame. plenty of help is advailable here http://www.shanky.com/server/ and in these forums.
I would recomment changing this section of server.ini so it looks like this to prevent subgame hogging the cpu
Code: Show/Hide

[CPU]
LoopDelay=0
ProcessMaxTime=4
SleepPerIteration=1
SlowIterationWarningLevel=100
SleepTime=5

once you have done that its time to make sure the permissions are correct
everything in the subgame folder should be chmod 755
and chown subgame.
Once you have done that its time to try the server out.
Code: Show/Hide
wineconsole subgame2.exe

this should launch the subgame server. you can then try connecting to it in continuum. To stop it use ctrl+c.
To get the server to launch at start up you need to create a script to run it
Code: Show/Hide

cd #
touch startsubgame
chmod 755 startsubgame

edit the startsubgame file so it looks like this (assuming your subgame user is called subgame)
Code: Show/Hide

cd /home/subgame/.wine/drive_c/subgame
wine subgame2.exe

save that file
test it works
Code: Show/Hide

./startsubgame

it should start the subgame server
to get it running on startup we use crontab
make sure you are the subgame user (whoami)
Code: Show/Hide

crontab -e

add this line
Code: Show/Hide

@reboot /home/subgame/startsubgame >> /home/subgame/subgamelog 2>&1

this will create a log file for you of subgame. Now try rebooting the computer to see if subgame starts up

If all is good your subgame server should now be setup on linux icon_surprised.gif

DISCLAIMER: ive only tried this on a debian server using wine version 0.9.12 if this breaks your computer its not my fault tongue.gif
If you want to see it in action PSSF Kitty Girls!!! is a test zone currently running subgame2 on linux in this way.
Dr Brain - Thu Aug 03, 2006 10:33 am
Post subject:
I haven't tried it, but I have some cosmetic changes for your howto.

You should use "su - subgame", which has the added benefit of changing to ~.

I'm pretty sure that your cron change will only work with some cron variants.

"cd #" can be replaced by "cd"

Code: Show/Hide

mkdir ~/.wine/drive_c/subgame
cd ~/.wine/drive_c/subgame                #is this even needed?


can replace:

Code: Show/Hide
cd .wine
cd drive_c
mkdir subgame
cd subgame


There are probably things I missed (I'm not sure that adduser is the preferred method, for example), but it's probably not that important.
Doc Flabby - Fri Aug 04, 2006 7:29 am
Post subject:
thanks, im a bit of a linux newb tbh tongue.gif

The reason why i use cron is because i couldnt get rc scripts to work (im sure someone with the time and knowledge could) and it was a simple solution to getting subgame to run under a non-root user. I think every crontab supports @reboot. Its an undocumented feature in the linux version of the standard version of cron i think lol.
http://www.google.co.uk/search?hl=en&q=cron+@reboot&meta=

This section is required as subgame has to be installed in the wine directory tree for it to work (from my experience neways)
Code: Show/Hide

mkdir ~/.wine/drive_c/subgame
cd ~/.wine/drive_c/subgame   


(ive updated the original how-to)
Dr Brain - Fri Aug 04, 2006 8:26 am
Post subject:
No, I meant is the cd part really necessary? You could add a wget and an unzip command aftewards and then I'd be ok, but as it is, you just tell them to put it all in there.
D1st0rt - Sat Aug 05, 2006 2:50 pm
Post subject:
Here's the rc script I use for asss if it's any help, might not be done 100% they way it should be, but it works (/home/asss/server is a link to the latest folder which is currently asss-1.4.3)

Code: Show/Hide
#!/sbin/runscript

depend() {
   need net
}

start() {
   ebegin "Starting ASSS"
   start-stop-daemon --start --background --chuid asss:asss  --pidfile /home/asss/server/asss.pid --exec /home/asss/server/scripts/run-asss
   eend $?
}

stop() {
   ebegin "Stopping ASSS"
   start-stop-daemon --stop --pidfile /home/asss/server/asss.pid
   eend $?
}

Doc Flabby - Mon Aug 21, 2006 6:35 am
Post subject:
opps forgot about this topic.

That script won't work unfortunatly, i coulnt get it to work neways....its probabbly me!
Dr Brain - Mon Aug 21, 2006 10:36 am
Post subject:
That's a gentoo rc script, so without gentoo, it probably won't work.
Doc Flabby - Mon Sep 11, 2006 7:06 pm
Post subject:
Massive bump i know

http://wiki.minegoboom.com/index.php/MERVBot_script

^^ the script here with some mods i suspect will work, will try it soon
Animate Dreams - Thu Nov 02, 2006 10:31 pm
Post subject:
Erm.
I get to the part where you're supposed to do
cd #
wine

And apparently wine is supposed to do something OTHER than:

Usage: wine PROGRAM [ARGUMENTS...] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit

But that's all it does. The subsequent step of making a new directory was just giving me errors:

[billerman@vps ~]$ mkdir ~/.wine/drive_c/billerman
mkdir: cannot create directory `/home/billerman/.wine/drive_c/billerman': No such file or directory


Which may be because Wine hasn't done what you expected it would do in the previous step. So, um... got any ideas?
Doc Flabby - Fri Nov 03, 2006 11:10 am
Post subject:
ah you found a mistake - ive corrected it in my post

you need to type
Code: Show/Hide
wine anything
not wine

just to get wine to set its self up and create the correct folders.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group