void CPlayer::SetNick ( const char* szNick ) { if ( !m_strNick.empty () && m_strNick != szNick ) { // If changing, add the new name to the whowas list g_pGame->GetConsole ()->GetWhoWas ()->Add ( szNick, inet_addr ( GetSourceIP() ), GetSerial (), GetPlayerVersion (), GetAccount ()->GetName () ); } m_strNick.AssignLeft ( szNick, MAX_NICK_LENGTH ); }
void CPlayer::SetNick ( const char* szNick ) { if ( strlen ( m_szNick ) > 0 && strcmp ( m_szNick, szNick ) != 0 ) { // If changing, add the new name to the whowas list char szIP [22]; g_pGame->GetConsole ()->GetWhoWas ()->Add ( szNick, inet_addr ( GetSourceIP( szIP ) ), GetSerial (), GetPlayerVersion () ); } assert ( sizeof ( m_szNick ) == MAX_NICK_LENGTH + 1 ); // Copy the nick to us STRNCPY ( m_szNick, szNick, MAX_NICK_LENGTH + 1 ); }