nzyuzin / rteeworlds

Teeworlds fork for rating gametypes
Other
3 stars 0 forks source link

Client's drop during the rated game #2

Open nzyuzin opened 7 years ago

nzyuzin commented 7 years ago

If it's the case, that a client disconnected during the rated game, the following actions should be performed:

  1. Game set on pause
  2. 3 minute countdown started
  3. Store the leavers name and send leave event to the db

If during pause someone joins to replace the leaver, resume the game.

As it's impossible now to join the game during pause, this has to be changed in the existing server code.

If none joins within 3 minutes, abort the game and send the event to the db.

CaptainAMN commented 7 years ago

Just to clarify, leaver's name will only be stored in db as a leaver if he fails to reconnect within the countdown time. This is for the protection of the rank if there are connection problems.

nzyuzin commented 7 years ago

@CaptainAMN thanks!

Places in the code to start from:

Here's the method where rated game client drop logic should be implemented https://github.com/nzyuzin/rteeworlds/blob/0.6-rctf/src/game/server/ratedgame.cpp#L224

Here's the method that starts pause: https://github.com/nzyuzin/rteeworlds/blob/0.6-rctf/src/game/server/gamecontroller.cpp#L383 (can be called from the above method with GameServer()->m_pController->TogglePause())

Third point can be drafted until the support of it on db communication layer is implemented.