1
0
forked from 0ad/0ad
0ad/source/network
wraitii 87fc52b780 MP: don't enforce game init attributes synchronization in PREGAME.
The NetServer stored a complete copy of the game Init Attributes, which
it sent to new clients on updates from the controller. This worked well,
but prevents incremental updates and other unrelated messages from being
sent.

This changes the system so that:
- in PREGAME state, the server does not update its copy of the game init
attributes
- the server forwards game setup messages from the controller to all
clients
- Joining clients get a full copy of the Settings, when joining, from
the controller (this is a js-driven behaviour - other situations might
not need do it).
- Make the StartNetworkGame message take a copy of the final init
attributes, to ensure synchronization (and simplify some logic).

In practice, this:
- makes it possible to send different types of gamesetup messages (this
introduces two: a regular update and the full 'initial-update' for new
clients).
- moves some C++ hardcoding into JS - here in essence the PREGAME server
state is now init-attributes-agnostic.
- does not change much for readiness control - the server already needed
to force a change at game start to set random elements.

Note that the loading page is currently still receiving the 'local' game
attributes, which assumes that all clients are correctly synchronized
(they should be).

Refs #3806, #3049

Differential Revision: https://code.wildfiregames.com/D3714
This was SVN commit r25099.
2021-03-22 10:13:27 +00:00
..
scripting MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
tests MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
fsm.cpp Strip trailing whitespace from network code. 2015-12-21 13:58:32 +00:00
fsm.h Strip trailing whitespace from network code. 2015-12-21 13:58:32 +00:00
NetClient.cpp MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
NetClient.h MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
NetClientTurnManager.cpp Fixes revealed missed includes after e104b41be2. 2021-03-03 22:38:59 +00:00
NetClientTurnManager.h Split TurnManager classes into individual files per class. Patch by echotangoecho, fixes #4095. 2017-01-24 02:04:50 +00:00
NetFileTransfer.cpp Split NetFileTransfer message parsing into one function per case, refs #5212. 2019-09-17 14:18:46 +00:00
NetFileTransfer.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
NetHost.cpp Automatically replace %hs/%ls with %s in CLogger format strings. 2015-01-22 20:36:24 +00:00
NetHost.h Hide ip and port from users until they want to join, add optional password 2021-01-20 18:31:39 +00:00
NetMessage.cpp Pass ScriptInterface as a const ref where possible. 2017-08-24 00:32:42 +00:00
NetMessage.h Fix few typos found with the Debian lintian tool. 2017-10-28 22:34:57 +00:00
NetMessages.h MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
NetMessageSim.cpp [SM52 2/2] Update to Spidermonkey 52 APIs. 2020-11-18 14:39:04 +00:00
NetServer.cpp MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
NetServer.h MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
NetServerTurnManager.cpp Increase MP Command delay to 4 turns, decrease MP turns to 200ms. 2021-03-03 21:02:57 +00:00
NetServerTurnManager.h Don't trigger a NetServerTurnManager debug breakpoint if a modified or unmodified client sends a non-sequential turnnumber. 2018-01-26 23:02:13 +00:00
NetSession.cpp Netcode: Identify controller client via a secret key 2021-02-27 17:44:59 +00:00
NetSession.h Netcode: Identify controller client via a secret key 2021-02-27 17:44:59 +00:00
NetStats.cpp Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
NetStats.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
NMTCreator.h Net Server: Verify password in Authenticate 2021-01-23 18:04:36 +00:00
Serialization.h Strip trailing whitespace from network code. 2015-12-21 13:58:32 +00:00
StringConverters.h Provide JSON-compatible string escaping 2011-11-04 01:18:34 +00:00
StunClient.cpp Get the public IP from the lobby if not using STUN. 2021-02-08 15:47:34 +00:00
StunClient.h Get the public IP from the lobby if not using STUN. 2021-02-08 15:47:34 +00:00