~luke-jr/tr2norigins/armagetron-0.2.8-t2o-preferT2OAuth

« back to all changes in this revision

Viewing changes to src/engine/ePlayer.cpp

  • Committer: z-man
  • Date: 2008-03-08 14:06:41 UTC
  • Revision ID: svn-v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs:7d95bf1e-0414-0410-9756-b78462a59f44:armagetronad%2Fbranches%2F0.2.8%2Farmagetronad:8284
Voter datastructure (with a little more persistence than ePlayerNetID) is only used to store suspensions while the ePlayerNetID object does not exist.
This avoids suspending everyone connecting from the same LAN all at once.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3487
3487
    stealth_            = false;
3488
3488
    chatFlags_                  = 0;
3489
3489
    disconnected                = false;
 
3490
    suspended_          = 0;
3490
3491
 
3491
3492
    loginWanted = false;
3492
3493
    
3549
3550
    spectating_ =false;
3550
3551
    stealth_    =false;
3551
3552
    disconnected=false;
 
3553
    suspended_  = 0;
3552
3554
    chatFlags_  =0;
3553
3555
 
3554
3556
    r = g = b = 15;
3644
3646
 
3645
3647
        // clear old legacy spectator that may be lurking around
3646
3648
        se_ClearLegacySpectator( Owner() );
 
3649
 
 
3650
        // get suspension count
 
3651
        if ( GetVoter() )
 
3652
        {
 
3653
            suspended_ = GetVoter()->suspended_;
 
3654
        }
3647
3655
    }
3648
3656
 
3649
3657
    this->wait_ = 0;
6907
6915
{
6908
6916
    if ( registeredMachine_ )
6909
6917
    {
 
6918
        // store suspension count
 
6919
        if ( GetVoter() )
 
6920
        {
 
6921
            GetVoter()->suspended_ = suspended_;
 
6922
        }
 
6923
 
6910
6924
        registeredMachine_->RemovePlayer();
6911
6925
        registeredMachine_ = 0;
6912
6926
    }
7087
7101
//! accesses the suspension count
7088
7102
int & ePlayerNetID::AccessSuspended()
7089
7103
{
7090
 
    static int dummy;
7091
 
    dummy = 0;
7092
 
 
7093
 
    if ( Owner() == 0 || !GetVoter() )
7094
 
    {
7095
 
        return dummy;
7096
 
    }
7097
 
 
7098
 
    return GetVoter()->suspended_;
 
7104
    return suspended_;
7099
7105
}
7100
7106
 
7101
7107
//! returns the suspension count
7102
7108
int ePlayerNetID::GetSuspended() const
7103
7109
{
7104
 
    int dummy = 0;
7105
 
 
7106
 
    if ( Owner() == 0 || !GetVoter() )
7107
 
    {
7108
 
        return dummy;
7109
 
    }
7110
 
 
7111
 
    return GetVoter()->suspended_;
 
7110
    return suspended_;
7112
7111
}