Public Member Functions | |
eNameMessenger (ePlayerNetID &player) | |
~eNameMessenger () | |
Public Attributes | |
ePlayerNetID & | player_ |
tString | oldScreenName_ |
tString | oldLogName_ |
tColoredString | oldPrintName_ |
Definition at line 6821 of file ePlayer.cpp.
eNameMessenger::eNameMessenger | ( | ePlayerNetID & | player | ) | [inline] |
Definition at line 6824 of file ePlayer.cpp.
References tColoredString::ColorString(), ePlayerNetID::GetLogName(), and ePlayerNetID::GetName().
06824 { 06825 public: 06826 eNameMessenger( ePlayerNetID & player ) 06827 : player_( player ) 06828 , oldScreenName_( player.GetName() ) 06829 , oldLogName_( player.GetLogName() ) 06830 { 06831 // store old name for password re-request and name change message
eNameMessenger::~eNameMessenger | ( | ) | [inline] |
Definition at line 6833 of file ePlayer.cpp.
06836 { 06837 if ( sn_GetNetState() == nCLIENT ) 06838 { 06839 return; 06840 } 06841 06842 tString logName = player_.GetLogName(); 06843 tString const & screenName = player_.GetName(); 06844 06845 // messages for the users 06846 tColoredString printName; 06847 printName << player_ << tColoredString::ColorString(.5,1,.5); 06848 06849 tOutput mess; 06850 06851 mess.SetTemplateParameter(1, printName); 06852 mess.SetTemplateParameter(2, oldPrintName_); 06853 06854 // is the player new? 06855 if ( oldLogName_.Len() <= 1 && logName.Len() > 0 ) 06856 { 06857 if ( player_.IsHuman() ) 06858 { 06859 tString ladder; 06860 ladder << "PLAYER_ENTERED " << logName << " " << nMachine::GetMachine(player_.Owner()).GetIP() << " " << screenName << "\n"; 06861 se_SaveToLadderLog(ladder); 06862 06863 player_.Greet(); 06864 06865 // print spectating join message (regular join messages are handled by eTeam) 06866 if ( player_.IsSpectating() || !se_assignTeamAutomatically ) 06867 { 06868 mess << "$player_entered_spectator"; 06869 sn_ConsoleOut(mess); 06870 } 06871 } 06872 } 06873 else if ( logName != oldLogName_ || screenName != oldScreenName_ ) 06874 { 06875 tString ladder; 06876 ladder << "PLAYER_RENAMED " << oldLogName_ << " " << logName << " " << nMachine::GetMachine(player_.Owner()).GetIP() << " " << screenName << "\n"; 06877 se_SaveToLadderLog(ladder); 06878 06879 if ( oldScreenName_ != screenName ) 06880 { 06881 if ( bool(player_.GetVoter() ) ) 06882 { 06883 player_.GetVoter()->PlayerChanged(); 06884 } 06885 06886 mess << "$player_renamed"; 06887 06888 sn_ConsoleOut(mess); 06889 }
Definition at line 6891 of file ePlayer.cpp.
Definition at line 6892 of file ePlayer.cpp.
Definition at line 6892 of file ePlayer.cpp.
Definition at line 6893 of file ePlayer.cpp.