From 073afd36890e3c26d3248b8f4b83eafca545dbae Mon Sep 17 00:00:00 2001 From: abma Date: Fri, 11 Sep 2015 17:54:24 +0200 Subject: [PATCH] fix #4949 --- rts/Net/GameServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rts/Net/GameServer.cpp b/rts/Net/GameServer.cpp index ff15b081b2f..9a1ce18e3d7 100644 --- a/rts/Net/GameServer.cpp +++ b/rts/Net/GameServer.cpp @@ -70,7 +70,7 @@ using boost::format; CONFIG(int, AutohostPort).defaultValue(0); CONFIG(int, SpeedControl).defaultValue(1).minimumValue(1).maximumValue(2) .description("Sets how server adjusts speed according to player's load (CPU), 1: use average, 2: use highest"); -CONFIG(bool, AllowSpectatorJoin).defaultValue(true).description("allow any unauthenticated clients to join as spectator with any unchecked name, thus permitting impersonation"); +CONFIG(bool, AllowSpectatorJoin).defaultValue(false).description("allow any unauthenticated clients to join as spectator with any name, name will be prefixed with ~"); CONFIG(bool, WhiteListAdditionalPlayers).defaultValue(true); CONFIG(bool, ServerRecordDemos).defaultValue(false).dedicatedValue(true); CONFIG(bool, ServerLogInfoMessages).defaultValue(false); @@ -2625,6 +2625,9 @@ unsigned CGameServer::BindConnection(std::string name, const std::string& passwd // not found in the original start script, allow spector join? if (errmsg.empty() && newPlayerNumber >= players.size()) { + if (!demoReader && allowSpecJoin) { //add prefix to "anonymous" spectators (#4949) + name = std::string("~") + name; + } if (demoReader || allowSpecJoin) AddAdditionalUser(name, passwd); else