Dedicated server autopilot (current version: 2.0.4)
Moderator: OpenTTD Developers
I've done this, but it's been in heavy testing until now.
Version 1.3, which I'll put on the first post of this thread, supports automatic recounting. This happens about every five minutes by default, but can be changed.
This wasn't a trivial change, so the testing period was much longer. It does seem to be rock steady, though, having been tested extensively on my nightly (and a slightly modified version on the #openttdcoop sandbox).
Let me know how it works for you.
I'm thinking of adjusting the count command, since as it stands you can't say "count on it" to the chat from the dedicated console...
Version 1.3, which I'll put on the first post of this thread, supports automatic recounting. This happens about every five minutes by default, but can be changed.
This wasn't a trivial change, so the testing period was much longer. It does seem to be rock steady, though, having been tested extensively on my nightly (and a slightly modified version on the #openttdcoop sandbox).
Let me know how it works for you.
I'm thinking of adjusting the count command, since as it stands you can't say "count on it" to the chat from the dedicated console...
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Please, can you distinguish between players and spectators? I joined #openttdcoop sandbox as spectator, there was 1 player (who probably left his computer with running game), and game unpaused!
Also there may be problem, that when game pauses, the player that is not leaving is probably editing (demolishing) some tracks, and he cannot fix this until some other player joins (which can happen next day). (This caused megajam on sandbox recently). Maybe, this shouldn't be solved by your script, but by communication between players.
Also there may be problem, that when game pauses, the player that is not leaving is probably editing (demolishing) some tracks, and he cannot fix this until some other player joins (which can happen next day). (This caused megajam on sandbox recently). Maybe, this shouldn't be solved by your script, but by communication between players.
Unfortunately, autopilot can't distinguish between players and spectators at the moment. The code to do that would slow the welcome script down very much, possibly to the point of missing people. This is because it would have to reads the join message, then use a status command to find out more about the player who just joined. It's not something I want to do anyway, because personally, when I spectate a game, I prefer the game to be running.ebik wrote:Please, can you distinguish between players and spectators? I joined #openttdcoop sandbox as spectator, there was 1 player (who probably left his computer with running game), and game unpaused!
On the #openttdcoop sandbox, the autopilot is modified to pause the game when there are less than two people connected. This is a special case, and won't be released by me (it also has some database code to log the in-game chat).ebik wrote:Also there may be problem, that when game pauses, the player that is not leaving is probably editing (demolishing) some tracks, and he cannot fix this until some other player joins (which can happen next day). (This caused megajam on sandbox recently). Maybe, this shouldn't be solved by your script, but by communication between players.
The #openttdcoop sandbox rules are simple. It's for practising cooperative play. This means that when you're alone on the server, you're not supposed to be doing stuff anyway (and you're supposed to be attempting to follow the Wiki's guidelines, or developing upon them). You're quite right that this should be solved by communication between players, not the script.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Okay, maybe I'll see the source, and try to issue asynchronicity to the autopilot. (I have following in my mind: autopilot will see player connecting/disconnecting -> it queries server about all players. And from the response result it pauses/unpauses game. This may be difficult only in case that querying server about all players cannot be done by one request+reply. Then second query (as second player may be connecting during first query) must be postponed after finish of first one.Brianetta wrote:Unfortunately, autopilot can't distinguish between players and spectators at the moment. The code to do that would slow the welcome script down very much, possibly to the point of missing people. This is because it would have to reads the join message, then use a status command to find out more about the player who just joined. It's not something I want to do anyway, because personally, when I spectate a game, I prefer the game to be running.ebik wrote:Please, can you distinguish between players and spectators? I joined #openttdcoop sandbox as spectator, there was 1 player (who probably left his computer with running game), and game unpaused!
Hmm, maybe I'll write own autopilot with perl+expect, as I hate that some (few) constructs are long in tcl.
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
You can't. Although the only change required is the line to load the Expect libraries, ActiveTCL doesn't believe that OpenTTD is a Windows 32 bit console application, and so cannot control the console. There is no work-around as far as I know. Perhaps some other Tcl/Expect product might work on the platform.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Copy the file into your openttd directory, and then:
You can run it with:
You need Tcl and Expect, as I stated earlier.
Code: Select all
$ chmod u+x autopilot.txt
Code: Select all
$ ./autopilot.txt
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
Since MiniIN version -r5476 I pursue a INet server. No Problems.
And now with version -r6027 or greater quit autopilot after start.
Otherwise, nothing was changed.
thanx for help
cu
Picknicker
And now with version -r6027 or greater quit autopilot after start.
Otherwise, nothing was changed.
Code: Select all
bzt@debian3164m:~/OTTD-miniin$ ./startserver
Starting new game
exp_spawn ./openttd -c openttd1.cfg -D
*** AUTOPILOT ENGAGED ***
dbg: [NET][Core] Starting network...
dbg: [NET][Core] Network online. Multiplayer available.
dbg: Detected broadcast addresses:
dbg: 0) 33.122.35.233
debug_level net=0
net_frame_freq 10
pause
expect: spawn id exp6 not open
while executing
"expect -nobrace -re {
} {*\* .* hat das Spiel betreten
exp_send "unpause\n"
set output $expect_out(0,string)
set output..."
invoked from within
"expect {
-re "\n\\\*\\\*\\\* .* hat das Spiel betreten\r" {
exp_send "unpause\n"
set output $expect_out(0,string)
set..."
("while" body line 7)
invoked from within
"while true {
if $recount_trigger {
set auto_flag 1
exp_send "echo recount clients\n"
set recount_trigger false
}
expect {
..."
(file "./startserver" line 89)
bzt@debian3164m:~/OTTD-miniin$
cu
Picknicker
r6027 was an accidental mid-development build, and should not be used. It will crash games left right and centre. Later builds should be OK.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
Hello richk67,
First, thank you for the great work on MiniIN.
MiniIN versions -r6027 , r6028 and r6134 finish themselves after the start over autopilot Script.
Without autopilot the versions well work (Topically Version r6134).
r5838 was the last version them has worked with autopilot.
cu
Picknicker
First, thank you for the great work on MiniIN.
MiniIN versions -r6027 , r6028 and r6134 finish themselves after the start over autopilot Script.
Without autopilot the versions well work (Topically Version r6134).
r5838 was the last version them has worked with autopilot.
cu
Picknicker
Last edited by Picknicker on 02 Sep 2006 11:57, edited 1 time in total.
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
I use Debian 3.1 AMD64 Stable
my output:
MiniIN versions -r6027 , r6028 and r6134 finish themselves after the start over autopilot Script.
Without autopilot the versions well work (current Version r6134).
r5838 was the last version them has worked with autopilot.
0.4.8 also works perfectly, with the same autopilot Script.
sorry for my bad english
cu Picknicker
my output:
Code: Select all
bzt@debian3164m:~/OTTD-miniin$ ./startserver
Starting new game
exp_spawn ./openttd -c openttd1.cfg -D
*** AUTOPILOT ENGAGED ***
dbg: [NET][Core] Starting network...
dbg: [NET][Core] Network online. Multiplayer available.
dbg: Detected broadcast addresses:
dbg: 0) 33.122.35.233
debug_level net=0
net_frame_freq 10
pause
expect: spawn id exp6 not open
while executing
"expect -nobrace -re {
} {*\* .* hat das Spiel betreten
exp_send "unpause\n"
set output $expect_out(0,string)
set output..."
invoked from within
"expect {
-re "\n\\\*\\\*\\\* .* hat das Spiel betreten\r" {
exp_send "unpause\n"
set output $expect_out(0,string)
set..."
("while" body line 7)
invoked from within
"while true {
if $recount_trigger {
set auto_flag 1
exp_send "echo recount clients\n"
set recount_trigger false
}
expect {
..."
(file "./startserver" line 89)
bzt@debian3164m:~/OTTD-miniin$
Without autopilot the versions well work (current Version r6134).
r5838 was the last version them has worked with autopilot.
0.4.8 also works perfectly, with the same autopilot Script.
sorry for my bad english

cu Picknicker
Interesting that it is simply quitting like that. The only thing that autopilot has done to the server at this point is run the following:
I have never even so much as downloaded the MiniIN. Do these commands work properly with the dedicated server, without crashing it?
If they do cause it to quit, I'd suggest removing these lines from your startserver script (and logging a bug with Rich). If they don't, then I'm not sure what's wrong at all.
Code: Select all
debug_level net=0
net_frame_freq 10
pause
If they do cause it to quit, I'd suggest removing these lines from your startserver script (and logging a bug with Rich). If they don't, then I'm not sure what's wrong at all.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
Who is online
Users browsing this forum: Google [Bot] and 11 guests