OpenTTD

Tasklist

FS#2864 - pause/unpause and min_active_clients doesn't work all the time.

Attached to Project: OpenTTD
Opened by Ammler (Ammler) - Sunday, 26 April 2009, 18:56 GMT
Last edited by Remko Bijker (Rubidium) - Wednesday, 06 May 2009, 15:07 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Very Low
Priority Normal
Reported Version trunk
Due in Version 0.7.1
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Since we use min_active_clients instead of Autopilot pause_level, we got sometimes confused.

min_active_clients=2

[20:50] <PublicServer> <AmmIer> ok, server is paused now.
[20:50] <PublicServer> *** AmmIer has joined company #1
[20:50] <PublicServer> *** Game unpaused (enough players)
[20:50] <PublicServer> <AmmIer> unpaused
[20:50] <Ammler> !rcon pause
[20:50] <PublicServer> Ammler: Game paused.
[20:50] <PublicServer> *** AmmIer has joined spectators
[20:51] <PublicServer> *** Game paused (not enough players)
[20:51] <Ammler> !rcon unpause
[20:51] <PublicServer> Ammler: Game unpaused.
[20:51] <PublicServer> <AmmIer> still unpaused -> OK
[20:51] <PublicServer> *** AmmIer has joined company #1
[20:51] <PublicServer> *** Game unpaused (enough players)
[20:51] <PublicServer> <AmmIer> unpaused
[20:51] <PublicServer> *** AmmIer has joined spectators
[20:51] <PublicServer> *** Game paused (not enough players)
[20:51] <Ammler> !rcon unpause
[20:51] <PublicServer> Ammler: Game unpaused.
[20:51] <PublicServer> <AmmIer> unpaused -> OK
[20:51] <PublicServer> *** AmmIer has joined company #1
[20:52] <Ammler> !rcon pause
[20:52] <PublicServer> *** Game unpaused (enough players)
[20:52] <PublicServer> Ammler: Game paused.
[20:52] <PublicServer> <AmmIer> paused -> OK
[20:52] <PublicServer> *** AmmIer has joined spectators
[20:52] <PublicServer> *** Game paused (not enough players)
[20:52] <PublicServer> <AmmIer> still
[20:52] <Ammler> Xaroth: what should happen, if I switch to the company now?
[20:53] <PublicServer> *** AmmIer has joined company #1
[20:53] <PublicServer> *** Game unpaused (enough players)
[20:53] <PublicServer> <AmmIer> it is still paused -> BUG
[20:53] <Ammler> btw. the msg of the server would be fine
This task depends upon

Closed by  Remko Bijker (Rubidium)
Wednesday, 06 May 2009, 15:07 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r16242
Comment by Ammler (Ammler) - Monday, 27 April 2009, 10:34 GMT
a local test with trunk
hd52fbbbc 16177 0 hd52fbbbc

set min_active_clients
Current value for 'min_active_clients' is: '0' (min: 0, max: 255)
set min_active_clients 1
*** Game paused (not enough players)
*** AmmIer #1 has joined the game
*** Game paused (connecting client)
*** Game unpaused (client connected)
*** AmmIer #1 has started a new company (#1)
*** Game unpaused (enough players)
pause
Game is already paused.
Comment by Remko Bijker (Rubidium) - Friday, 01 May 2009, 21:24 GMT
Assume "next join" is whenever autopause would unpause and "next quit" is whenever autopause would pause.

Manual pause and automatic pause will always interfere in some way. It looks like the messages are just misleading, but I also think that automatic pausing and manual pausing was never intended to be used together.

For example: if I manually pause the game, should a leaving and rejoining player cause the game to be unpaused? Should a joining player cause the game to be unpaused?
It would make perfect sense (for me) that you just want to pause the game because you joined and are going to eat something and don't want to disconnect but want to make it possible for others to join and continue. On the other hand it would make as much sense to say that because you manually paused the game, the automatic pausing/unpausing shouldn't occur.

What currently happens (I think) is that each pause increments a counter and each unpause decrements it. It might make sense any manual unpause 'resets' that counter to 0. But then doing a manual pause will mean something different when 'autopaused' or not. If autopaused already the next join will decrement it and unpause the game. If not autopaused the next quit will increment the number thus never unpausing it. This is inconsitent behaviour, which means it isn't the solution. This leaves the option that the game is paused when either autopause is in effect or a manual pause is done, which means you cannot 'undo' an autopause (i.e. unpause when autopaused). I reckon that this again is unwanted behaviour, which basically makes autopausing a feature that CANNOT be implemented without nasty side effects.

So the choice is: consistent pausing/unpausing behaviour when mixing manual pausing and auto pausing OR the ability to unpause when auto paused as you simply cannot have both!
Comment by Ammler (Ammler) - Tuesday, 05 May 2009, 11:09 GMT
IMO, the automatic unpause/pause should function always, as you can disable it with min_active_clients=0. So if you use manual pause/unpause, it should be retriggered with client join/part (and move to/from spectactors).

As a workaround, I could imagine to make a custom command for autopilot, which does change min_active_clients instead of pause/unpause.

Greets
Ammler
Comment by Remko Bijker (Rubidium) - Tuesday, 05 May 2009, 11:11 GMT
Why a custom command for autopilot? Isn't the 'normal' settings changing command enough?
Comment by Ammler (Ammler) - Wednesday, 06 May 2009, 09:08 GMT
As I said, a workaround. Isn't that easy either. Best would be, min_active_clients doesn't care about state of manual pause/unpause, imo.

Loading...