This is a fork of Zandronum Beta for TSPG.
Revision | 1708995e86ce66fd91958e94562e184867d434e3 (tree) |
---|---|
Time | 2022-03-28 04:17:25 |
Author | Benjamin Berkels <torr.samaho@quan...> |
Commiter | Benjamin Berkels |
Restrict broadcasted net commands to clients who already have the full update (addresses 2667).
@@ -76,6 +76,9 @@ | ||
76 | 76 | if ( ( _flags & SVCF_ONLY_CONNECTIONTYPE_1 ) && ( players[_current].userinfo.GetConnectionType() != 1 ) ) |
77 | 77 | return false; |
78 | 78 | |
79 | + if ( ( _flags & SVCF_SKIP_CLIENTS_WITHOUT_FULLUPDATE ) && ( SERVER_GetClient( _current )->State == CLS_SPAWNED_BUT_NEEDS_AUTHENTICATION ) && ( gamestate == GS_LEVEL ) ) | |
80 | + return false; | |
81 | + | |
79 | 82 | return true; |
80 | 83 | } |
81 | 84 |
@@ -277,6 +280,9 @@ | ||
277 | 280 | // |
278 | 281 | void NetCommand::sendCommandToClients ( ULONG ulPlayerExtra, ServerCommandFlags flags ) |
279 | 282 | { |
283 | + if ( ( flags == 0 ) && ( ulPlayerExtra == MAXPLAYERS ) && ( static_cast<SVC>( _buffer.pbData[0] ) != SVC_MAPAUTHENTICATE ) ) | |
284 | + flags |= SVCF_SKIP_CLIENTS_WITHOUT_FULLUPDATE; | |
285 | + | |
280 | 286 | for ( ClientIterator it ( ulPlayerExtra, flags ); it.notAtEnd(); ++it ) |
281 | 287 | sendCommandToOneClient( *it ); |
282 | 288 | } |
@@ -71,7 +71,8 @@ | ||
71 | 71 | SVCF_SKIPTHISCLIENT = ( 1 << 0 ), |
72 | 72 | SVCF_ONLYTHISCLIENT = ( 1 << 1 ), |
73 | 73 | SVCF_ONLY_CONNECTIONTYPE_0 = ( 1 << 2 ), |
74 | - SVCF_ONLY_CONNECTIONTYPE_1 = ( 1 << 3 ) | |
74 | + SVCF_ONLY_CONNECTIONTYPE_1 = ( 1 << 3 ), | |
75 | + SVCF_SKIP_CLIENTS_WITHOUT_FULLUPDATE = ( 1 << 4 ) | |
75 | 76 | }; |
76 | 77 | |
77 | 78 | typedef TFlags<ServerCommandFlag, unsigned int> ServerCommandFlags; |