Public Member Functions | |
eVoteItemKick (ePlayerNetID *player) | |
~eVoteItemKick () | |
Protected Member Functions | |
virtual char const * | DoGetPrefix () const |
virtual int | DoGetExtraBias () const |
virtual bool | DoCheckValid (int senderID) |
virtual void | DoExecute () |
Definition at line 1150 of file eVoter.cpp.
eVoteItemKick::eVoteItemKick | ( | ePlayerNetID * | player | ) | [inline] |
eVoteItemKick::~eVoteItemKick | ( | ) | [inline] |
virtual char const* eVoteItemKick::DoGetPrefix | ( | ) | const [inline, protected, virtual] |
virtual int eVoteItemKick::DoGetExtraBias | ( | ) | const [inline, protected, virtual] |
Reimplemented from eVoteItem.
Definition at line 1174 of file eVoter.cpp.
References se_votingBiasKick.
01175 { 01176 return se_votingBiasKick; 01177 }
virtual bool eVoteItemKick::DoCheckValid | ( | int | senderID | ) | [inline, protected, virtual] |
Reimplemented from eVoteItemHarm.
Reimplemented in eVoteItemKickServerControlled.
Definition at line 1179 of file eVoter.cpp.
References eVoteItemHarm::DoCheckValid(), eVoter::GetVoter(), eVoter::lastKickVote_, eVoter::lastNameChangePreventor_, nCLIENT, nNetObject::Owner(), se_minTimeBetweenKicks, sn_ConsoleOut(), sn_GetNetState(), and tSysTimeFloat().
01180 { 01181 ePlayerNetID * player = GetPlayer(); 01182 01183 // check if player is protected from kicking 01184 if ( player && sn_GetNetState() != nCLIENT ) 01185 { 01186 eVoter * voter = eVoter::GetVoter( player->Owner() ); 01187 if ( voter ) 01188 { 01189 double time = tSysTimeFloat(); 01190 if ( time < voter->lastKickVote_ + se_minTimeBetweenKicks ) 01191 { 01192 tOutput message("$vote_redundant"); 01193 sn_ConsoleOut( message, senderID ); 01194 return false; 01195 } 01196 else 01197 { 01198 voter->lastKickVote_ = time; 01199 voter->lastNameChangePreventor_ = time; 01200 } 01201 } 01202 } 01203 01204 return eVoteItemHarm::DoCheckValid( senderID ); 01205 };
virtual void eVoteItemKick::DoExecute | ( | ) | [inline, protected, virtual] |
Implements eVoteItem.
Reimplemented in eVoteItemKickServerControlled.
Definition at line 1207 of file eVoter.cpp.
References nMachine::GetMachine(), MAXCLIENTS, nMachine::OnKick(), se_VoteKickPlayer(), and se_VoteKickUser().
Referenced by eVoteItemKickServerControlled::DoExecute().
01208 { 01209 ePlayerNetID * player = GetPlayer(); 01210 nMachine * machine = GetMachine(); 01211 if ( player ) 01212 { 01213 // kick the player, he is online 01214 se_VoteKickPlayer( player ); 01215 } 01216 else if ( machine ) 01217 { 01218 // the player left. Inform the machine that he would have gotten kicked. 01219 // kick all players that connected from that machine 01220 bool kick = false; 01221 for ( int user = MAXCLIENTS; user > 0; --user ) 01222 { 01223 if ( &nMachine::GetMachine( user ) == machine ) 01224 { 01225 se_VoteKickUser( user ); 01226 kick = true; 01227 } 01228 } 01229 01230 // if no user could be kicked, notify at least the machine that 01231 // somebody would have been kicked. 01232 if ( !kick ) 01233 { 01234 machine->OnKick(); 01235 } 01236 } 01237 }