my gaming past, present and future
Friday September 3rd 2010

GameTalk

To view the read-only archive of the original GameTalk forum, click here.

Guest  

Show or hide header
Welcome Guest, posting in this forum requires registration.




planet romero » Gaming » Daikatana » Daikatana Linux Server Script now available!

Pages: [1] 2
Author Topic: Daikatana Linux Server Script now available!
DI-MeisterM
Moderator
Posts: 12
Post *Updated!* Daikatana Linux Server Script now available!
on: April 5, 2010, 11:22

Update June 19 2010
Version 1.2 of the Linux Server Script for Daikatana is now available in the Downloads section. It includes a small fix and a new feature:

FIXES:
- /dkserver/bin/daikatana_vnc.sh -> added 16 depth parameter for Xvnc launch, to prevent a wine launch bug

NEW FEATURES:
- /dkserver/bin/daikatana_control.sh
This script can enable & disable the cronjob of the server. You can also enable Mplayer or Lanpatch physics for Daikatana DM Demo.

Today I released version 1.1 of the Daikatana Linux Server Scripts.

Here’s the readme:

———————————————
- Daikatana Server-Launch Script 1.2 Readme -
———————————————
Script written and developed by Martin “DI-MeisterM” Mueller
http://www.DaikatanaNews.net

———————-
CHANGE LOG VERSION 1.2
———————-

FIXES:
- /dkserver/bin/daikatana_vnc.sh -> added 16 depth parameter for Xvnc launch, to prevent a wine launch bug

NEW FEATURES:
- /dkserver/bin/daikatana_control.sh
This script can enable & disable the cronjob of the server. You can also enable Mplayer or Lanpatch physics for Daikatana DM Demo.

—————–
Table Of Contents
—————–
1.) Introduction
2.) How Does It Work?
3.) Installation
4.) Configuration
5.) Crontab Example
6.) Contact

—————-
1.) Introduction
—————-
The main task of this collection of cronjobs and scripts is to create a Daikatana Unix/Linux Server solution which runs within a terminal console without X-Window System.
This aim was reached with an effective combination of the packages “wine” and “vncserver”, which are available for the majority of Unix and Linux distributions.

———————
2.) How Does It Work?
———————
This script collection uses follow process flow:
1.) Creates 1 to n X-Window Instance(s) with xauth password protection
2.) Creates for each X-Window instance an dedicated Daikatana Server process, which uses “wine” for launching

The script also checks the following:
- Is the X-Window instance running? If not, it creates it and launches the dedicated Daikatana Server process within it
- Is the Daikatana Server instance running? If not, it launches a new dedicated Daikatana Server process using a pre-defined cfg file

Furthermore this script packages includes two example cronjobs which can be set for user “root” in “/etc/crontab”.
The “daikatana_check.sh” script is the main program which was explained with the process flow description.
The “daikatana_kill.sh” script kills ALL Xvnc-Window processes. This also means it kills every single dedicated Daikatana Server process. It’s an optional script.

—————-
3.) Installation
—————-
Copy the archive “daikatana_linux_server_script_1.2.tgz” to the destination of your choice (on your Unix/Linux server) and un-tar it.
The example destination here is “/home/martin”.

$ cp daikatana_linux_server_script_1.2.tgz /home/martin
$ cd /home/martin
$ tar xvzf daikatana_linux_server_script_1.2.tgz

Now following directory structure is created:

/home/martin/dkserver/
bin/
daikatana_vnc.sh
daikatana_kill.sh
daikatana_server.sh
vncdisplays.lst
daikatana_check.sh
daikatana_control.sh
cron/
dk_check_each_minute.cron
dk_kill_every_23_hours.cron
log/
daikatana_server.log

—————–
4.) Configuration
—————–
To be able to successfully launch the scripts you have to adjust some parameters of the script files.

File: daikatana_check.sh

The parameter and variables under # GLOBAL SETTINGS must be set.

NUMBER_VNC_DISPLAYS = How many X-Windows should be created? Each Daikatana Server instance / cfg-file needs one X-Window
DKPATH = Path to your Daikatana directory
DK_CFG_FILENAME_PREFIX = The prefix of the cfg-name in your Daikatana/Data directory. An example cfg-file for Daikatana is included in this package
DK_CFG_FILENAME_SUFFIX = The suffix of the cfg-name in your Daikatana/Data directory. An example cfg-file for Daikatana is included in this package
SCRIPTPATH = The path where “dkserver” is located
LOGFILE = The path where “daikatana_server.log” is located

File: daikatana_vnc.sh

The parameter and variables under # VNC SETTINGS must be set.

VNC = Path where Xvnc is located. If you don’t have this package you can install it with “sudo apt-get install vncserver” or “sudo apt-get install tightvncserver” (Debian)
VNCPASS = Path to the XAuthority password file. It should be set before with the command “vncpasswd”
VNCPARA = Shouldn’t be modified. It can be filled with nothing if no XAuthority password protection is needed

File: daikatana_server.sh

The parameter and variables under # SERVER SETTINGS must be set.

LAUNCHDK = Path where Wine is located. If you don’t have this package you can install it with “sudo apt-get install wine” (Debian)
PORT = Shouldn’t be modified. It reads out the Daikatana Server Port of the cfg-file.
MAP = Shouldn’t be modified. It reads out the Daikatana Server Startup Map of the cfg-file.
IP = Shouldn’t be modified. It reads out the local-ip address of the machine.

File: daikatana_kill.sh

The parameter and variables under # Constants must be set.

SCRIPTPATH = The path where “dkserver” is located
LOGFILE = The path where “daikatana_server.log” is located

——————-
5.) Crontab Example
——————-
This is an example of the configuration for “/etc/crontab”:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don’t have to run the `crontab’
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
XAUTHORITY=/home/root/.Xauthority
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root:/home/martin

* * * * * root /home/martin/dkserver/bin/daikatana_check.sh
* */23 * * * root /home/martin/dkserver/bin/daikatana_kill.sh

The parameters XAUTHORITY and PATH vary from system to system. XAUTHORITY points to the path for the xauth environment.
PATH needs to be extended with path to the dkserver scripts. In this example it’s: “/home/martin”.

The last two lines are the cronjobs. The main program of this package “daikatana_check.sh” is set to check each day, minute, month, hour.
The second one “daikatana_kill.sh” kills the server each 24 hours.

* * * * * Path/Script
- – – – -
| | | | |
| | | | +—– Day of the week (0 – 7) (Sunday 0 or 7)
| | | +——- Month (1 – 12)
| | +——— Day (1 – 31)
| +———– Hour (0 – 23)
+————- Minute (0 – 59)

———–
6.) Contact
———–
If you have additional questions feel free to email me at:
mail daikatananews net

Or post into this forum thread at PlanetRomero:
http://planetromero.com/gametalk/?wpforumaction=viewtopic&t=49.0

DOWNLOAD
http://www.daikatananews.net/downloads/daikatana_linux_server_script1.2.zip

Nomax
Member
Posts: 2
Post Re: Daikatana Linux Server Script now available!
on: April 6, 2010, 14:00

Congrats, good work! winking

Leo_TCK
Member
Posts: 21
Post Re: Daikatana Linux Server Script now available!
on: April 7, 2010, 11:41

Will it work with other Unix systems? Like NETBSD etc…

I hope so, since it doesn’t need X.

Zeurkous managed to get hardware 3D support running on NETBSD, but there was other incompatiblity which needed to be fixed IIRC, I wonder if Daikatana can be run fully on such system then.

DI-MeisterM
Moderator
Posts: 12
Post Re: Daikatana Linux Server Script now available!
on: April 7, 2010, 15:57

Yes it should work on all unix systems, as long the packages for vncserver and wine are available.

I’m currently working on an alternative cronjob scripts, which should check ever X minutes if the server is still up running and will restart it, if its down.

DI-MeisterM
Moderator
Posts: 12
Post Re: Daikatana Linux Server Script now available!
on: April 9, 2010, 17:37

It’s working now as cronjob happy

The cronjob is divided into 2 parts.

Part 1:
- check each X minute if Y amount of vnc processes are running
- if they’re running, it launches Y amount of daikatana -dedicated instances with wine
- it checks each X minute if each Y amount of daikatana -dedicated is still running and if not, it re-launches the server

Part 2:
- is responsible for killing the vnc server (and this includes daikatana -dedicated)

Part 2 can be useful to run it for example once a day to make a fresh and clean server/instance boot

I’m currently cleaning the code and optimizing it a little. I think it will be ready on the weekend happy

DI-MeisterM
Moderator
Posts: 12
Post Re: Daikatana Linux Server Script now available!
on: April 10, 2010, 11:56

Ok version 1.1 is out happy

admin
Administrator
Posts: 19
Post Re: Daikatana Linux Server Script now available!
on: April 10, 2010, 20:12

Hahaha wow, that is cool. Now there can always be servers running forever!

See Bio page

DI-Mammut
Member
Posts: 6
Post Re: Daikatana Linux Server Script now available!
on: April 13, 2010, 22:08

Hi Bro

Have you checked how much ram each wine session takes?

If I e.g. wants to run 5 servers

DI-MeisterM
Moderator
Posts: 12
Post Re: Daikatana Linux Server Script now available!
on: April 14, 2010, 11:58

I took a screeny of “top” and marked the wine processes:

Total memory of my linux machine is 2 Gig Ram and one Wine session takes 1.2% of it, that means about 23-24 megs for each session. So I guess all 5 Wine instances would take about 125 megs for you.

But I guess this is only the requirements during _idle-ing_, don’t know with 20 people or more on it happy

DI-MeisterM
Moderator
Posts: 12
Post Re: Daikatana Linux Server Script now available!
on: April 14, 2010, 12:02

This screeny was taken for the Deathmatch Demo. The retail version uses about 26-27 megs for each wine instance (idle-ing).

Pages: [1] 2
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.143 seconds.
>

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)