Page 2 of 15

Posted: 21 Jan 2006 01:03
by neonx
I have been using this on my server since you released it.
But, the latest versjon looses track of how many clients that is connected. It ended up on -2 clients yesterday.
Can't you script som sort of automatic "recount clients"? Make it recount every 5 minutes or so?

Posted: 21 Jan 2006 01:18
by Brianetta
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...

Posted: 10 Mar 2006 00:18
by ebik
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.

Posted: 10 Mar 2006 09:27
by Brianetta
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!
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: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.
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).

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.

Posted: 10 Mar 2006 10:43
by ebik
Brianetta wrote:
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!
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.
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.

Hmm, maybe I'll write own autopilot with perl+expect, as I hate that some (few) constructs are long in tcl.

Posted: 14 Mar 2006 11:07
by chrissicom
hmmm I have installed ActiveTCL which includes Expect on my Windows 2003 server but the command "expect" still isn't available. I have never worked with ActiveTCL before only Perl. So how can I install this and run this on a Windows Server?

Posted: 14 Mar 2006 12:51
by Brianetta
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.

Posted: 25 Jul 2006 10:22
by Rysiek
How install? I have dedicated server on the linux!

Posted: 25 Jul 2006 11:02
by Brianetta
Copy the file into your openttd directory, and then:

Code: Select all

$ chmod u+x autopilot.txt
You can run it with:

Code: Select all

$ ./autopilot.txt
You need Tcl and Expect, as I stated earlier.

Posted: 31 Aug 2006 16:01
by Picknicker
Hello,

autopilot does not work any more with MiniIn greater -r5838 ?
Please Help, Autopilot is a great Work for my Server.

sorry for my bad english ;)

cu Picknicker

Posted: 31 Aug 2006 16:34
by osai
Brianetta is not available these days,
but you could already write what exactly not works!
Maybe someone else can help you too!

Posted: 31 Aug 2006 16:47
by Picknicker
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.

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$      
thanx for help

cu
Picknicker

Posted: 31 Aug 2006 23:35
by richk67
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.

Posted: 01 Sep 2006 12:28
by Picknicker
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

Posted: 01 Sep 2006 19:27
by Brianetta
osai wrote:Brianetta is not available these days
Oh yes I am (:

Posted: 03 Sep 2006 16:06
by Picknicker
Can nobody help me? No one idea?

cu
Picknicker

Posted: 03 Sep 2006 18:21
by Brianetta
Which operating system are you using?
What output are you seeing?

Posted: 04 Sep 2006 06:44
by Picknicker
I use Debian 3.1 AMD64 Stable

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$     
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

Posted: 04 Sep 2006 07:20
by Brianetta
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:

Code: Select all

debug_level net=0
net_frame_freq 10
pause
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.

Posted: 04 Sep 2006 14:38
by Picknicker
With nightly r6358 does not function autopilot also any more.
I suppose something it was changed in the code (openTTD), so that cannot be pursued openTTD any more with expect??