Allow changing the late-observer flag in a running game, fixes #3669.

Remove it from the game-attributes, since it is not used in the
simulation, nor are they supposed to change in running games.

This was SVN commit r17861.
This commit is contained in:
elexis
2016-03-10 11:35:43 +00:00
parent 2305218d9f
commit e0a9dfd5a2
5 changed files with 14 additions and 28 deletions
+1 -7
View File
@@ -927,13 +927,7 @@ bool CNetServerWorker::OnAuthenticate(void* context, CFsmEvent* event)
// Optionally allow observers to join after the game has started
bool observerLateJoin = false;
ScriptInterface& scriptInterface = server.GetScriptInterface();
JSContext* cx = scriptInterface.GetContext();
JSAutoRequest rq(cx);
JS::RootedValue settings(cx);
scriptInterface.GetProperty(server.m_GameAttributes.get(), "settings", &settings);
if (scriptInterface.HasProperty(settings, "ObserverLateJoin"))
scriptInterface.GetProperty(settings, "ObserverLateJoin", observerLateJoin);
CFG_GET_VAL("network.lateobserverjoins", observerLateJoin);
// If the game has already started, only allow rejoins
bool isRejoining = false;