![]() |
Re: Linux Admining
Im rather proud of this altho it will make others cringe at its ugliness. I wanted a way for people to check which games need players. Doing an "ls" of the game directory from a CGI was easy enough but I realized that instead of using "ls" of the directorys as fact that the game exists, I should use the "ps". Then starting a game will automatically cause it to show, and if a game finishes or crashes then it will automatically not appear. I also arranged for it to pull the port from the ps display and show that.
http://host.dom3minions.com/bin/blitz_chk.cgi <font class="small">Code:</font><hr /><pre> #!/bin/bash echo "Content-type: text/html" echo -e "\n\n" echo "<H2><b>Dominions 3 Blitz games</b></H2>" echo "These are 2-player games on tiny maps<br>" echo '<a href="http://host.dom3minions.com/how-to.html">how to join a game</a><b r><br>' cd /home/dom3/dominions3/savedgames ps ax |grep dom3|grep bl_ | \ while read n n n n n n game n port n n n n n n n n era n do echo "era $era game <b>$game</b> on port <b>$port</b><br>" cd $game for fyle in `ls -1 *.2h` do echo $fyle "<br>" done cd /home/dom3/dominions3/savedgames echo "<br>" done </pre><hr /> |
Re: Linux Admining
Not much reaction to the fancy stuff. Maybe I shoud move the other direction...
Here is the simplest way to start a game in linux text mode so that you can be the server.... dom3 -STq (take note that is a Q as in quick, not a G like in game) it will ask you what port to use.. it will ask you to name the game.. it will ask you what era the game should be for it will then wait for people to join and tell you each time someone does When one of the players hits the "start game" then it will stop to show you a list of all the maps on your machine numbered, then ask you to type in the number of the map you want to use. What it will NOT do is tell the machine to keep running the game in the background if you hang up your connection. I will cover that next. Gandalf Parker |
Re: Linux Admining
The simplest way to start a game in text mode on a linux server for continual running.. well there isnt one. The problem is that telling it to run continual and background tends to cut off your ability to answer the questions. I havent been able to get the answers to work coming from a text file with something like <input.txt. So you will need to provide the answers on one line.
The simplest line I can come up with is.. nohup dom3 -STq fastgame --port 9999 --mapfile eye.map --era 1 & (again thats a Q not a G) Of course you can change "fastgame" to any name you want, and 9999 to any port, eye.map to the map file for any map you have in the maps directory, and era to 1 2 or 3. If you want to play with adding other settings then type dom3 -h which will give you a text screen of all the switches. Gandalf Parker |
Re: Linux Admining
Great thread GP. I'm keen to run it from the text line and not have it running unattended - i.e always in a window. Is there a way of stopping it refreshing once a minute?
Also are there any commands you can give it whilst in text mode? Tals |
Re: Linux Admining
Sorry that I didnt notice this.
There is no way to stop it refreshing. I tend to run it to a file then use a file viewer. As far as I know there are no commands that will work on it when its running text mode. I prefer to script the starts of all of my games since any changes or updates involve having to stop the game and then restart it. I much prefer edting the script and restarting it than trying to type it all out again. Especially if you dont remember some of it. |
Re: Linux Admining
:bump:
Since this subject is coming up again I thought Id bump this. Gandalf Parker |
Re: Linux Admining
Hi,
We're trying to figure out is there a way to host dom3 from a server computer with identical cd-key as one of the players? Nothing illegal, but none of our friends want to keep server running 24/7 and we have an existing server which could be used. Thanks, nice thread |
Re: Linux Admining
Its not supposed to be a problem.
The host doesnt check its own key against the players. But Im pretty sure it does have to be a good key (cant use one off a public list since they get banned pretty quick). Ive used my own key with no trouble even when the host is on the linux server and Im playing from my windows desktop. |
Re: Linux Admining
My server wrapper and backup scripts. For this thread, I think the interesting bit is the backup script, since it's parametrized by game name.
Both scripts assume the game directory is ~/dominions3 The server wrapper passes all parameters directly to dom3. It only deals with the last parameter, which is assumed to be the name of the game. The wrapper is mainly for having a bunch of default parameters that I want to have all the time. The backup script writes the backups to ~/dominions/backups. It reads the scores.html file to determine current turn, so the game needs to be run with --scoredump on. dom3serv: Code:
#! /usr/bin/env python dom3backup: Code:
#! /bin/bash Edit: Regarding that unattendedness stuff, I run my server processes each in their own window under GNU screen, so they'll print their log to a terminal, but I don't have to have a local/remote login open all the time. But that's more a part of the fact that my setup currently requires me to start each game manually. |
Re: Linux Admining
Thanks G
|
All times are GMT -4. The time now is 10:47 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.