1
0
forked from 0ad/0ad
0ad/source
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
..
collada Refactors smart pointers creation, reduces code duplication and improves exception safety. 2021-02-13 23:53:40 +00:00
graphics Adds basic tests for BuildCameraRay and uses viewport instead of renderer for width and height. 2021-03-19 17:39:34 +00:00
gui Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
i18n Moves CreateDateTimeInstance from the public L10n header to its implementation. 2021-03-12 09:11:22 +00:00
lib Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
lobby Fix typos in log and warn messages 2021-03-10 16:50:15 +00:00
maths Adds more detailed test for perspective camera projection and its corners in world space. 2021-03-16 22:42:29 +00:00
mocks More FreeBSD build fixes. 2012-01-30 06:21:11 +00:00
network MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
pch Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ps MP: don't enforce game init attributes synchronization in PREGAME. 2021-03-22 10:13:27 +00:00
renderer Adds ortho projection type and its test. 2021-03-17 23:03:35 +00:00
rlinterface Increase MP Command delay to 4 turns, decrease MP turns to 200ms. 2021-03-03 21:02:57 +00:00
scriptinterface Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
simulation2 Fix issues with motionManager / bae258f9a1 2021-03-18 16:40:34 +00:00
soundmanager Fix compilation with --without-audio 2021-03-04 17:36:24 +00:00
third_party Optimization for include resolving in PreprocessorWrapper. 2021-01-20 23:05:15 +00:00
tools Fix checkrefs following D11 / 1c9efa6fb5 2021-03-06 13:57:11 +00:00
main.cpp Cleanups includes for cassert and streams. 2021-03-03 22:26:49 +00:00
test_setup.cpp Introduce C++ templates replacements for DEFINE_INTERFACE_X and RegisterFunction macros 2021-03-01 20:52:24 +00:00