~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/engine/ePlayer.cpp

Automatic merging of commits that would change history order:
   ------------------------------------------------------------
   revno: 1282.1.2
   committer: Daniel Lee Harple <leeharple@gmail.com>
   branch nick: 0.2.8-armagetronad-work
   timestamp: Mon 2011-07-18 21:46:08 -0400
   message:
     Added ENCODING ladderlog event.
   ------------------------------------------------------------
   revno: 1282.1.1
   committer: Daniel Lee Harple <leeharple@gmail.com>
   branch nick: 0.2.8-armagetronad-work
   timestamp: Wed 2011-07-13 00:49:08 -0400
   message:
     WHITELIST_ENEMIES_USERNAME requires authentication support to be enabled

Show diffs side-by-side

added added

removed removed

Lines of Context:
8600
8600
    // Assumes both "a" and "b" are from the same IP address.
8601
8601
    bool CanBeEnemies( const ePlayerNetID * a, const ePlayerNetID * b ) const
8602
8602
    {
8603
 
        return(
8604
 
            HasEntry( ip_addresses_whitelist_, a->GetMachine().GetIP() ) ||
8605
 
            HasEntry( usernames_whitelist_, a->GetLogName() ) ||
8606
 
            HasEntry( usernames_whitelist_, b->GetLogName() )
8607
 
        );
 
8603
        bool enemies = HasEntry( ip_addresses_whitelist_, a->GetMachine().GetIP() );
 
8604
#ifdef KRAWALL_SERVER
 
8605
        enemies |= a->IsAuthenticated() && HasEntry( usernames_whitelist_, a->GetLogName() );
 
8606
        enemies |= b->IsAuthenticated() && HasEntry( usernames_whitelist_, b->GetLogName() );
 
8607
#endif
 
8608
        return enemies;
8608
8609
    }
8609
8610
    
8610
8611
    void AddUsernames( std::istream & s )
8646
8647
 
8647
8648
static eEnemiesWhitelist se_enemiesWhitelist;
8648
8649
 
 
8650
#ifdef KRAWALL_SERVER
8649
8651
void se_WhiteListEnemiesUsername( std::istream & s )
8650
8652
{
8651
8653
    se_enemiesWhitelist.AddUsernames( s );
8652
8654
}
8653
8655
static tConfItemFunc se_whiteListEnemiesUsernameConfItemFunc( "WHITELIST_ENEMIES_USERNAME", se_WhiteListEnemiesUsername );
 
8656
#endif
8654
8657
 
8655
8658
void se_WhiteListEnemiesIP( std::istream & s )
8656
8659
{