src/engine/ePlayer.cpp File Reference

#include "eEventNotification.h"
#include "tMemManager.h"
#include "ePlayer.h"
#include "tConfiguration.h"
#include "eNetGameObject.h"
#include "rConsole.h"
#include "eTimer.h"
#include "tSysTime.h"
#include "rFont.h"
#include "uMenu.h"
#include "tToDo.h"
#include "rScreen.h"
#include <string>
#include <fstream>
#include <iostream>
#include <deque>
#include "rRender.h"
#include "rSysdep.h"
#include "nAuthentication.h"
#include "tDirectories.h"
#include "eTeam.h"
#include "eVoter.h"
#include "tReferenceHolder.h"
#include "tRandom.h"
#include "uInputQueue.h"
#include "nServerInfo.h"
#include "tRecorder.h"
#include "nConfig.h"
#include <time.h>
#include "tRuby.h"

Include dependency graph for ePlayer.cpp:

Go to the source code of this file.

Classes

class  PasswordStorage
class  tConfItemPassword
class  eMenuItemUserName
class  eMenuItemPassword
class  eMenuItemSilence
class  eChatSpamTester
struct  eChatInsertionCommand
class  eAutoCompleterChat
 Completer with the addition that it adds a : to a fully completed name if it's at the beginning of the line. More...
class  eMenuItemChat
 Handles the chat prompt. More...
class  gServerInfoAdmin
class  eNameMessenger
class  ePlayerCharacterFilter

Typedefs

typedef tString const
&(ePlayerNetID::* 
SE_NameGetter )() const
typedef tString(* SE_NameFilter )(tString const &)
typedef bool(* SE_NameHider )(ePlayerNetID const *hider, ePlayerNetID const *seeker)
typedef bool TestCharacter (char c)

Functions

tColoredStringoperator<< (tColoredString &s, const ePlayer &p)
tColoredStringoperator<< (tColoredString &s, const ePlayerNetID &p)
std::ostream & operator<< (std::ostream &s, const ePlayerNetID &p)
 tCONFIG_ENUM (eCamMode)
static bool operator== (PasswordStorage const &a, PasswordStorage const &b)
static std::string se_EscapeName (tString const &original, bool keepAt=true)
static tString se_UnauthenticatedUserName (tString const &name)
void se_DeletePasswords ()
static bool tr ()
static void PasswordCallback (nKrawall::nPasswordRequest const &request, nKrawall::nPasswordAnswer &answer)
static bool se_Hide (ePlayerNetID const *hider, ePlayerNetID const *seeker)
static char const * se_UserNameHelper ()
static const tStringse_UserName ()
static void chat (ePlayer *chatter, tString const &msgCore)
void se_rubyEval (tString msgCore)
static void se_RequestLogin (ePlayerNetID *p)
static void se_LoginWanted (nMessage &m)
static void se_WantLogin (ePlayer *lp)
static void se_DisplayChatLocally (ePlayerNetID *p, const tString &say)
static void se_DisplayChatLocallyClient (ePlayerNetID *p, const tString &message)
void handle_chat (nMessage &)
bool Contains (const tString &search_for_text, const tString &text_to_search)
static tString se_NameFilterID (tString const &name)
static bool se_NonHide (ePlayerNetID const *hider, ePlayerNetID const *seeker)
ePlayerNetIDCompareBufferToPlayerNames (const tString &nameRaw, int &num_matches, ePlayerNetID *requester, SE_NameGetter GetName, SE_NameFilter Filter, SE_NameHider Hider)
static ePlayerNetIDse_FindPlayerInChatCommand (ePlayerNetID *sender, char const *command, std::istream &s)
void handle_chat_client (nMessage &)
template<class TARGET>
void se_AppendChat (TARGET &out, tString const &message)
static tColoredString se_BuildChatString (ePlayerNetID const *sender, tString const &message)
static tColoredString se_BuildChatString (eTeam const *team, ePlayerNetID const *sender, tString const &message)
static tColoredString se_BuildChatString (ePlayerNetID const *sender, ePlayerNetID const *receiver, tString const &message)
static nMessagese_ServerControlledChatMessageConsole (ePlayerNetID const *player, tString const &toConsole)
static nMessagese_ServerControlledChatMessage (ePlayerNetID const *sender, tString const &message)
static nMessagese_ServerControlledChatMessage (ePlayerNetID const *sender, ePlayerNetID const *receiver, tString const &message)
static nMessagese_ServerControlledChatMessage (eTeam const *team, ePlayerNetID const *sender, tString const &message)
static nMessagese_NewChatMessage (ePlayerNetID const *player, tString const &message)
static nMessagese_OldChatMessage (tString const &line)
static nMessagese_OldChatMessage (ePlayerNetID const *player, tString const &message)
void se_BroadcastChat (ePlayerNetID *p, const tString &say)
void se_BroadcastChatLine (ePlayerNetID *p, const tString &line, const tString &forOldClients)
void se_SendPrivateMessage (ePlayerNetID const *sender, ePlayerNetID const *receiver, ePlayerNetID const *eavesdropper, tString const &message)
void se_SendTeamMessage (eTeam const *team, ePlayerNetID const *sender, ePlayerNetID const *receiver, tString const &message)
ePlayerNetIDse_GetAlivePlayerFromUserID (int uid)
static eTeamse_GetManagedTeam (ePlayerNetID *admin)
bool IsSilencedWithWarning (ePlayerNetID const *p)
static void se_ChatMe (ePlayerNetID *p, std::istream &s, eChatSpamTester &spam)
static void se_ChatTeamLeave (ePlayerNetID *p)
static void se_ChatTeam (ePlayerNetID *p, std::istream &s, eChatSpamTester &spam)
static void se_ChatMsg (ePlayerNetID *p, std::istream &s, eChatSpamTester &spam)
static void se_SendTo (std::string const &message, ePlayerNetID *receiver)
static void se_SendTeamMember (ePlayerNetID const *player, int indent, std::ostream &tos)
static void se_ListTeam (ePlayerNetID *receiver, eTeam *team)
static void se_ListTeams (ePlayerNetID *receiver)
static void teams_conf (std::istream &s)
static void se_ChatTeams (ePlayerNetID *p)
static void se_ListPlayers (ePlayerNetID *receiver)
static void players_conf (std::istream &s)
static void se_ChatPlayers (ePlayerNetID *p)
static void se_ChatShuffle (ePlayerNetID *p, std::istream &s)
static bool IsLegalPlayerName (tString const &name)
static ePlayerNetIDse_GetLocalPlayer ()
static void ConsoleSay_conf (std::istream &s)
static
uMenuItemStringWithHistory::history_t
se_chatHistory ()
void se_ChatState (ePlayerNetID::ChatFlags flag, bool cs)
static void do_chat ()
static void chat (ePlayer *chatter)
static void sg_ClampPingCharity (int &pingCharity)
static void sg_ClampPingCharity (unsigned short &pingCharity)
static void sg_ClampPingCharity ()
static void se_ClearLegacySpectator (int owner)
static void se_LegacySpectatorClearer ()
static void player_removed_from_game_handler (nMessage &m)
static void se_CutString (tColoredString &string, int maxLen)
static void se_CutString (tString &string, int maxLen)
void Clamp (unsigned short &colorComponent)
static void se_StripMatchingEnds (tString &stripper, TestCharacter &beginTester, TestCharacter &endTester)
static bool se_IsBlank (char c)
static bool se_IsInvalidNameEnd (char c)
static void se_StripNameEnds (tString &name)
static bool se_IsNameTaken (tString const &name, ePlayerNetID const *exception)
static void se_OptionalNameFilters (tString &remoteName)
void se_SaveToLadderLog (tOutput const &out)
 writes something to ladderlog.txt
void se_SaveToScoreFile (const tOutput &o)
 writes something to scorelog.txt
static bool se_VisibleSpectatorsSupported ()
static int se_ColorDistance (int a[3], int b[3])
static void se_RandomizeColor (ePlayer *l, ePlayerNetID *p)
void se_AutoShowScores ()
void se_UserShowScores (bool show)
void se_SetShowScoresAuto (bool a)
static void scores ()
static bool force_small_cons ()
static void cd ()
static bool sf (REAL x)
tOutputoperator<< (tOutput &o, const ePlayerNetID &p)
static unsigned short se_ReadUser (std::istream &s, ePlayerNetID *requester=0)
static bool se_NeedsServer (char const *command, std::istream &s, bool strict=true)
static void se_PlayerMessageConf (std::istream &s)
static void se_KickConf (std::istream &s)
static void se_MoveToConf (std::istream &s, REAL severity)
static void se_KickToConf (std::istream &s)
static void se_MoveToConf (std::istream &s)
static void se_BanConf (std::istream &s)
static ePlayerNetIDReadPlayer (std::istream &s)
static void Kill_conf (std::istream &s)
static void Suspend_conf_base (std::istream &s, int rounds)
static void Suspend_conf (std::istream &s)
static void UnSuspend_conf (std::istream &s)
static void Silence_conf (std::istream &s)
static void Voice_conf (std::istream &s)
static bool se_IsUnderscore (char c)
static void se_allowTeamChangesPlayer (bool allow, std::istream &s)
static void se_allowTeamChangesPlayer (std::istream &s)
static void se_disallowTeamChangesPlayer (std::istream &s)

Variables

tList< ePlayerNetIDse_PlayerNetIDs
static ePlayerse_Players = NULL
bool se_assignTeamAutomatically = true
static tSettingItem< bool > se_assignTeamAutomaticallyConf ("AUTO_TEAM", se_assignTeamAutomatically)
static bool se_allowTeamChanges = true
static tSettingItem< bool > se_allowTeamChangesConf ("ALLOW_TEAM_CHANGE", se_allowTeamChanges)
static bool se_enableChat = true
static tSettingItem< bool > se_enaChat ("ENABLE_CHAT", se_enableChat)
static tReferenceHolder
< ePlayerNetID
se_PlayerReferences
static tArray< PasswordStorageS_passwords
bool se_legacyLogNames = false
static tSettingItem< bool > se_llnConf ("LEGACY_LOG_NAMES", se_legacyLogNames)
static tConfItemPassword se_p
int se_PasswordStorageMode = 0
static tConfItem< int > pws ("PASSWORD_STORAGE","$password_storage_help", se_PasswordStorageMode)
static char const * default_instant_chat []
static nDescriptor se_loginWanted (204, se_LoginWanted,"AuthWanted")
static bool se_enableNameHilighting = true
static tSettingItem< bool > se_enableNameHilightingConf ("ENABLE_NAME_HILIGHTING", se_enableNameHilighting)
static nVersionFeature se_chatRelay (3)
static nVersionFeature se_chatHandlerClient (6)
 todo: lower this number or increase network version before next release
static nDescriptor chat_handler (200, handle_chat,"Chat")
static nDescriptor chat_handler_client (203, handle_chat_client,"Chat Client")
static tString sg_adminPass ("NONE")
static tConfItemLine sg_adminPassConf ("ADMIN_PASS", sg_adminPass)
static REAL se_alreadySaidTimeout = 5.0
static tSettingItem< REALse_alreadySaidTimeoutConf ("SPAM_PROTECTION_REPEAT", se_alreadySaidTimeout)
static bool se_allowShuffleUp = false
static tSettingItem< bool > se_allowShuffleUpConf ("TEAM_ALLOW_SHUFFLE_UP", se_allowShuffleUp)
static tString se_helpMessage ("")
static tConfItemLine se_helpMessageConf ("HELP_MESSAGE", se_helpMessage)
static bool se_silenceAll = false
static tAccessLevel se_chatAccessLevel = tAccessLevel_Program
static tSettingItem< tAccessLevelse_chatAccessLevelConf ("ACCESS_LEVEL_CHAT", se_chatAccessLevel)
REAL se_chatRequestTimeout = 60
static tSettingItem< REALse_chatRequestTimeoutConf ("ACCESS_LEVEL_CHAT_TIMEOUT", se_chatRequestTimeout)
static tAccessLevel se_teamSpyAccessLevel = tAccessLevel_Moderator
static tSettingItem< tAccessLevelse_teamSpyAccessLevelConf ("ACCESS_LEVEL_SPY_TEAM", se_teamSpyAccessLevel)
static tAccessLevel se_msgSpyAccessLevel = tAccessLevel_Owner
static tSettingItem< tAccessLevelse_msgSpyAccessLevelConf ("ACCESS_LEVEL_SPY_MSG", se_msgSpyAccessLevel)
static tAccessLevel se_ipAccessLevel = tAccessLevel_Moderator
static tSettingItem< tAccessLevelse_ipAccessLevelConf ("ACCESS_LEVEL_IPS", se_ipAccessLevel)
static tSettingItem< bool > se_silAll ("SILENCE_ALL", se_silenceAll)
static tConfItemFunc teams ("TEAMS",&teams_conf)
static tConfItemFunc players ("PLAYERS",&players_conf)
static tConfItemFunc ConsoleSay_c ("SAY",&ConsoleSay_conf)
static int se_chatHistoryMaxSize = 10
static tSettingItem< int > se_chatHistoryMaxSizeConf ("HISTORY_SIZE_CHAT", se_chatHistoryMaxSize)
static ePlayerse_chatterPlanned = NULL
static ePlayerse_chatter = NULL
static tString se_say
static bool se_allowControlDuringChat = false
static nSettingItem< bool > se_allowControlDuringChatConf ("ALLOW_CONTROL_DURING_CHAT", se_allowControlDuringChat)
uActionPlayer se_toggleSpectator ("TOGGLE_SPECTATOR", 0)
static tConfItemBasevpbtp [MAX_VIEWPORTS]
int pingCharity = 100
static const int maxPingCharity = 300
static int IMPOSSIBLY_LOW_SCORE = (-1 << 31)
static nSpamProtectionSettings se_chatSpamSettings (1.0f,"SPAM_PROTECTION_CHAT", tOutput("$spam_protection"))
static int se_maxPlayersPerIP = 4
static tSettingItem< int > se_maxPlayersPerIPConf ("MAX_PLAYERS_SAME_IP", se_maxPlayersPerIP)
static tJUST_CONTROLLED_PTR
< ePlayerNetID
se_legacySpectators [MAXCLIENTS+2]
static nCallbackLoginLogout se_legacySpectatorClearer (se_LegacySpectatorClearer)
static nDescriptor player_removed_from_game (202,&player_removed_from_game_handler,"player_removed_from_game")
static bool se_bugColorOverflow = true
tSettingItem< bool > se_bugColorOverflowColor ("BUG_COLOR_OVERFLOW", se_bugColorOverflow)
static bool se_allowImposters = false
static tSettingItem< bool > se_allowImposters1 ("ALLOW_IMPOSTERS", se_allowImposters)
static tSettingItem< bool > se_allowImposters2 ("ALLOW_IMPOSTORS", se_allowImposters)
static bool se_filterColorNames = false
tSettingItem< bool > se_coloredNamesConf ("FILTER_COLOR_NAMES", se_filterColorNames)
static bool se_stripNames = true
tSettingItem< bool > se_stripConf ("FILTER_NAME_ENDS", se_stripNames)
static bool se_stripMiddle = true
tSettingItem< bool > se_stripMiddleConf ("FILTER_NAME_MIDDLE", se_stripMiddle)
nNOInitialisator< ePlayerNetIDePlayerNetID_init (201,"ePlayerNetID")
static bool se_consoleLadderLog = false
static tSettingItem< bool > se_consoleLadderLogConf ("CONSOLE_LADDER_LOG", se_consoleLadderLog)
bool se_randomizeColor = true
static tSettingItem< bool > se_randomizeColorConf ("PLAYER_RANDOM_COLOR", se_randomizeColor)
static nSettingItem< int > se_pingCharityServerConf ("PING_CHARITY_SERVER", sn_pingCharityServer)
static nVersionFeature se_pingCharityServerControlled (14)
static int se_pingCharityMax = 500
static int se_pingCharityMin = 0
static tSettingItem< int > se_pingCharityMaxConf ("PING_CHARITY_MAX", se_pingCharityMax)
static tSettingItem< int > se_pingCharityMinConf ("PING_CHARITY_MIN", se_pingCharityMin)
static REAL se_playerWaitMax = 10.0f
static tSettingItem< REALse_playerWaitMaxConf ("PLAYER_CHAT_WAIT_MAX", se_playerWaitMax)
static REAL se_playerWaitFraction = .05f
static tSettingItem< REALse_playerWaitFractionConf ("PLAYER_CHAT_WAIT_FRACTION", se_playerWaitFraction)
static bool se_playerWaitSingle = false
static tSettingItem< bool > se_playerWaitSingleConf ("PLAYER_CHAT_WAIT_SINGLE", se_playerWaitSingle)
static bool se_playerWaitTeamleader = true
static tSettingItem< bool > se_playerWaitTeamleaderConf ("PLAYER_CHAT_WAIT_TEAMLEADER", se_playerWaitTeamleader)
static REAL se_chatterRemoveTime = 180.0
static tSettingItem< REALse_chatterRemoveTimeConf ("CHATTER_REMOVE_TIME", se_chatterRemoveTime)
static REAL se_idleRemoveTime = 0
static tSettingItem< REALse_idleRemoveTimeConf ("IDLE_REMOVE_TIME", se_idleRemoveTime)
static REAL se_idleKickTime = 0
static tSettingItem< REALse_idleKickTimeConf ("IDLE_KICK_TIME", se_idleKickTime)
static bool show_scores = false
static bool ass = true
static rPerFrameTask pf & scores
static rSmallConsoleCallback sc & force_small_cons
static uActionGlobal score ("SCORE")
static rCenterDisplayCallback c_dcd
const unsigned short TEAMCHANGE = 0
const unsigned short NEW_TEAM = 1
static tConfItemFunc se_PlayerMessage_c ("PLAYER_MESSAGE",&se_PlayerMessageConf)
static tAccessLevelSetter se_messConfLevel (se_PlayerMessage_c, tAccessLevel_Moderator)
static tString se_defaultKickReason ("")
static tConfItemLine se_defaultKickReasonConf ("DEFAULT_KICK_REASON", se_defaultKickReason)
static tConfItemFunc se_kickConf ("KICK",&se_KickConf)
static tAccessLevelSetter se_kickConfLevel (se_kickConf, tAccessLevel_Moderator)
static tString se_defaultKickToServer ("")
static int se_defaultKickToPort = 4534
static tString se_defaultKickToReason ("")
static tSettingItem< tStringse_defaultKickToServerConf ("DEFAULT_KICK_TO_SERVER", se_defaultKickToServer)
static tSettingItem< int > se_defaultKickToPortConf ("DEFAULT_KICK_TO_PORT", se_defaultKickToPort)
static tConfItemLine se_defaultKickToReasonConf ("DEFAULT_KICK_TO_REASON", se_defaultKickToReason)
static tConfItemFunc se_kickToConf ("KICK_TO",&se_KickToConf)
static tAccessLevelSetter se_kickToConfLevel (se_kickToConf, tAccessLevel_Moderator)
static tConfItemFunc se_moveToConf ("MOVE_TO",&se_MoveToConf)
static tAccessLevelSetter se_moveConfLevel (se_moveToConf, tAccessLevel_Moderator)
static tConfItemFunc se_banConf ("BAN",&se_BanConf)
static tAccessLevelSetter se_banConfLevel (se_banConf, tAccessLevel_Moderator)
static tConfItemFunc kill_conf ("KILL",&Kill_conf)
static tAccessLevelSetter se_killConfLevel (kill_conf, tAccessLevel_Moderator)
static tConfItemFunc suspend_conf ("SUSPEND",&Suspend_conf)
static tAccessLevelSetter se_suspendConfLevel (suspend_conf, tAccessLevel_Moderator)
static tConfItemFunc unsuspend_conf ("UNSUSPEND",&UnSuspend_conf)
static tAccessLevelSetter se_unsuspendConfLevel (unsuspend_conf, tAccessLevel_Moderator)
static tConfItemFunc silence_conf ("SILENCE",&Silence_conf)
static tAccessLevelSetter se_silenceConfLevel (silence_conf, tAccessLevel_Moderator)
static tConfItemFunc voice_conf ("VOICE",&Voice_conf)
static tAccessLevelSetter se_voiceConfLevel (voice_conf, tAccessLevel_Moderator)
static tString sg_url
static tSettingItem< tStringsg_urlConf ("URL", sg_url)
static tString sg_options ("Nothing special.")
static gServerInfoAdmin sg_serverAdmin
static bool se_allowEnemiesSameIP = false
static tSettingItem< bool > se_allowEnemiesSameIPConf ("ALLOW_ENEMIES_SAME_IP", se_allowEnemiesSameIP)
static bool se_allowEnemiesSameClient = false
static tSettingItem< bool > se_allowEnemiesSameClientConf ("ALLOW_ENEMIES_SAME_CLIENT", se_allowEnemiesSameClient)
static tConfItemFunc se_allowTeamChangesPlayerConf ("ALLOW_TEAM_CHANGE_PLAYER",&se_allowTeamChangesPlayer)
static tConfItemFunc se_disallowTeamChangesPlayerConf ("DISALLOW_TEAM_CHANGE_PLAYER",&se_disallowTeamChangesPlayer)
static tAccessLevelSetter se_atcConfLevel (se_allowTeamChangesPlayerConf, tAccessLevel_TeamLeader)
static tAccessLevelSetter se_dtcConfLevel (se_disallowTeamChangesPlayerConf, tAccessLevel_TeamLeader)


Typedef Documentation

typedef tString(* SE_NameFilter)(tString const &)

Definition at line 1536 of file ePlayer.cpp.

typedef tString const&(ePlayerNetID::* SE_NameGetter)() const

Definition at line 1533 of file ePlayer.cpp.

typedef bool(* SE_NameHider)(ePlayerNetID const *hider, ePlayerNetID const *seeker)

Definition at line 1545 of file ePlayer.cpp.

typedef bool TestCharacter(char c)

Definition at line 4540 of file ePlayer.cpp.


Function Documentation

static void cd (  )  [static]

Definition at line 5929 of file ePlayer.cpp.

05931                 {

static void chat ( ePlayer chatter  )  [static]

Definition at line 3519 of file ePlayer.cpp.

03522 {

static void chat ( ePlayer chatter,
tString const &  msgCore 
) [static]

Definition at line 3512 of file ePlayer.cpp.

03515 {
03516     se_chatterPlanned = chatter;
03517     se_say = say;

void Clamp ( unsigned short &  colorComponent  ) 

Definition at line 4533 of file ePlayer.cpp.

04536 {
04537     if ( colorComponent > 15 )

ePlayerNetID* CompareBufferToPlayerNames ( const tString nameRaw,
int &  num_matches,
ePlayerNetID requester,
SE_NameGetter  GetName,
SE_NameFilter  Filter,
SE_NameHider  Hider 
)

Definition at line 1557 of file ePlayer.cpp.

References a, Contains(), GrowingArrayBase::Len(), and se_PlayerNetIDs.

Referenced by ePlayerNetID::FindPlayerByName().

01563 {
01564     num_matches = 0;
01565     ePlayerNetID * match = 0;
01566 
01567     // also filter input string
01568     tString name = (*Filter)( nameRaw );
01569 
01570     // run through all players and look for a match
01571     for ( int a = se_PlayerNetIDs.Len()-1; a>=0; --a ) {
01572         ePlayerNetID* toMessage = se_PlayerNetIDs(a);
01573 
01574         if ( (*Hider)( toMessage, requester ) )
01575         {
01576             continue;
01577         }
01578 
01579         tString playerName = (*Filter)( (toMessage->*GetName)() );
01580 
01581         // exact match?
01582         if ( playerName == name )
01583         {
01584             num_matches = 1;
01585             return toMessage;
01586         }
01587 
01588         if ( Contains(name, playerName)) {
01589             match= toMessage; // Doesn't matter that this is wrote over everytime, when we only have one match it will be there.
01590             num_matches+=1;
01591         }
01592     }
01593 
01594     // return result
01595     return match;
01596 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void ConsoleSay_conf ( std::istream &  s  )  [static]

Definition at line 3317 of file ePlayer.cpp.

03320 {
03321     // read the message
03322     tString message;
03323     message.ReadLine( s, true );
03324 
03325     switch (sn_GetNetState())
03326     {
03327     case nCLIENT:
03328         {
03329             ePlayerNetID *me = se_GetLocalPlayer();
03330 
03331             if (me)
03332                 me->Chat( message );
03333 
03334             break;
03335         }
03336     case nSERVER:
03337         {
03338             tColoredString send;
03339             send << tColoredString::ColorString( 1,0,0 );
03340             send << "Admin";
03341             send << tColoredString::ColorString( 1,1,.5 );
03342             send << ": " << message << "\n";
03343 
03344             // display it
03345             sn_ConsoleOut( send );
03346 
03347             break;
03348         }
03349     default:
03350         {
03351             ePlayerNetID *me = se_GetLocalPlayer();
03352 
03353             if ( me )
03354                 se_DisplayChatLocally( me, message );
03355 
03356             break;
03357         }

bool Contains ( const tString search_for_text,
const tString text_to_search 
)

Definition at line 1518 of file ePlayer.cpp.

References a, and b.

Referenced by CompareBufferToPlayerNames().

01518                                                                                  {
01519     int m = strlen(search_for_text);
01520     int n = strlen(text_to_search);
01521     int a, b;
01522     for (b=0; b<=n-m; ++b) {
01523         for (a=0; a<m && search_for_text[a] == text_to_search[a+b]; ++a)
01524             ;
01525         if (a>=m)
01526             // a match has been found
01527             return true;
01528     }
01529     return false;
01530 }

Here is the caller graph for this function:

static void do_chat (  )  [static]

Definition at line 3475 of file ePlayer.cpp.

References ePlayerNetID::ChatFlags_Chat, uMenu::Enter(), ePlayerNetID::GetName(), GrowingArrayBase::Len(), max(), NULL, players, se_ChatState(), se_chatter, se_chatterPlanned, se_PlayerNetIDs, se_say, se_SetShowScoresAuto(), uMenu::SetBot(), uMenu::SetCenter(), rConsole::SetHeight(), uMenu::SetTop(), sr_con, and su_ClearKeys().

03477                      {
03478     if (se_chatterPlanned){
03479         su_ClearKeys();
03480 
03481         se_chatter=se_chatterPlanned;
03482         se_chatterPlanned=NULL;
03483         se_ChatState( ePlayerNetID::ChatFlags_Chat, true);
03484 
03485         sr_con.SetHeight(15,false);
03486         se_SetShowScoresAuto(false);
03487 
03488         uMenu chat_menu("",false);
03489 
03490         std::deque<tString> players;
03491         unsigned short int max=se_PlayerNetIDs.Len();
03492         for(unsigned short int i=0;i<max;i++){
03493             ePlayerNetID *p=se_PlayerNetIDs(i);
03494             players.push_back(p->GetName());
03495         }
03496         eAutoCompleterChat completer(players);
03497 
03498 
03499         eMenuItemChat s(&chat_menu,se_say,se_chatter,&completer);
03500         chat_menu.SetCenter(-.75);
03501         chat_menu.SetBot(-2);
03502         chat_menu.SetTop(-.7);
03503         chat_menu.Enter();
03504 
03505         se_ChatState( ePlayerNetID::ChatFlags_Chat, false );
03506 
03507         sr_con.SetHeight(7,false);
03508         se_SetShowScoresAuto(true);
03509     }
03510     se_chatter=NULL;

Here is the call graph for this function:

static bool force_small_cons (  )  [static]

Definition at line 5923 of file ePlayer.cpp.

05925                               {

void handle_chat ( nMessage m  ) 

Definition at line 3083 of file ePlayer.cpp.

03086 {
03087     nTimeRolling currentTime = tSysTimeFloat();
03088     unsigned short id;
03089     m.Read(id);
03090     tColoredString say;
03091     m >> say;
03092 
03093     tJUST_CONTROLLED_PTR< ePlayerNetID > p=dynamic_cast<ePlayerNetID *>(nNetObject::ObjectDangerous(id));
03094 
03095     // register player activity
03096     if ( p )
03097         p->lastActivity_ = currentTime;
03098 
03099     if(sn_GetNetState()==nSERVER){
03100         if (p)
03101         {
03102             // for the duration of this function, set the access level to the level of the user.
03103             tCurrentAccessLevel levelOverride( p->GetAccessLevel() );
03104 
03105             // check if the player is owned by the sender to avoid cheating
03106             if( p->Owner() != m.SenderID() )
03107             {
03108                 Cheater( m.SenderID() );
03109                 nReadError();
03110                 return;
03111             }
03112 
03113             eChatSpamTester spam( p, say );
03114             
03115             if (say.StartsWith("/")) {
03116                 std::string sayStr(say);
03117                 std::istringstream s(sayStr);
03118 
03119                 tString command;
03120                 s >> command;
03121 
03122                 // filter to lowercase
03123                 tToLower( command );
03124 
03125                 tConfItemBase::EatWhitespace(s);
03126 
03127                 // now, s is ready for reading the rest of the message.
03128 #ifdef DEDICATED
03129                 if (se_InterceptCommands.StrPos(command) != -1)
03130                 {
03131                     handle_command_intercept(p, say);
03132                     return;
03133                 }
03134                 else
03135 #endif
03136                     if (command == "/me") {
03137                         se_ChatMe( p, s, spam );
03138                         return;
03139                     }
03140                     else if (command == "/teamname") {
03141                         tString msg;
03142                         msg.ReadLine( s );
03143                         p->SetTeamname(msg);
03144                         return;
03145                     }
03146                     else if (command == "/teamleave") {
03147                         se_ChatTeamLeave( p );
03148                         return;
03149                     }
03150                     else if (command == "/teamleave" || command=="/spectate") {
03151                         p->SetTeamWish(NULL);
03152                         return;
03153                     }
03154                     else if (command == "/teamshuffle" || command == "/shuffle") {
03155                         se_ChatShuffle( p, s );
03156                         return;
03157                     }
03158                     else if (command == "/team")
03159                     {
03160                         se_ChatTeam( p, s, spam );
03161                         return;
03162                     }
03163                     else if (command == "/msg" ) {
03164                         se_ChatMsg( p, s, spam );
03165                         return;
03166                     }
03167                     else if (command == "/help")
03168                     {
03169                         sn_ConsoleOut(se_helpMessage + "\n", p->Owner());
03170                         se_DisplayChatLocally(p, say);
03171                         return;
03172                     }
03173                     else if (command == "/players") {
03174                         se_ChatPlayers( p );
03175                         return;
03176                     }
03177                     else if (command == "/vote" || command == "/callvote") {
03178                         eVoter::HandleChat( p, s );
03179                         return;
03180                     }
03181                     else if (command == "/teams") {
03182                         se_ChatTeams( p );
03183                         return;
03184                     }
03185 #ifdef DEDICATED
03186                     else {
03187                         handle_chat_admin_commands( p, command, say, s );
03188                         return;
03189                     }
03190 #endif
03191             }
03192 
03193             // check for spam
03194             if ( spam.Block() )
03195             {
03196                 return;
03197             }
03198 
03199             // well, that leaves only regular, boring chat.
03200             if ( say.Len() <= se_SpamMaxLen+2 && !IsSilencedWithWarning(p) )
03201             {
03202                 se_BroadcastChat( p, say );
03203                 se_DisplayChatLocally( p, say);
03204             }
03205         }
03206     }
03207     else
03208     {
03209         se_DisplayChatLocally( p, say );

void handle_chat_client ( nMessage m  ) 

Definition at line 1693 of file ePlayer.cpp.

References nNetObject::id, nSERVER, nNetObject::ObjectDangerous(), nMessage::Read(), se_DisplayChatLocallyClient(), and sn_GetNetState().

01694 {
01695     if(sn_GetNetState()!=nSERVER)
01696     {
01697         unsigned short id;
01698         m.Read(id);
01699         tColoredString say;
01700         m >> say;
01701 
01702         tJUST_CONTROLLED_PTR< ePlayerNetID > p=dynamic_cast<ePlayerNetID *>(nNetObject::ObjectDangerous(id));
01703 
01704         se_DisplayChatLocallyClient( p, say );
01705     }
01706 }

Here is the call graph for this function:

static bool IsLegalPlayerName ( tString const &  name  )  [static]

Definition at line 3213 of file ePlayer.cpp.

References isblank(), and tString::Len().

Referenced by se_OptionalNameFilters(), and ePlayerNetID::SetName().

03216 {
03217     // strip colors
03218     tString stripped( tColoredString::RemoveColors( name ) );
03219 
03220     // and count non-whitespace characters
03221     for ( int i = stripped.Len()-2; i>=0; --i )
03222     {
03223         if ( !isblank( stripped(i) ) )
03224             return true;
03225     }
03226 

Here is the call graph for this function:

Here is the caller graph for this function:

bool IsSilencedWithWarning ( ePlayerNetID const *  p  ) 

Definition at line 2673 of file ePlayer.cpp.

References ePlayerNetID::IsLoggedIn(), ePlayerNetID::IsSilenced(), nNetObject::Owner(), se_enableChat, se_silenceAll, and sn_ConsoleOut().

Referenced by se_ChatMe(), se_ChatMsg(), and se_ChatTeam().

02675 {
02676     if ( !se_enableChat && ! p->IsLoggedIn() )
02677     {
02678         // everyone except the admins is silenced
02679         sn_ConsoleOut( tOutput( "$spam_protection_silenceall" ), p->Owner() );
02680         return true;
02681     }
02682     else if ( p->IsSilenced() )
02683     {
02684         if(se_silenceAll) {
02685             // player is silenced, but all players are silenced by default
02686             sn_ConsoleOut( tOutput( "$spam_protection_silenced_default" ), p->Owner() );
02687         } else {
02688             // player is specially silenced
02689             sn_ConsoleOut( tOutput( "$spam_protection_silenced" ), p->Owner() );
02690         }
02691         return true;
02692     }
02693 
02694     return false;

Here is the call graph for this function:

Here is the caller graph for this function:

static void Kill_conf ( std::istream &  s  )  [static]

Definition at line 6685 of file ePlayer.cpp.

06688 {
06689     if ( se_NeedsServer( "KILL", s, false ) )
06690     {
06691         return;
06692     }
06693 
06694     ePlayerNetID * p = ReadPlayer( s );
06695     if ( p && p->Object() )
06696     {
06697         p->Object()->Kill();
06698         sn_ConsoleOut( tOutput( "$player_admin_kill", p->GetColoredName() ) );

tOutput& operator<< ( tOutput o,
const ePlayerNetID p 
)

Definition at line 5948 of file ePlayer.cpp.

05951 {
05952     tColoredString x;
05953     x << p;
05954     o << x;

std::ostream& operator<< ( std::ostream &  s,
const ePlayerNetID p 
)

Definition at line 72 of file ePlayer.cpp.

References ePlayerNetID::GetColoredName().

00072                                                               {
00073     return s << p.GetColoredName();
00074 }

Here is the call graph for this function:

tColoredString& operator<< ( tColoredString s,
const ePlayerNetID p 
)

Definition at line 68 of file ePlayer.cpp.

References ePlayerNetID::GetColoredName().

00068                                                                       {
00069     return s << p.GetColoredName();
00070 }

Here is the call graph for this function:

tColoredString& operator<< ( tColoredString s,
const ePlayer p 
)

Definition at line 61 of file ePlayer.cpp.

References tColoredString::ColorString(), ePlayer::Name(), and ePlayer::rgb.

00061                                                                  {
00062     return s << tColoredString::ColorString(p.rgb[0]/15.0,
00063                                             p.rgb[1]/15.0,
00064                                             p.rgb[2]/15.0)
00065            << p.Name();
00066 }

Here is the call graph for this function:

static bool operator== ( PasswordStorage const &  a,
PasswordStorage const &  b 
) [static]

Definition at line 124 of file ePlayer.cpp.

References PasswordStorage::methodCongested, and PasswordStorage::username.

Referenced by operator!=(), ePoint::operator!=(), and ePoint::operator==().

00125 {
00126     return
00127     a.username == b.username &&
00128     a.methodCongested == b.methodCongested;
00129 }

Here is the caller graph for this function:

static void PasswordCallback ( nKrawall::nPasswordRequest const &  request,
nKrawall::nPasswordAnswer answer 
) [static]

Definition at line 428 of file ePlayer.cpp.

References nKrawall::nPasswordAnswer::aborted, nKrawall::nPasswordAnswer::automatic, tString::Clear(), rTextField::COLOR_IGNORE, con, uMenu::Enter(), nKrawall::nPasswordRequest::failureOnLastTry, ePlayer::globalID, tString::Len(), GrowingArrayBase::Len(), login, MAX_PLAYERS, nKrawall::nPasswordRequest::message, nKrawall::nMethod::method, PasswordStorage::methodCongested, uMenuItemSelection< T >::NewChoice(), NULL, PasswordStorage::password, tRecorder::Playback(), nKrawall::nMethod::prefix, tRecorder::Record(), S_passwords, PasswordStorage::save, nKrawall::nPasswordAnswer::scrambled, nKrawall::nMethod::ScramblePassword(), section, uMenuItemString::SetColorMode(), uMenu::SetSelected(), nKrawall::nMethod::suffix, tr(), us, PasswordStorage::username, and nKrawall::nPasswordAnswer::username.

Referenced by ePlayer::ePlayer().

00430 {
00431     int i;
00432 
00433     tString& username = answer.username;
00434     const tString& message = request.message;
00435     nKrawall::nScrambledPassword& scrambled = answer.scrambled;
00436     bool failure = request.failureOnLastTry;
00437 
00438     if ( request.method != "md5" && request.method != "bmd5" )
00439     {
00440         con << "Unknown password scrambling method requested.";
00441         answer.aborted = true;
00442         return;
00443     }
00444 
00445     // find the player with the given username:
00446     /*
00447     ePlayer* p = NULL;
00448     for (i = MAX_PLAYERS-1; i>=0 && !p; i--)
00449     {
00450         ePlayer * perhaps = ePlayer::PlayerConfig(i);
00451         tString filteredName;
00452         ePlayerNetID::FilterName( perhaps->name, filteredName );
00453         if ( filteredName == username )
00454             p = perhaps;
00455     }
00456 
00457     // or the given raw name
00458     for (i = MAX_PLAYERS-1; i>=0 && !p; i--)
00459     {
00460         ePlayer * perhaps = ePlayer::PlayerConfig(i);
00461         if ( perhaps->name == username )
00462             p = perhaps;
00463     }
00464 
00465     // or just any player, what the heck.
00466     if (!p)
00467         p = ePlayer::PlayerConfig(0);
00468     */
00469 
00470     // try to find the username in the saved passwords
00471     tString methodCongested = request.method + '|' + request.prefix + '|' + request.suffix;
00472 
00473     PasswordStorage *storage = NULL;
00474     for (i = S_passwords.Len()-1; i>=0; i--)
00475     {
00476         PasswordStorage & candidate = S_passwords(i); 
00477         if (answer.username == candidate.username && 
00478             methodCongested  == candidate.methodCongested
00479             )
00480             storage = &candidate;
00481     }
00482 
00483     if (!storage)
00484     {
00485         // find an empty slot
00486         for (i = S_passwords.Len()-1; i>=0; i--)
00487             if (S_passwords(i).username.Len() < 1)
00488                 storage = &S_passwords(i);
00489 
00490         if (!storage)
00491             storage = &S_passwords[S_passwords.Len()];
00492 
00493         failure = true;
00494     }
00495 
00496     static char const * section = "PASSWORD_MENU";
00497     tRecorder::Playback( section, failure );
00498     tRecorder::Record( section, failure );
00499 
00500     // immediately return the stored password if it was not marked as wrong:
00501     if (!failure)
00502     {
00503         if ( storage )
00504         {
00505             answer.username = storage->username;
00506             answer.scrambled = storage->password;
00507         }
00508         answer.automatic = true;
00509 
00510         return;
00511     }
00512     else
00513         storage->username.Clear();
00514 
00515     // scramble input for recording
00516     uInputScrambler scrambler;
00517 
00518     // password was not stored. Request it from user:
00519     uMenu login(message, false);
00520 
00521     // password storage;
00522     tString password;
00523 
00524     eMenuItemPassword pw(&login, password);
00525     eMenuItemUserName us(&login, username);
00526     us.SetColorMode( rTextField::COLOR_IGNORE );
00527 
00528     uMenuItemSelection<int> storepw(&login,
00529                                     "$login_storepw_text",
00530                                     "$login_storepw_help",
00531                                     se_PasswordStorageMode);
00532     storepw.NewChoice("$login_storepw_dont_text",
00533                       "$login_storepw_dont_help",
00534                       -1);
00535     storepw.NewChoice("$login_storepw_mem_text",
00536                       "$login_storepw_mem_help",
00537                       0);
00538     storepw.NewChoice("$login_storepw_disk_text",
00539                       "$login_storepw_disk_help",
00540                       1);
00541 
00542     uMenuItemExit cl(&login, "$login_cancel", "$login_cancel_help" );
00543 
00544     login.SetSelected(1);
00545 
00546     // check if the username the server sent us matches one of the players'
00547     // global IDs. If it does we can directly select the password menu
00548     // menu entry since the user probably just wants to enter the password.
00549     for(int i = 0; i < MAX_PLAYERS; ++i) {
00550         tString const &id = se_Players[i].globalID;
00551         if(id.Len() <= username.Len() || id(username.Len() - 1) != '@') {
00552             continue;
00553         }
00554         bool match = true;
00555         for(int j = username.Len() - 2; j >= 0; --j) {
00556             if(username(j) != id(j)) {
00557                 match = false;
00558                 break;
00559             }
00560         }
00561         if(match) {
00562             login.SetSelected(0);
00563         }
00564     }
00565 
00566     // force a small console while we are in here
00567     rSmallConsoleCallback cb(&tr);
00568 
00569     login.Enter();
00570 
00571     // return username/scrambled password
00572     {
00573         // scramble password
00574         request.ScramblePassword( nKrawall::nScrambleInfo( username ), password, scrambled );
00575 
00576         // if S_login still exists, we were not canceled
00577         answer.aborted = !eMenuItemPassword::entered;
00578 
00579         // clear the PW from memory
00580         for (i = password.Len()-2; i>=0; i--)
00581             password(i) = 'a';
00582 
00583         if (se_PasswordStorageMode >= 0)
00584         {
00585             storage->username = username;
00586             storage->methodCongested = methodCongested;
00587             storage->password = scrambled;
00588             storage->save = (se_PasswordStorageMode > 0);
00589         }
00590     }
00591 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void player_removed_from_game_handler ( nMessage m  )  [static]

Definition at line 3942 of file ePlayer.cpp.

03945 {
03946     // and the ID of the player that was removed
03947     unsigned short id;
03948     m.Read(id);
03949     ePlayerNetID* p = dynamic_cast< ePlayerNetID* >( nNetObject::ObjectDangerous( id ) );
03950     if ( p && sn_GetNetState() != nSERVER )
03951     {
03952         p->RemoveFromGame();

static void players_conf ( std::istream &  s  )  [static]

Definition at line 3006 of file ePlayer.cpp.

References se_ListPlayers().

03008 {
03009     se_ListPlayers( 0 );

Here is the call graph for this function:

static ePlayerNetID* ReadPlayer ( std::istream &  s  )  [static]

Definition at line 6660 of file ePlayer.cpp.

06663 {
06664     // read name of player to be returned
06665     tString name;
06666     s >> name;
06667 
06668     int num = name.ToInt();
06669     if ( num > 0 )
06670     {
06671         // look for a player from that client
06672         for ( int i = se_PlayerNetIDs.Len()-1; i>=0; --i )
06673         {
06674             ePlayerNetID* p = se_PlayerNetIDs(i);
06675 
06676             // check whether it's p who should be returned
06677             if ( p->Owner() == num )
06678             {
06679                 return p;
06680             }
06681         }
06682     }
06683 

static void scores (  )  [static]

Definition at line 5911 of file ePlayer.cpp.

References ePlayerNetID::DisplayScores(), se_mainGameTimer, and show_scores.

05913                     {
05914     if (show_scores){
05915         if ( se_mainGameTimer )
05916             ePlayerNetID::DisplayScores();
05917         else
05918             show_scores = false;

Here is the call graph for this function:

static void se_allowTeamChangesPlayer ( std::istream &  s  )  [static]

Definition at line 7478 of file ePlayer.cpp.

07480                                                      {

static void se_allowTeamChangesPlayer ( bool  allow,
std::istream &  s 
) [static]

Definition at line 7465 of file ePlayer.cpp.

07467                                                                  {
07468     if ( se_NeedsServer( "(DIS)ALLOW_TEAM_CHANGE_PLAYER", s, false ) )
07469     {
07470         return;
07471     }
07472 
07473     ePlayerNetID * p = ReadPlayer( s );
07474     if ( p )
07475     {
07476         sn_ConsoleOut( tOutput( (allow ? "$player_allowed_teamchange" : "$player_disallowed_teamchange"), p->GetName() ) );
07477         p->SetTeamChangeAllowed( allow );

template<class TARGET>
void se_AppendChat ( TARGET &  out,
tString const &  message 
) [inline]

Definition at line 1710 of file ePlayer.cpp.

References tString::Len(), se_SpamMaxLen, and tString::SetLen().

Referenced by se_BuildChatString(), and se_NewChatMessage().

01711 {
01712     if ( message.Len() <= se_SpamMaxLen*2 )
01713         out << message;
01714     else
01715     {
01716         tString cut( message );
01717         cut.SetLen( se_SpamMaxLen*2 );
01718         out << cut;
01719     }
01720 }

Here is the call graph for this function:

Here is the caller graph for this function:

void se_AutoShowScores (  ) 

Definition at line 5896 of file ePlayer.cpp.

References ass, and show_scores.

05898                         {
05899     if (ass)

static void se_BanConf ( std::istream &  s  )  [static]

Definition at line 6625 of file ePlayer.cpp.

06628 {
06629     if ( se_NeedsServer( "BAN", s ) )
06630     {
06631         return;
06632     }
06633 
06634     // get user ID
06635     int num = se_ReadUser( s );
06636 
06637     if ( num == 0 && !s.good() )
06638     {
06639         con << "Usage: BAN <user ID or name> <time in minutes(defaults to 60)> <Reason>\n";
06640         return;
06641     }
06642 
06643     // read time to ban
06644     REAL banTime = 60;
06645     s >> banTime;
06646     std::ws(s);
06647 
06648     tString reason;
06649     reason.ReadLine(s);
06650 
06651     // and ban.
06652     if ( num > 0 )
06653     {
06654         nMachine::GetMachine( num ).Ban( banTime * 60, reason );
06655         sn_DisconnectUser( num , reason.Len() > 1 ? static_cast< char const *>( reason ) : "$network_kill_kick" );

void se_BroadcastChat ( ePlayerNetID p,
const tString say 
)

Definition at line 1844 of file ePlayer.cpp.

References MAXCLIENTS, se_chatHandlerClient, se_chatRelay, se_NewChatMessage(), se_OldChatMessage(), se_ServerControlledChatMessage(), sn_Connections, and nVersionFeature::Supported().

01845 {
01846     // create chat messages
01847     tJUST_CONTROLLED_PTR< nMessage > mServerControlled = se_ServerControlledChatMessage( p, say );
01848     tJUST_CONTROLLED_PTR< nMessage > mNew = se_NewChatMessage( p, say );
01849     tJUST_CONTROLLED_PTR< nMessage > mOld = se_OldChatMessage( p, say );
01850 
01851     // send them to the users, depending on what they understand
01852     for ( int user = MAXCLIENTS; user > 0; --user )
01853     {
01854         if ( sn_Connections[ user ].socket )
01855         {
01856             if ( se_chatHandlerClient.Supported( user ) )
01857                 mServerControlled->Send( user );
01858             else if ( se_chatRelay.Supported( user ) )
01859                 mNew->Send( user );
01860             else
01861                 mOld->Send( user );
01862         }
01863     }
01864 }

Here is the call graph for this function:

void se_BroadcastChatLine ( ePlayerNetID p,
const tString line,
const tString forOldClients 
)

Definition at line 1868 of file ePlayer.cpp.

References MAXCLIENTS, se_chatHandlerClient, se_chatRelay, se_NewChatMessage(), se_OldChatMessage(), se_ServerControlledChatMessageConsole(), sn_Connections, and nVersionFeature::Supported().

Referenced by se_ChatMe().

01869 {
01870     // create chat messages
01871     tJUST_CONTROLLED_PTR< nMessage > mServerControlled = se_ServerControlledChatMessageConsole( p, line );
01872     tJUST_CONTROLLED_PTR< nMessage > mNew = se_NewChatMessage( p, forOldClients );
01873     tJUST_CONTROLLED_PTR< nMessage > mOld = se_OldChatMessage( line );
01874 
01875     // send them to the users, depending on what they understand
01876     for ( int user = MAXCLIENTS; user > 0; --user )
01877     {
01878         if ( sn_Connections[ user ].socket )
01879         {
01880             if ( se_chatHandlerClient.Supported( user ) )
01881                 mServerControlled->Send( user );
01882             else if ( se_chatRelay.Supported( user ) )
01883                 mNew->Send( user );
01884             else
01885                 mOld->Send( user );
01886         }
01887     }
01888 }

Here is the call graph for this function:

Here is the caller graph for this function:

static tColoredString se_BuildChatString ( ePlayerNetID const *  sender,
ePlayerNetID const *  receiver,
tString const &  message 
) [static]

Definition at line 1766 of file ePlayer.cpp.

References tColoredString::ColorString(), and se_AppendChat().

01767 {
01768     tColoredString console;
01769     console << *sender;
01770     console << tColoredString::ColorString(1,1,.5) << " --> ";
01771     console << *receiver;
01772     console << tColoredString::ColorString(1,1,.5) << ": ";
01773     se_AppendChat( console, message );
01774 
01775     return console;
01776 }

Here is the call graph for this function:

static tColoredString se_BuildChatString ( eTeam const *  team,
ePlayerNetID const *  sender,
tString const &  message 
) [static]

Definition at line 1734 of file ePlayer.cpp.

References eTeam::B(), tColoredString::ColorString(), eTeam::G(), eTeam::Name(), eTeam::R(), and se_AppendChat().

01735 {
01736     tColoredString console;
01737     console << *sender;
01738 
01739     if( !sender->CurrentTeam() )
01740     {
01741         // foo --> Spectatos: message
01742         console << tColoredString::ColorString(1,1,.5) << " --> " << tOutput("$player_spectator_message");
01743     }
01744     else if (sender->CurrentTeam() == team)
01745     {
01746         // foo --> Teammates: some message here
01747         console << tColoredString::ColorString(1,1,.5) << " --> ";
01748         console << tColoredString::ColorString(team->R(),team->G(),team->B()) << tOutput("$player_team_message");
01749     }
01750     else {
01751         // foo (Red Team) --> Blue Team: some message here
01752         eTeam *senderTeam = sender->CurrentTeam();
01753         console << tColoredString::ColorString(1,1,.5) << " (";
01754         console << tColoredString::ColorString(senderTeam->R(),senderTeam->G(),senderTeam->B()) << senderTeam->Name();
01755         console << tColoredString::ColorString(1,1,.5) << ") --> ";
01756         console << tColoredString::ColorString(team->R(),team->G(),team->B()) << team->Name();
01757     }
01758 
01759     console << tColoredString::ColorString(1,1,.5) << ": ";
01760     se_AppendChat( console, message );
01761 
01762     return console;
01763 }

Here is the call graph for this function:

static tColoredString se_BuildChatString ( ePlayerNetID const *  sender,
tString const &  message 
) [static]

Definition at line 1723 of file ePlayer.cpp.

References tColoredString::ColorString(), and se_AppendChat().

Referenced by se_ChatMsg(), se_ChatTeam(), se_OldChatMessage(), and se_ServerControlledChatMessage().

01724 {
01725     tColoredString console;
01726     console << *sender;
01727     console << tColoredString::ColorString(1,1,.5) << ": ";
01728     se_AppendChat( console, message );
01729 
01730     return console;
01731 }

Here is the call graph for this function:

Here is the caller graph for this function:

static uMenuItemStringWithHistory::history_t& se_chatHistory (  )  [static]

Definition at line 3371 of file ePlayer.cpp.

03373                                                              {
03374     static uMenuItemStringWithHistory::history_t instance("chat_history.txt");

static void se_ChatMe ( ePlayerNetID p,
std::istream &  s,
eChatSpamTester spam 
) [static]

Definition at line 2697 of file ePlayer.cpp.

References eChatSpamTester::Block(), tColoredString::ColorString(), IsSilencedWithWarning(), tString::ReadLine(), se_BroadcastChatLine(), and sn_ConsoleOut().

02699 {
02700     if ( IsSilencedWithWarning(p) || spam.Block() )
02701     {
02702         return;
02703     }
02704     
02705     tString msg;
02706     msg.ReadLine( s );
02707 
02708     tColoredString console;
02709     console << tColoredString::ColorString(1,1,1)  << "* ";
02710     console << *p;
02711     console << tColoredString::ColorString(1,1,.5) << " " << msg;
02712     console << tColoredString::ColorString(1,1,1)  << " *";
02713     
02714     tColoredString forOldClients;
02715     forOldClients << tColoredString::ColorString(1,1,1)  << "*"
02716                   << tColoredString::ColorString(1,1,.5) << msg
02717                   << tColoredString::ColorString(1,1,1)  << "*";
02718     
02719     se_BroadcastChatLine( p, console, forOldClients );
02720     console << "\n";
02721     sn_ConsoleOut(console,0);
02722     return;

Here is the call graph for this function:

static void se_ChatMsg ( ePlayerNetID p,
std::istream &  s,
eChatSpamTester spam 
) [static]

Definition at line 2828 of file ePlayer.cpp.

References eChatSpamTester::Block(), ePlayerNetID::CurrentTeam(), eAccessLevelHolder::GetAccessLevel(), IsSilencedWithWarning(), GrowingArrayBase::Len(), nNetObject::Owner(), tString::ReadLine(), se_BuildChatString(), se_FindPlayerInChatCommand(), se_msgSpyAccessLevel, se_PlayerNetIDs, se_SendPrivateMessage(), and sn_ConsoleOut().

02828                     : talk to anyone team
02829 static void se_ChatMsg( ePlayerNetID * p, std::istream & s, eChatSpamTester & spam )
02830 {
02831     // odd, the refactored original did not check for silence. Probably by design.
02832     if ( /* IsSilencedWithWarning(player) || */ spam.Block() )
02833     {
02834         return;
02835     }
02836     
02837     // Check for player
02838     ePlayerNetID * receiver =  se_FindPlayerInChatCommand( p, "/msg", s );
02839     
02840     // One match, send it.
02841     if ( receiver ) {
02842         // extract rest of message: it is the true message to send
02843         std::ws(s);
02844 
02845         // read the rest of the message
02846         tString msg_core;
02847         msg_core.ReadLine(s);
02848         
02849         // build chat string
02850         tColoredString toServer = se_BuildChatString( p, receiver, msg_core );
02851         toServer << '\n';
02852         
02853         // log locally
02854         sn_ConsoleOut(toServer,0);
02855         
02856         if ( p->CurrentTeam() == receiver->CurrentTeam() || !IsSilencedWithWarning(p) )
02857         {
02858             // log to sender's console
02859             sn_ConsoleOut(toServer, p->Owner());
02860             
02861             // send to receiver
02862             if ( p->Owner() != receiver->Owner() )
02863                 se_SendPrivateMessage( p, receiver, receiver, msg_core );
02864         }
02865 
02866         // let admins of sufficient rights eavesdrop
02867         for( int i = se_PlayerNetIDs.Len() - 1; i >=0; --i )
02868         {
02869             ePlayerNetID * admin = se_PlayerNetIDs(i);
02870             
02871             if ( admin != receiver && admin != p && admin->GetAccessLevel() <=  se_msgSpyAccessLevel )
02872             {
02873                 se_SendPrivateMessage( p, receiver, admin, msg_core );
02874             }
02875         }
02876     }

Here is the call graph for this function:

static void se_ChatPlayers ( ePlayerNetID p  )  [static]

Definition at line 3014 of file ePlayer.cpp.

References se_ListPlayers().

03016 {
03017     se_ListPlayers( p );

Here is the call graph for this function:

static void se_ChatShuffle ( ePlayerNetID p,
std::istream &  s 
) [static]

Definition at line 3020 of file ePlayer.cpp.

References ePlayerNetID::CurrentTeam(), eAccessLevelHolder::GetAccessLevel(), tString::Len(), eTeam::NumPlayers(), nNetObject::Owner(), tString::ReadLine(), se_allowShuffleUp, se_ListTeam(), eTeam::Shuffle(), sn_ConsoleOut(), ePlayerNetID::TeamListID(), and tString::ToInt().

03020                  : reorders team formation
03021 static void se_ChatShuffle( ePlayerNetID * p, std::istream & s )
03022 {
03023     tString msg;
03024     msg.ReadLine( s );
03025 
03026     // team position shuffling. Allow players to change their team setup.
03027     // syntax:
03028     // /teamshuffle: shuffles you all the way to the outside.
03029     // /teamshuffle <pos>: shuffles you to position pos
03030     // /teamshuffle +/-<dist>: shuffles you dist to the outside/inside
03031     // con << msgRest << "\n";
03032     int IDNow = p->TeamListID();
03033     if (!p->CurrentTeam())
03034     {
03035         sn_ConsoleOut(tOutput("$player_not_on_team"), p->Owner());
03036         return;
03037     }
03038     int len = p->CurrentTeam()->NumPlayers();
03039     int IDWish = len-1; // default to shuffle to the outside
03040     
03041                         // but read the target position as additional parameter
03042     if (msg.Len() > 1)
03043     {
03044         IDWish = IDNow;
03045         if ( msg[0] == '+' )
03046             IDWish += msg.ToInt(1);
03047         else if ( msg[0] == '-' )
03048             IDWish -= msg.ToInt(1);
03049         else
03050             IDWish = msg.ToInt()-1;
03051     }
03052 
03053     if (IDWish < 0)
03054         IDWish = 0;
03055     if (IDWish >= len)
03056         IDWish = len-1;
03057 
03058         if(IDWish < IDNow)
03059         {
03060 #ifndef KRAWALL_SERVER
03061                 if ( !se_allowShuffleUp )
03062                 {
03063                         sn_ConsoleOut(tOutput("$player_noshuffleup"), p->Owner());
03064                         return;
03065                 }
03066 #else
03067                 if ( !p->GetAccessLevel() > se_shuffleUpAccessLevel )
03068                 {
03069                         sn_ConsoleOut(tOutput("$access_level_shuffle_up_denied"), p->Owner());
03070                         return;
03071                 }
03072 #endif
03073         }
03074 
03075     if( IDNow == IDWish )
03076     {
03077         sn_ConsoleOut(tOutput("$player_noshuffle"), p->Owner());
03078         return;
03079     }
03080 
03081     p->CurrentTeam()->Shuffle( IDNow, IDWish );

Here is the call graph for this function:

void se_ChatState ( ePlayerNetID::ChatFlags  flag,
bool  cs 
)

Definition at line 3462 of file ePlayer.cpp.

References GrowingArrayBase::Len(), nNetObject::Owner(), ePlayerNetID::pID, ePlayerNetID::SetChatting(), and sn_myNetID.

Referenced by Activate(), do_chat(), do_con(), ingame_menu_cleanup(), sg_VoteMenuIdle(), and gGame::StateUpdate().

03464                                                       {
03465     for(int i=se_PlayerNetIDs.Len()-1;i>=0;i--)
03466     {
03467         ePlayerNetID *p = se_PlayerNetIDs[i];
03468         if (p->Owner()==sn_myNetID && p->pID >= 0){
03469             p->SetChatting( flag, cs );
03470         }

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_ChatTeam ( ePlayerNetID p,
std::istream &  s,
eChatSpamTester spam 
) [static]

Definition at line 2760 of file ePlayer.cpp.

References eChatSpamTester::Block(), eAccessLevelHolder::GetAccessLevel(), eTeam::IsInvited(), IsSilencedWithWarning(), GrowingArrayBase::Len(), NULL, eTeam::NumPlayers(), nNetObject::Owner(), eTeam::Player(), tString::ReadLine(), se_BuildChatString(), se_GetManagedTeam(), se_PlayerNetIDs, se_SendTeamMessage(), se_teamSpyAccessLevel, and sn_ConsoleOut().

02760                      : talk to your team
02761 static void se_ChatTeam( ePlayerNetID * p, std::istream & s, eChatSpamTester & spam )
02762 {
02763     eTeam *currentTeam = se_GetManagedTeam( p );
02764 
02765     // silencing only affects spectators here
02766     if ( ( !currentTeam && IsSilencedWithWarning(p) ) || spam.Block() )
02767     {
02768         return;
02769     }
02770     
02771     tString msg;
02772     msg.ReadLine( s );
02773 
02774     // Log message to server and sender
02775     tColoredString messageForServerAndSender = se_BuildChatString(currentTeam, p, msg);
02776     messageForServerAndSender << "\n";
02777     
02778     if (currentTeam != NULL) // If a player has just joined the game, he is not yet on a team. Sending a /team message will crash the server
02779     {
02780         sn_ConsoleOut(messageForServerAndSender, 0);
02781         sn_ConsoleOut(messageForServerAndSender, p->Owner());
02782 
02783         // Send message to team-mates
02784         int numTeamPlayers = currentTeam->NumPlayers();
02785         for (int teamPlayerIndex = 0; teamPlayerIndex < numTeamPlayers; teamPlayerIndex++) {
02786             if (currentTeam->Player(teamPlayerIndex)->Owner() != p->Owner()) // Do not resend the message to yourself
02787                 se_SendTeamMessage(currentTeam, p, currentTeam->Player(teamPlayerIndex), msg);
02788         }
02789 
02790         // check for other players who are authorized to hear the message
02791         for( int i = se_PlayerNetIDs.Len() - 1; i >=0; --i )
02792         {
02793             ePlayerNetID * admin = se_PlayerNetIDs(i);
02794             
02795             if (
02796                 // well, you have to be a spectator. No spying on the enemy.
02797                 se_GetManagedTeam( admin ) == 0 && admin != p &&
02798                 (
02799                     // let spectating admins of sufficient rights eavesdrop
02800                     admin->GetAccessLevel() <=  se_teamSpyAccessLevel ||
02801                     // invited players are also authorized
02802                     currentTeam->IsInvited( admin )
02803                     )
02804                 )
02805             {
02806                 se_SendTeamMessage(currentTeam, p, admin, msg);
02807             }
02808         }
02809     }
02810     else
02811     {
02812         sn_ConsoleOut(messageForServerAndSender, 0);
02813         sn_ConsoleOut(messageForServerAndSender, p->Owner());
02814 
02815         // check for other spectators
02816         for( int i = se_PlayerNetIDs.Len() - 1; i >=0; --i )
02817         {
02818             ePlayerNetID * spectator = se_PlayerNetIDs(i);
02819             
02820             if ( se_GetManagedTeam( spectator ) == 0 && spectator != p )
02821             {
02822                 se_SendTeamMessage(currentTeam, p, spectator, msg);
02823             }
02824         }
02825     }

Here is the call graph for this function:

static void se_ChatTeamLeave ( ePlayerNetID p  )  [static]

Definition at line 2725 of file ePlayer.cpp.

References ePlayerNetID::CurrentTeam(), ePlayerNetID::GetName(), eTeam::Name(), ePlayerNetID::NextTeam(), eTeam::NumPlayers(), nNetObject::Owner(), se_assignTeamAutomatically, ePlayerNetID::SetTeamWish(), sn_ConsoleOut(), and ePlayerNetID::TeamChangeAllowed().

02725                           : leaves the current team
02726 static void se_ChatTeamLeave( ePlayerNetID * p )
02727 {
02728     if ( se_assignTeamAutomatically )
02729     {
02730         sn_ConsoleOut(tOutput("$player_teamleave_disallowed"), p->Owner() );
02731         return;
02732     }
02733     if(!p->TeamChangeAllowed()) {
02734         sn_ConsoleOut(tOutput("$player_disallowed_teamchange"), p->Owner() );
02735         return;
02736     }
02737     
02738     eTeam * leftTeam = p->NextTeam();
02739     if ( leftTeam )
02740     {
02741         if ( !leftTeam )
02742             leftTeam = p->CurrentTeam();
02743         
02744         if ( leftTeam->NumPlayers() > 1 )
02745         {
02746             sn_ConsoleOut( tOutput( "$player_leave_team_wish",
02747                                     tColoredString::RemoveColors(p->GetName()),
02748                                     tColoredString::RemoveColors(leftTeam->Name()) ) );
02749         }
02750         else
02751         {
02752             sn_ConsoleOut( tOutput( "$player_leave_game_wish",
02753                                     tColoredString::RemoveColors(p->GetName()) ) );
02754         }
02755     }
02756     
02757     p->SetTeamWish(0);

Here is the call graph for this function:

static void se_ChatTeams ( ePlayerNetID p  )  [static]

Definition at line 2967 of file ePlayer.cpp.

References se_ListTeams().

02969 {
02970     se_ListTeams( p );

Here is the call graph for this function:

static void se_ClearLegacySpectator ( int  owner  )  [static]

Definition at line 3837 of file ePlayer.cpp.

References NULL, ePlayerNetID::RemoveFromGame(), and se_legacySpectators.

Referenced by ePlayerNetID::MyInitAfterCreation(), and se_LegacySpectatorClearer().

03840 {
03841     ePlayerNetID * player = se_legacySpectators[ owner ];
03842 
03843     // fully remove player
03844     if ( player )
03845     {
03846         player->RemoveFromGame();
03847     }
03848 

Here is the call graph for this function:

Here is the caller graph for this function:

static int se_ColorDistance ( int  a[3],
int  b[3] 
) [static]

Definition at line 5343 of file ePlayer.cpp.

05346 {
05347     int distance = 0;
05348     for( int i = 2; i >= 0; --i )
05349     {
05350         int diff = a[i] - b[i];
05351         distance += diff * diff;
05352         //diff = diff < 0 ? -diff : diff;
05353         //if ( diff > distance )
05354         //{
05355         //    distance = diff;
05356         //}
05357     }
05358 

static void se_CutString ( tString string,
int  maxLen 
) [static]

Definition at line 4526 of file ePlayer.cpp.

04529 {

static void se_CutString ( tColoredString string,
int  maxLen 
) [static]

Definition at line 4516 of file ePlayer.cpp.

04519 {
04520     if (string.Len() > maxLen )
04521     {
04522         string = string.SubStr(0, maxLen);
04523         //string[string.Len()-1]='\0';
04524         string.RemoveTrailingColor();

void se_DeletePasswords (  ) 

Definition at line 263 of file ePlayer.cpp.

References tConsole::Message(), tArray< T, MALLOC >::SetLen(), and st_SaveConfig().

00263                          {
00264     S_passwords.SetLen(0);
00265 
00266     st_SaveConfig();
00267 
00268     /*
00269 
00270       REAL timeout = tSysTimeFloat() + 3;
00271 
00272       while(tSysTimeFloat() < timeout){
00273 
00274       sr_ResetRenderState(true);
00275       rViewport::s_viewportFullscreen.Select();
00276 
00277       sr_ClearGL();
00278 
00279       uMenu::GenericBackground();
00280 
00281       REAL w=16*3/640.0;
00282       REAL h=32*3/480.0;
00283 
00284 
00285       //REAL middle=-.6;
00286 
00287       Color(1,1,1);
00288       DisplayText(0,.8,w,h,tOutput("$network_opts_deletepw_complete"));
00289 
00290       sr_SwapGL();
00291       }
00292 
00293     */
00294 
00295     tConsole::Message("$network_opts_deletepw_complete", tOutput(), 5);
00296 }

Here is the call graph for this function:

static void se_disallowTeamChangesPlayer ( std::istream &  s  )  [static]

Definition at line 7481 of file ePlayer.cpp.

07483                                                         {

static void se_DisplayChatLocally ( ePlayerNetID p,
const tString say 
) [static]

Definition at line 1418 of file ePlayer.cpp.

References tColoredString::ColorString(), con, ePlayerNetID::IsSilenced(), se_enableChat, se_rubyEval(), and st_Breakpoint().

01419 {
01420 #ifdef DEBUG_X
01421     if (strstr( say, "BUG" ) )
01422     {
01423         st_Breakpoint();
01424     }
01425 #endif
01426 
01427     if ( p && !p->IsSilenced() && se_enableChat )
01428     {
01429         //tColoredString say2( say );
01430         //say2.RemoveHex();
01431         tColoredString message;
01432         message << *p;
01433         message << tColoredString::ColorString(1,1,.5);
01434         message << ": " << say << '\n';
01435         con << message;
01436 
01437         if (say.StartsWith("eval ")) {
01438             se_rubyEval(say.SubStr(5));
01439         }
01440     }
01441 }

Here is the call graph for this function:

static void se_DisplayChatLocallyClient ( ePlayerNetID p,
const tString message 
) [static]

Definition at line 1446 of file ePlayer.cpp.

References eGameObject::Alive(), con, rViewportConfiguration::CurrentViewportConfiguration(), ePlayerNetID::GetName(), ePlayerNetID::IsSilenced(), rViewportConfiguration::num_viewports, ePlayerNetID::Object(), ePlayer::PlayerConfig(), pos, se_enableChat, se_enableNameHilighting, se_rubyEval(), sr_viewportBelongsToPlayer, and tString::SubStr().

Referenced by handle_chat_client().

01447 {
01448     if ( p && !p->IsSilenced() && se_enableChat )
01449     {
01450         if (!p->Object() || !p->Object()->Alive()) {
01451             con << tOutput("$dead_console_decoration");
01452         }
01453 
01454         tString actualMessage(message);
01455 
01456         if(se_enableNameHilighting) {
01457             //iterate through players...
01458             rViewportConfiguration* viewportConfiguration = rViewportConfiguration::CurrentViewportConfiguration();
01459             if(viewportConfiguration == 0) return;
01460             for ( int viewport = viewportConfiguration->num_viewports-1; viewport >= 0; --viewport ) {
01461                 int playerID = sr_viewportBelongsToPlayer[ viewport ];
01462 
01463                 // get the player
01464                 ePlayer* player = ePlayer::PlayerConfig( playerID );
01465                 if(player == 0) continue;
01466                 ePlayerNetID* netPlayer = player->netPlayer;
01467                 if(netPlayer == 0) continue;
01468                 if(netPlayer == p) continue; //the same player who chatted, no point in hilighting
01469                 tString const &name = netPlayer->GetName();
01470 
01471                 if ( name.size() > 0 )
01472                 {
01473                     //find all occureces of the name...
01474                     for(tString::size_type pos = actualMessage.find(name); pos != tString::npos; pos = actualMessage.find(name, pos+16)) {
01475                         //find the last color code
01476                         tString::size_type lastcolorpos = actualMessage.rfind("0x", pos);
01477                         tString lastcolorstring;
01478                         if(lastcolorpos != tString::npos) {
01479                             lastcolorstring = actualMessage.SubStr(lastcolorpos, 8);
01480                         } else {
01481                             lastcolorstring = "0xffff7f";
01482                         }
01483 
01484                         if(lastcolorpos >= pos - 8) {
01485                             //the name we matched is within a color code... bad idea to substitute it.
01486                             pos -= 16 - name.size();
01487                             continue;
01488                         }
01489 
01490                         //actually insert the color codes around the name
01491                         actualMessage.insert(pos+name.size(), lastcolorstring);
01492                         actualMessage.insert(pos, "0xff887f");
01493                     }
01494                 }
01495             }
01496         }
01497         con << actualMessage << "\n";
01498 
01499         tString msgCore = tColoredString::RemoveColors(message);
01500         int skip = msgCore.find(": eval");
01501         if (skip > 0) {
01502             se_rubyEval(msgCore.SubStr(skip + 6));
01503         }
01504     }
01505 
01506 }

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string se_EscapeName ( tString const &  original,
bool  keepAt = true 
) [static]

Definition at line 142 of file ePlayer.cpp.

References c, filter(), and tString::Len().

Referenced by ePlayerNetID::GetFilteredAuthenticatedName(), and se_UnauthenticatedUserName().

00143 {
00144     std::ostringstream filter; 
00145 
00146     int lastC = 'x';
00147     for( int i = 0; i < original.Len()-1; ++i )
00148     {
00149         unsigned int c = static_cast< unsigned char >( original[i] );
00150 
00151         // a valid character
00152         switch (c)
00153         {
00154             // characters to escape
00155         case ' ':
00156             filter << "\\_";
00157             break;
00158         case '@':
00159             if ( keepAt )
00160             {
00161                 filter << '@';
00162             }
00163             else
00164             {
00165                 filter << "\\@";
00166             }
00167             break;
00168         case '\\':
00169         case '%':
00170         case ':':
00171             filter.put('\\');
00172             filter.put(c);
00173             break;
00174         case 'x':
00175             // color codes?
00176             if ( lastC == '0' )
00177             {
00178                 filter << "\\x";
00179                 break;
00180             }    
00181         default:
00182             if ( 0x20 < c && 0x7f >= c )
00183             {
00184                 // normal ascii, print 
00185                 filter.put(c);
00186             }
00187             else
00188             {
00189                 // encode as hexcode
00190                 filter << '%' << std::hex << std::uppercase << std::setfill('0') << std::setw(2) << c;
00191             }
00192         }
00193         
00194         lastC = c;
00195     }
00196 
00197     // done! wrap up stream as string.
00198     return filter.str();
00199 }

Here is the call graph for this function:

Here is the caller graph for this function:

static ePlayerNetID* se_FindPlayerInChatCommand ( ePlayerNetID sender,
char const *  command,
std::istream &  s 
) [static]

Definition at line 1675 of file ePlayer.cpp.

References ePlayerNetID::FindPlayerByName(), nNetObject::Owner(), and sn_ConsoleOut().

Referenced by se_ChatMsg().

01676 {
01677     tString player;
01678     s >> player;
01679 
01680     if (player == "" )
01681     {
01682         sn_ConsoleOut( tOutput( "$chatcommand_requires_player", command ), sender->Owner() );
01683         return 0;
01684     }
01685     
01686     return ePlayerNetID::FindPlayerByName( player, sender );
01687 }

Here is the call graph for this function:

Here is the caller graph for this function:

ePlayerNetID* se_GetAlivePlayerFromUserID ( int  uid  ) 

Definition at line 1994 of file ePlayer.cpp.

References a, eGameObject::Alive(), GrowingArrayBase::Len(), ePlayerNetID::Object(), nNetObject::Owner(), and se_PlayerNetIDs.

01995 {
01996     // run through all players and look for a match
01997     for ( int a = se_PlayerNetIDs.Len()-1; a>=0; --a )
01998     {
01999         ePlayerNetID * p = se_PlayerNetIDs(a);
02000         if ( p && p->Owner() == uid &&
02001                 ( ( p->Object() && p->Object()->Alive() ) ) )
02002             return p;
02003     }
02004 
02005     // found nothing
02006     return 0;
02007 }

Here is the call graph for this function:

static ePlayerNetID* se_GetLocalPlayer (  )  [static]

Definition at line 3305 of file ePlayer.cpp.

References GrowingArrayBase::Len(), NULL, nNetObject::Owner(), and sn_myNetID.

03308 {
03309     for(int i=0; i<se_PlayerNetIDs.Len(); i++)
03310     {
03311         ePlayerNetID *p = se_PlayerNetIDs[i];
03312 
03313         if( p->Owner() == sn_myNetID )
03314             return p;
03315     }

Here is the call graph for this function:

static eTeam* se_GetManagedTeam ( ePlayerNetID admin  )  [static]

Definition at line 2537 of file ePlayer.cpp.

References ePlayerNetID::CurrentTeam().

Referenced by se_ChatTeam().

02538 {
02539     return admin->CurrentTeam();
02540 }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool se_Hide ( ePlayerNetID const *  hider,
ePlayerNetID const *  seeker 
) [static]

Definition at line 850 of file ePlayer.cpp.

Referenced by ePlayerNetID::FindPlayerByName(), and se_ListPlayers().

00851 {
00852     return false;
00853 }

Here is the caller graph for this function:

static bool se_IsBlank ( char  c  )  [static]

Definition at line 4572 of file ePlayer.cpp.

References isblank().

Referenced by se_StripNameEnds().

04575 {

Here is the call graph for this function:

Here is the caller graph for this function:

static bool se_IsInvalidNameEnd ( char  c  )  [static]

Definition at line 4578 of file ePlayer.cpp.

References isblank().

Referenced by se_StripNameEnds().

04579                                                   :
04580 static bool se_IsInvalidNameEnd( char c )
04581 {
    return isblank( c ) || c == ':' || c == '.';

Here is the call graph for this function:

Here is the caller graph for this function:

static bool se_IsNameTaken ( tString const &  name,
ePlayerNetID const *  exception 
) [static]

Definition at line 4590 of file ePlayer.cpp.

References ePlayerNetID::FilterName(), eAccessLevelHolder::GetAccessLevel(), ePlayerNetID::GetName(), ePlayerNetID::GetUserName(), GrowingArrayBase::Len(), tString::Len(), se_PlayerNetIDs, and tAccessLevel_Default.

Referenced by ePlayerNetID::UpdateName().

04593 {
04594     if ( name.Len() <= 1 )
04595         return false;
04596 
04597     // check for other players with the same name
04598     for (int i = se_PlayerNetIDs.Len()-1; i >= 0; --i )
04599     {
04600         ePlayerNetID * player = se_PlayerNetIDs(i);
04601         if ( player != exception )
04602         {
04603             if ( name == player->GetUserName() || name == ePlayerNetID::FilterName( player->GetName() ) )
04604                 return true;
04605         }
04606     }
04607 
04608 #ifdef KRAWALL_SERVER
04609     // check for reserved nicknames
04610     {
04611         tString reservedFor = se_reserveNick.Get( name );
04612         if ( reservedFor != "" && 
04613              ( !exception || exception->GetAccessLevel() >= tAccessLevel_Default ||
04614                exception->GetRawAuthenticatedName() != reservedFor ) )
04615         {
04616             return true;
04617         }
04618     }
04619 #endif
04620 

Here is the call graph for this function:

Here is the caller graph for this function:

static bool se_IsUnderscore ( char  c  )  [static]

Definition at line 7117 of file ePlayer.cpp.

Referenced by ePlayerNetID::FilterName().

07120 {

Here is the caller graph for this function:

static void se_KickConf ( std::istream &  s  )  [static]

Definition at line 6533 of file ePlayer.cpp.

06536 {
06537     if ( se_NeedsServer( "KICK", s ) )
06538     {
06539         return;
06540     }
06541 
06542     // get user ID
06543     int num = se_ReadUser( s );
06544 
06545     tString reason = se_defaultKickReason;
06546     if ( !s.eof() )
06547         reason.ReadLine(s);
06548 
06549     // and kick.
06550     if ( num > 0 && !s.good() )
06551     {
06552         sn_KickUser( num ,  reason.Len() > 1 ? static_cast< char const *>( reason ) : "$network_kill_kick" );
06553     }
06554     else
06555     {
06556         con << "Usage: KICK <user ID or name> <Reason>\n";
06557         return;

static void se_KickToConf ( std::istream &  s  )  [static]

Definition at line 6609 of file ePlayer.cpp.

06612 {

static void se_LegacySpectatorClearer (  )  [static]

Definition at line 3851 of file ePlayer.cpp.

References se_ClearLegacySpectator(), and nCallbackLoginLogout::User().

03854 {

Here is the call graph for this function:

static void se_ListPlayers ( ePlayerNetID receiver  )  [static]

Definition at line 2972 of file ePlayer.cpp.

References tCurrentAccessLevel::GetAccessLevel(), eAccessLevelHolder::GetAccessLevel(), ePlayerNetID::GetFilteredAuthenticatedName(), nMachine::GetIP(), nNetObject::GetMachine(), tCurrentAccessLevel::GetName(), ePlayerNetID::GetName(), tString::Len(), GrowingArrayBase::Len(), nNetObject::Owner(), se_Hide(), se_ipAccessLevel, se_PlayerNetIDs, se_SendTo(), and tAccessLevel_Default.

Referenced by players_conf(), and se_ChatPlayers().

02974 {
02975     for ( int i2 = se_PlayerNetIDs.Len()-1; i2>=0; --i2 )
02976     {
02977         ePlayerNetID* p2 = se_PlayerNetIDs(i2);
02978         std::ostringstream tos;
02979         tos << p2->Owner();
02980         tos << ": ";
02981         if ( p2->GetAccessLevel() < tAccessLevel_Default && !se_Hide( p2, receiver ) )
02982         {
02983             // player username comes from authentication name and may be much different from
02984             // the screen name
02985             tos << p2->GetFilteredAuthenticatedName() << " ( " << p2->GetName() << ", " 
02986                 << tCurrentAccessLevel::GetName( p2->GetAccessLevel() )
02987                 << " )";
02988         }
02989         else
02990         {
02991             tos << p2->GetName();
02992         }
02993         if ( tCurrentAccessLevel::GetAccessLevel() <= se_ipAccessLevel )
02994         {
02995             tString IP = p2->GetMachine().GetIP();
02996             if ( IP.Len() > 1 )
02997             {
02998                 tos << ", IP = " << IP;
02999             }
03000         }
03001         tos << "\n";
03002 
03003         se_SendTo( tos.str(), receiver );
03004     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_ListTeam ( ePlayerNetID receiver,
eTeam team 
) [static]

Definition at line 2903 of file ePlayer.cpp.

References eTeam::B(), eTeam::G(), eTeam::IsLocked(), eTeam::Name(), eTeam::NumPlayers(), eTeam::Player(), eTeam::R(), se_SendTeamMember(), and se_SendTo().

Referenced by se_ChatShuffle(), and se_ListTeams().

02905 {
02906     std::ostringstream tos;
02907     
02908     // send team name
02909     tColoredString teamName;
02910     teamName << tColoredStringProxy( team->R()/15.0f, team->G()/15.0f, team->B()/15.0f ) << team->Name();
02911     tos << teamName << "0xRESETT";
02912     if ( team->IsLocked() )
02913     {
02914         tos << " " << tOutput( "$invite_team_locked_list" );
02915     }
02916     tos << ":\n";
02917     
02918     // send team members
02919     int teamMembers = team->NumPlayers();
02920     
02921     int indent = 0;
02922     // print left wing, the odd team members
02923     for( int i = (teamMembers/2)*2-1; i>=0; i -= 2 )
02924     {
02925         se_SendTeamMember( team->Player(i), indent, tos );
02926         indent += 2;
02927     }
02928     // print right wing, the even team members
02929     for( int i = 0; i < teamMembers; i += 2 )
02930     {
02931         se_SendTeamMember( team->Player(i), indent, tos );
02932         indent -= 2;
02933     }
02934     
02935     tos << "\n";
02936     
02937     se_SendTo( tos.str(), receiver );

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_ListTeams ( ePlayerNetID receiver  )  [static]

Definition at line 2939 of file ePlayer.cpp.

References eTeam::IsLocked(), eTeam::NumPlayers(), se_ListTeam(), se_SendTo(), and eTeam::teams.

Referenced by se_ChatTeams(), and teams_conf().

02941 {
02942     int numTeams = 0;
02943     
02944     for ( int i = eTeam::teams.Len() - 1; i >= 0; --i )
02945     {
02946         eTeam * team = eTeam::teams[i];
02947         if ( team->NumPlayers() > 1 || team->IsLocked() )
02948         {
02949             numTeams++;
02950             se_ListTeam( receiver, team );
02951         }
02952     }
02953 
02954     if ( numTeams == 0 )
02955     {
02956         se_SendTo( std::string( tString( tOutput("$no_real_teams") ) ), receiver );
02957     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_LoginWanted ( nMessage m  )  [static]

Definition at line 1282 of file ePlayer.cpp.

References se_RequestLogin(), nMessage::SenderID(), and sn_ConsoleOut().

01283 {
01284 #ifdef KRAWALL_SERVER
01285 
01286     // read player
01287     ePlayerNetID * p;
01288     m >> p;
01289 
01290     if ( p && m.SenderID() == p->Owner() && !p->IsAuthenticated() )
01291     {
01292         // read wanted flag
01293         m >> p->loginWanted;
01294         tString authName;
01295 
01296         // read authentication name
01297         m >> authName;
01298         p->SetRawAuthenticatedName( authName );
01299 
01300         // check for stupid bans
01301         if ( se_IsUserBanned( p, authName ) )
01302         {
01303             return;
01304         }
01305 
01306         se_RequestLogin( p );
01307     }
01308 #else
01309     sn_ConsoleOut( tOutput( "$login_not_supported" ), m.SenderID() );
01310 #endif
01311 }

Here is the call graph for this function:

static void se_MoveToConf ( std::istream &  s  )  [static]

Definition at line 6617 of file ePlayer.cpp.

06620 {

static void se_MoveToConf ( std::istream &  s,
REAL  severity 
) [static]

Definition at line 6570 of file ePlayer.cpp.

06573 {
06574     if ( se_NeedsServer( "KICK/MOVE_TO", s ) )
06575     {
06576         return;
06577     }
06578 
06579     // get user ID
06580     int num = se_ReadUser( s );
06581 
06582     // read redirection target
06583     tString server = se_defaultKickToServer;
06584     if ( !s.eof() )
06585     {
06586         s >> server;
06587     }
06588 
06589     int port = se_defaultKickToPort;
06590     if ( !s.eof() )
06591         s >> port;
06592 
06593     nServerInfoRedirect redirect( server, port );
06594 
06595     tString reason = se_defaultKickToReason;
06596     if ( !s.eof() )
06597         reason.ReadLine(s);
06598 
06599     // and kick.
06600     if ( num > 0 && !s.good() )
06601     {
06602         sn_KickUser( num ,  reason.Len() > 1 ? static_cast< char const *>( reason ) : "$network_kill_kick", severity, &redirect );
06603     }
06604     else
06605     {
06606         con << "Usage: KICK_TO <user ID or name> <server IP to kick to>:<server port to kick to> <Reason>\n";
06607         return;

static tString se_NameFilterID ( tString const &  name  )  [static]

Definition at line 1539 of file ePlayer.cpp.

Referenced by ePlayerNetID::FindPlayerByName().

01540 {
01541     return name;
01542 }

Here is the caller graph for this function:

static bool se_NeedsServer ( char const *  command,
std::istream &  s,
bool  strict = true 
) [static]

Definition at line 6490 of file ePlayer.cpp.

References con, nSERVER, nSTANDALONE, tString::ReadLine(), and sn_GetNetState().

06493 {
06494     if ( sn_GetNetState() != nSERVER && ( strict || sn_GetNetState() != nSTANDALONE ) )
06495     {
06496         tString rest;
06497         rest.ReadLine( s );
06498         con << tOutput("$only_works_on_server", command, rest );
06499         return true;
06500     }
06501 

Here is the call graph for this function:

static nMessage* se_NewChatMessage ( ePlayerNetID const *  player,
tString const &  message 
) [static]

Definition at line 1817 of file ePlayer.cpp.

References chat_handler, nNetObject::ID(), se_AppendChat(), tASSERT, tNEW, and nMessage::Write().

Referenced by se_BroadcastChat(), se_BroadcastChatLine(), se_SendPrivateMessage(), and se_SendTeamMessage().

01818 {
01819     tASSERT( player );
01820 
01821     nMessage *m=tNEW(nMessage) (chat_handler);
01822     m->Write( player->ID() );
01823     se_AppendChat( *m, message );
01824 
01825     return m;
01826 }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool se_NonHide ( ePlayerNetID const *  hider,
ePlayerNetID const *  seeker 
) [static]

Definition at line 1548 of file ePlayer.cpp.

Referenced by ePlayerNetID::FindPlayerByName().

01549 {
01550     return false;
01551 }

Here is the caller graph for this function:

static nMessage* se_OldChatMessage ( ePlayerNetID const *  player,
tString const &  message 
) [static]

Definition at line 1835 of file ePlayer.cpp.

References se_BuildChatString(), se_OldChatMessage(), and tASSERT.

01836 {
01837     tASSERT( player );
01838 
01839     return se_OldChatMessage( se_BuildChatString( player, message ) );
01840 }

Here is the call graph for this function:

static nMessage* se_OldChatMessage ( tString const &  line  )  [static]

Definition at line 1829 of file ePlayer.cpp.

References sn_ConsoleOutMessage().

Referenced by se_BroadcastChat(), se_BroadcastChatLine(), se_OldChatMessage(), se_SendPrivateMessage(), and se_SendTeamMessage().

01830 {
01831     return sn_ConsoleOutMessage( line + "\n" );
01832 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_OptionalNameFilters ( tString remoteName  )  [static]

Definition at line 4634 of file ePlayer.cpp.

References isblank(), IsLegalPlayerName(), tString::Len(), nCLIENT, se_filterColorNames, se_stripMiddle, se_StripNameEnds(), se_stripNames, and sn_GetNetState().

Referenced by ePlayerNetID::UpdateName().

04637 {
04638     // filter colors
04639     if ( se_filterColorNames )
04640     {
04641         remoteName = tColoredString::RemoveColors( remoteName );
04642     }
04643 
04644     // don't do the fancy stuff on the client, it only makes names on score tables and
04645     // console messages go out of sync.
04646     if ( sn_GetNetState() == nCLIENT )
04647         return;
04648 
04649     // strip whitespace
04650     if ( se_stripNames )
04651         se_StripNameEnds( remoteName );
04652 
04653     if ( se_stripMiddle )
04654     {
04655         // first, scan for double whitespace
04656         bool whitespace=false;
04657         int i;
04658         for ( i = 0; i < remoteName.Len()-1; ++i )
04659         {
04660             bool newWhitespace=isblank(remoteName[i]);
04661             if ( newWhitespace && whitespace )
04662             {
04663                 // yes, double whitespace there. Filter it out.
04664                 whitespace=newWhitespace=false;
04665                 tString copy;
04666                 for ( i = 0; i < remoteName.Len()-1; ++i )
04667                 {
04668                     char c = remoteName[i];
04669                     newWhitespace=isblank(c);
04670                     if ( !whitespace || !newWhitespace )
04671                     {
04672                         copy+=c;
04673                     }
04674                     whitespace=newWhitespace;
04675                 }
04676                 remoteName=copy;
04677 
04678                 // abort loop.
04679                 break;
04680             }
04681 
04682             whitespace=newWhitespace;
04683         }
04684     }
04685 
04686     // zero strings or color code only strings are illegal
04687     if ( !IsLegalPlayerName( remoteName ) )
04688     {
04689         tString oldName = remoteName;
04690 
04691         // revert to old name if possible
04692         if ( IsLegalPlayerName( oldName ) )
04693         {
04694             remoteName = oldName;
04695         }
04696         else
04697         {
04698             // or replace it by a default value
04699             // (no, not bad localization, this is only a punishment for people who think they're smart.)
04700             remoteName = "Player 1";
04701         }

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_PlayerMessageConf ( std::istream &  s  )  [static]

Definition at line 6503 of file ePlayer.cpp.

06506 {
06507     if ( se_NeedsServer( "PLAYER_MESSAGE", s ) )
06508     {
06509         return;
06510     }
06511 
06512     int receiver = se_ReadUser( s );
06513 
06514     tColoredString msg;
06515     msg.ReadLine(s);
06516 
06517     if ( receiver <= 0 || s.good() )
06518     {
06519         con << "Usage: PLAYER_MESSAGE <user ID or name> <Message>\n";
06520         return;
06521     }
06522 
06523     msg << '\n';
06524 
06525     sn_ConsoleOut(msg, 0);

static void se_RandomizeColor ( ePlayer l,
ePlayerNetID p 
) [static]

Definition at line 5363 of file ePlayer.cpp.

Referenced by ePlayerNetID::Update().

05366 {
05367     int currentRGB[3];
05368     int newRGB[3];
05369     int nullRGB[3]={0,0,0};
05370 
05371     static tReproducibleRandomizer randomizer;
05372 
05373     for( int i = 2; i >= 0; --i )
05374     {
05375         currentRGB[i] = l->rgb[i];
05376         newRGB[i] = randomizer.Get(15);
05377     }
05378 
05379     int currentMinDiff = se_ColorDistance( currentRGB, nullRGB )/2;
05380     int newMinDiff = se_ColorDistance( newRGB, nullRGB )/2;
05381 
05382     // check the minimal distance of the new random color with all players
05383     for ( int i = se_PlayerNetIDs.Len()-1; i >= 0; --i )
05384     {
05385         ePlayerNetID * other = se_PlayerNetIDs(i);
05386         if ( other != p )
05387         {
05388             int color[3] = { other->r, other->g, other->b };
05389             int currentDiff = se_ColorDistance( currentRGB, color );
05390             int newDiff     = se_ColorDistance( newRGB, color );
05391             if ( currentDiff < currentMinDiff )
05392             {
05393                 currentMinDiff = currentDiff;
05394             }
05395             if ( newDiff < newMinDiff )
05396             {
05397                 newMinDiff = newDiff;
05398             }
05399         }
05400     }
05401 
05402     // update current color
05403     if ( currentMinDiff < newMinDiff )
05404     {
05405         for( int i = 2; i >= 0; --i )
05406         {
05407             l->rgb[i] = newRGB[i];
05408         }

Here is the caller graph for this function:

static unsigned short se_ReadUser ( std::istream &  s,
ePlayerNetID requester = 0 
) [static]

Definition at line 6463 of file ePlayer.cpp.

References ePlayerNetID::FindPlayerByName(), MAXCLIENTS, nNetObject::Owner(), sn_Connections, and nConnectionInfo::socket.

06466 {
06467     // read name of player to be kicked
06468     tString name;
06469     s >> name;
06470 
06471     // try to convert it into a number and reference it as that
06472     int num;
06473     if ( name.Convert(num) && num >= 1 && num <= MAXCLIENTS && sn_Connections[num].socket )
06474     {
06475         return num;
06476     }
06477     else
06478     {
06479         // standard name lookup
06480         ePlayerNetID * p = ePlayerNetID::FindPlayerByName( name, requester );
06481         if ( p )
06482         {
06483             return p->Owner();
06484         }
06485     }
06486 

Here is the call graph for this function:

static void se_RequestLogin ( ePlayerNetID p  )  [static]

Definition at line 1369 of file ePlayer.cpp.

References ePlayerNetID::GetUserName(), tString::Len(), ePlayerNetID::loginWanted, nNetObject::Owner(), and nAuthentication::RequestLogin().

Referenced by ePlayerNetID::RequestScheduledLogins(), and se_LoginWanted().

01370 {
01371     tString userName = p->GetUserName();
01372     tString authority;
01373     if ( p->Owner() != 0 &&  p->loginWanted )
01374     {
01375 #ifdef KRAWALL_SERVER
01376         if ( p->GetRawAuthenticatedName().Len() > 1 )
01377         {
01378             nKrawall::SplitUserName( p->GetRawAuthenticatedName(), userName, authority );
01379         }
01380 
01381         p->loginWanted = 
01382         !nAuthentication::RequestLogin( authority, 
01383                                         userName, 
01384                                         *p, 
01385                                         authority.Len() > 1 ? tOutput( "$login_request", authority ) : tOutput( "$login_request_local" ) );
01386 #endif
01387     }
01388 }

Here is the call graph for this function:

Here is the caller graph for this function:

void se_rubyEval ( tString  msgCore  ) 

Definition at line 1236 of file ePlayer.cpp.

References ePlayerNetID::Chat(), tColoredString::ColorString(), tDirectories::Data(), nCLIENT, nSERVER, nSTANDALONE, ePlayer::PlayerConfig(), sn_ConsoleOut(), sn_GetNetState(), and StringValuePtr.

Referenced by se_DisplayChatLocally(), and se_DisplayChatLocallyClient().

01236                                   {
01237 #ifdef HAVE_LIBRUBY
01238     try {
01239         tRuby::Safe safe(0.3);
01240         safe.Load(tDirectories::Data(), "scripts/subbanese.rb");
01241         VALUE val = safe.Eval(msgCore);
01242         VALUE to_s = rb_funcall(val, rb_intern("to_s"), 0);
01243         tString res("result: ");
01244         res << StringValuePtr(to_s);
01245 
01246         switch (sn_GetNetState())
01247         {
01248         case nSTANDALONE:
01249         case nCLIENT:
01250             {
01251                 ePlayerNetID * me = ePlayer::PlayerConfig( 0 )->netPlayer;
01252                 me->Chat(res);
01253             }
01254             break;
01255         case nSERVER:
01256             tColoredString send;
01257             send << tColoredString::ColorString( 1,0,0 );
01258             send << "Admin";
01259             send << tColoredString::ColorString( 1,1,.5 );
01260             send << ": " << res << "\n";
01261             sn_ConsoleOut(send);
01262             break;
01263         }
01264     }
01265     catch (std::runtime_error & e) {
01266         std::cout << e.what() << '\n';
01267     }
01268     catch(...) {
01269         std::cout << "unhandled exception\n";
01270     }
01271 #endif
01272 }

Here is the call graph for this function:

Here is the caller graph for this function:

void se_SaveToLadderLog ( tOutput const &  out  ) 

writes something to ladderlog.txt

Definition at line 4920 of file ePlayer.cpp.

Referenced by gGame::Analysis(), gGame::GameLoop(), gCycle::KillAt(), ePlayerNetID::LogScoreDifference(), own_game(), gCycle::PassEdge(), and gGame::StateUpdate().

04923 {
04924     if (se_consoleLadderLog)
04925     {
04926         std::cout << "[L] " << out;
04927         std::cout.flush();
04928     }
04929     if (sn_GetNetState()!=nCLIENT && !tRecorder::IsPlayingBack())
04930     {
04931         std::ofstream o;
04932         if ( tDirectories::Var().Open(o, "ladderlog.txt", std::ios::app) )
04933             o << out;

Here is the caller graph for this function:

void se_SaveToScoreFile ( const tOutput o  ) 

writes something to scorelog.txt

Definition at line 4935 of file ePlayer.cpp.

Referenced by eTeam::AddScore(), ePlayerNetID::AddScore(), gGame::Analysis(), and gGame::StateUpdate().

04937                                          {
04938     tString s(o);
04939 
04940 #ifdef DEBUG
04941     if (sn_GetNetState()!=nCLIENT){
04942 #else
04943     if (sn_GetNetState()==nSERVER && !tRecorder::IsPlayingBack()){
04944 #endif
04945 
04946         std::ofstream o;
04947         if ( tDirectories::Var().Open(o, "scorelog.txt", std::ios::app) )
04948             o << tColoredString::RemoveColors(s);
04949     }
04950 #ifdef DEBUG
04951 }

Here is the caller graph for this function:

void se_SendPrivateMessage ( ePlayerNetID const *  sender,
ePlayerNetID const *  receiver,
ePlayerNetID const *  eavesdropper,
tString const &  message 
)

Definition at line 1891 of file ePlayer.cpp.

References tColoredString::ColorString(), nNetObject::Owner(), se_chatHandlerClient, se_chatRelay, se_NewChatMessage(), se_OldChatMessage(), se_ServerControlledChatMessage(), nMessage::Send(), nVersionFeature::Supported(), and tASSERT.

Referenced by se_ChatMsg().

01892 {
01893     tASSERT( sender );
01894     tASSERT( receiver );
01895 
01896     // determine receiver client id
01897     int cid = eavesdropper->Owner();
01898 
01899     // determine wheter the receiver knows about the server controlled chat message
01900     if ( se_chatHandlerClient.Supported( cid ) )
01901     {
01902         // send server controlled message
01903         se_ServerControlledChatMessage( sender, receiver, message )->Send( cid );
01904     }
01905     else
01906     {
01907         tColoredString say;
01908         say << tColoredString::ColorString(1,1,.5) << "( --> ";
01909         say << *receiver;
01910         say << tColoredString::ColorString(1,1,.5) << " ) ";
01911         say << message;
01912 
01913         // format message containing receiver
01914         if ( se_chatRelay.Supported( cid ) )
01915         {
01916             // send client formatted message
01917             se_NewChatMessage( sender, say )->Send( cid );
01918         }
01919         else
01920         {
01921             // send console out message
01922             se_OldChatMessage( sender, say )->Send( cid );
01923         }
01924     }
01925 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_SendTeamMember ( ePlayerNetID const *  player,
int  indent,
std::ostream &  tos 
) [static]

Definition at line 2891 of file ePlayer.cpp.

Referenced by se_ListTeam().

02893 {
02894     // send team name
02895     for( int i = indent-1; i >= 0; --i )
02896     {
02897         tos << ' ';
02898     }
02899 
02900     tos << *player << "\n";

Here is the caller graph for this function:

void se_SendTeamMessage ( eTeam const *  team,
ePlayerNetID const *  sender,
ePlayerNetID const *  receiver,
tString const &  message 
)

Definition at line 1928 of file ePlayer.cpp.

References eTeam::B(), tColoredString::ColorString(), eTeam::G(), eTeam::Name(), nNetObject::Owner(), eTeam::R(), se_chatHandlerClient, se_chatRelay, se_NewChatMessage(), se_OldChatMessage(), se_ServerControlledChatMessage(), nMessage::Send(), nVersionFeature::Supported(), and tASSERT.

Referenced by se_ChatTeam().

01929 {
01930     tASSERT( receiver );
01931     tASSERT( sender );
01932 
01933     int clientID = receiver->Owner();
01934     if ( clientID == 0 )
01935         return;
01936 
01937     if ( se_chatHandlerClient.Supported( clientID ) ) {
01938         se_ServerControlledChatMessage( team, sender, message )->Send( clientID );
01939     }
01940     else {
01941         tColoredString say;
01942         say << tColoredString::ColorString(1,1,.5) << "( " << *sender;
01943 
01944         if( !sender->CurrentTeam() )
01945         {
01946             // foo --> Spectatos: message
01947             say << tColoredString::ColorString(1,1,.5) << " --> " << tOutput("$player_spectator_message");
01948         }
01949         else if (sender->CurrentTeam() == team) {
01950             // ( foo --> Teammates ) some message here
01951             say << tColoredString::ColorString(1,1,.5) << " --> ";
01952             say << tColoredString::ColorString(team->R(),team->G(),team->B()) << tOutput("$player_team_message");;
01953         }
01954         // ( foo (Blue Team) --> Red Team ) some message
01955         else {
01956             eTeam *senderTeam = sender->CurrentTeam();
01957             say << tColoredString::ColorString(1,1,.5) << " (";
01958             say << tColoredString::ColorString(team->R(),team->G(),team->B()) << team->Name();
01959             say << tColoredString::ColorString(1,1,.5) << " ) --> ";
01960             say << tColoredString::ColorString(senderTeam->R(),senderTeam->G(),senderTeam->B()) << senderTeam->Name();
01961         }
01962         say << tColoredString::ColorString(1,1,.5) << " ) ";
01963         say << message;
01964 
01965         // format message containing receiver
01966         if ( se_chatRelay.Supported( clientID ) )
01967             // send client formatted message
01968             se_NewChatMessage( sender, say )->Send( clientID );
01969         else
01970             // send console out message
01971             se_OldChatMessage( sender, say )->Send( clientID );
01972     }
01973 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_SendTo ( std::string const &  message,
ePlayerNetID receiver 
) [static]

Definition at line 2878 of file ePlayer.cpp.

References con, nNetObject::Owner(), and sn_ConsoleOut().

Referenced by se_ListPlayers(), se_ListTeam(), and se_ListTeams().

02880 {
02881     if ( receiver )
02882     {
02883         sn_ConsoleOut(message.c_str(), receiver->Owner());
02884     }
02885     else
02886     {
02887         con << message;
02888     }

Here is the call graph for this function:

Here is the caller graph for this function:

static nMessage* se_ServerControlledChatMessage ( eTeam const *  team,
ePlayerNetID const *  sender,
tString const &  message 
) [static]

Definition at line 1809 of file ePlayer.cpp.

References se_BuildChatString(), se_ServerControlledChatMessageConsole(), and tASSERT.

01810 {
01811     tASSERT( sender );
01812 
01813     return se_ServerControlledChatMessageConsole( sender, se_BuildChatString(team, sender, message) );
01814 }

Here is the call graph for this function:

static nMessage* se_ServerControlledChatMessage ( ePlayerNetID const *  sender,
ePlayerNetID const *  receiver,
tString const &  message 
) [static]

Definition at line 1800 of file ePlayer.cpp.

References se_BuildChatString(), se_ServerControlledChatMessageConsole(), and tASSERT.

01801 {
01802     tASSERT( sender );
01803     tASSERT( receiver );
01804 
01805     return se_ServerControlledChatMessageConsole( sender, se_BuildChatString( sender, receiver, message ) );
01806 }

Here is the call graph for this function:

static nMessage* se_ServerControlledChatMessage ( ePlayerNetID const *  sender,
tString const &  message 
) [static]

Definition at line 1792 of file ePlayer.cpp.

References se_BuildChatString(), se_ServerControlledChatMessageConsole(), and tASSERT.

Referenced by se_BroadcastChat(), se_SendPrivateMessage(), and se_SendTeamMessage().

01793 {
01794     tASSERT( sender );
01795 
01796     return se_ServerControlledChatMessageConsole( sender, se_BuildChatString( sender, message ) );
01797 }

Here is the call graph for this function:

Here is the caller graph for this function:

static nMessage* se_ServerControlledChatMessageConsole ( ePlayerNetID const *  player,
tString const &  toConsole 
) [static]

Definition at line 1779 of file ePlayer.cpp.

References chat_handler_client, nNetObject::ID(), tASSERT, tNEW, and nMessage::Write().

Referenced by se_BroadcastChatLine(), and se_ServerControlledChatMessage().

01780 {
01781     tASSERT( player );
01782 
01783     nMessage *m=tNEW(nMessage) (chat_handler_client);
01784 
01785     m->Write( player->ID() );
01786     *m << toConsole;
01787 
01788     return m;
01789 }

Here is the call graph for this function:

Here is the caller graph for this function:

void se_SetShowScoresAuto ( bool  a  ) 

Definition at line 5906 of file ePlayer.cpp.

Referenced by do_chat(), and do_con().

05908                                  {

Here is the caller graph for this function:

static void se_StripMatchingEnds ( tString stripper,
TestCharacter beginTester,
TestCharacter endTester 
) [static]

Definition at line 4543 of file ePlayer.cpp.

References tString::Len(), tString::Size(), and tString::SubStr().

Referenced by ePlayerNetID::FilterName(), and se_StripNameEnds().

04546 {
04547     int len = stripper.Size() - 1;
04548     int first = 0, last = len;
04549 
04550     // eat whitespace from beginnig and end
04551     while ( first < len && beginTester( stripper[first] ) ) ++first;
04552     while ( last > 0 && ( !stripper[last] || endTester(stripper[last] ) ) ) --last;
04553 
04554     // strip everything?
04555     if ( first > last )
04556     {
04557         stripper = "";
04558         return;
04559     }
04560 
04561     // strip
04562     if ( first > 0 || last < stripper.Len() - 1 )

Here is the call graph for this function:

Here is the caller graph for this function:

static void se_StripNameEnds ( tString name  )  [static]

Definition at line 4584 of file ePlayer.cpp.

References se_IsBlank(), se_IsInvalidNameEnd(), and se_StripMatchingEnds().

Referenced by se_OptionalNameFilters().

04587 {

Here is the call graph for this function:

Here is the caller graph for this function:

static tString se_UnauthenticatedUserName ( tString const &  name  )  [static]

Definition at line 249 of file ePlayer.cpp.

References ePlayerNetID::FilterName(), se_EscapeName(), and se_legacyLogNames.

Referenced by ePlayerNetID::UpdateName().

00250 {
00251     tString ret;
00252     ePlayerNetID::FilterName( name, ret );
00253     if ( se_legacyLogNames )
00254     {
00255         return ret;
00256     }
00257     else
00258     {
00259         return tString( se_EscapeName( ret, false ).c_str() );
00260     }
00261 }

Here is the call graph for this function:

Here is the caller graph for this function:

static const tString& se_UserName (  )  [static]

Definition at line 1032 of file ePlayer.cpp.

References NULL, and se_UserNameHelper().

Referenced by ePlayer::ePlayer().

01033 {
01034     srand( (unsigned)time( NULL ) );
01035 
01036     static tString ret( se_UserNameHelper() );
01037     return ret;
01038 }

Here is the call graph for this function:

Here is the caller graph for this function:

static char const* se_UserNameHelper (  )  [static]

Definition at line 1026 of file ePlayer.cpp.

Referenced by se_UserName().

01027 {
01028     return getenv( "USER" );
01029 }

Here is the caller graph for this function:

void se_UserShowScores ( bool  show  ) 

Definition at line 5902 of file ePlayer.cpp.

References show_scores.

Referenced by gGame::StateUpdate().

05904                                  {

Here is the caller graph for this function:

static bool se_VisibleSpectatorsSupported (  )  [static]

Definition at line 5314 of file ePlayer.cpp.

Referenced by ePlayerNetID::SpectateAll(), and ePlayerNetID::Update().

05317 {
05318     static nVersionFeature se_visibleSpectator(13);

Here is the caller graph for this function:

static void se_WantLogin ( ePlayer lp  )  [static]

Definition at line 1316 of file ePlayer.cpp.

References ePlayer::globalID, nCLIENT, se_loginWanted, nMessage::Send(), sn_GetNetState(), nVersionFeature::Supported(), and tASSERT.

Referenced by ePlayer::LogIn(), and ePlayer::SendAuthNames().

01317 {
01318     // only meaningful on client
01319     if( sn_GetNetState() != nCLIENT )
01320     {
01321         return;
01322     }
01323 
01324     // don't send if the server won't understand anyway
01325     static nVersionFeature authentication( 15 );
01326     if( !authentication.Supported(0) )
01327     {
01328         return;
01329     }
01330 
01331     tASSERT(lp);
01332     ePlayerNetID *p = lp->netPlayer;
01333     if ( !p )
01334     {
01335         return;
01336     }
01337     
01338     nMessage *m = new nMessage( se_loginWanted );
01339 
01340     // write player
01341     *m << p;
01342     
01343     // write flag and name
01344     *m << p->loginWanted;
01345 
01346     // write authentication name
01347     *m << lp->globalID;
01348 
01349     m->Send( 0 );
01350 
01351     // reset flag
01352     p->loginWanted = false;
01353 }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool sf ( REAL  x  )  [static]

Definition at line 5938 of file ePlayer.cpp.

References show_scores.

05940                       {
05941     if (x>0) show_scores = !show_scores;

static void sg_ClampPingCharity (  )  [static]

Definition at line 3691 of file ePlayer.cpp.

03694 {

static void sg_ClampPingCharity ( unsigned short &  pingCharity  )  [static]

Definition at line 3685 of file ePlayer.cpp.

03688 {
03689     if (pingCharity > maxPingCharity )

static void sg_ClampPingCharity ( int &  pingCharity  )  [static]

Definition at line 3677 of file ePlayer.cpp.

References maxPingCharity.

Referenced by ePlayerNetID::Update().

03680 {
03681     if (pingCharity < 0 )
03682         pingCharity = 0;
03683     if (pingCharity > maxPingCharity )

Here is the caller graph for this function:

static void Silence_conf ( std::istream &  s  )  [static]

Definition at line 6740 of file ePlayer.cpp.

06743 {
06744     if ( se_NeedsServer( "SILENCE", s ) )
06745     {
06746         return;
06747     }
06748 
06749     ePlayerNetID * p = ReadPlayer( s );
06750     if ( p )
06751     {
06752         sn_ConsoleOut( tOutput( "$player_silenced", p->GetName() ) );
06753         p->SetSilenced( true );

static void Suspend_conf ( std::istream &  s  )  [static]

Definition at line 6723 of file ePlayer.cpp.

06726 {

static void Suspend_conf_base ( std::istream &  s,
int  rounds 
) [static]

Definition at line 6703 of file ePlayer.cpp.

Referenced by UnSuspend_conf().

06706 {
06707     if ( se_NeedsServer( "SUSPEND", s, false ) )
06708     {
06709         return;
06710     }
06711 
06712     ePlayerNetID * p = ReadPlayer( s );
06713 
06714     if ( rounds > 0 )
06715     {
06716         s >> rounds;
06717     }
06718         
06719     if ( p )
06720     {
06721         p->Suspend( rounds );

Here is the caller graph for this function:

tCONFIG_ENUM ( eCamMode   ) 

static void teams_conf ( std::istream &  s  )  [static]

Definition at line 2959 of file ePlayer.cpp.

References se_ListTeams().

02961 {
02962     se_ListTeams( 0 );

Here is the call graph for this function:

static bool tr (  )  [static]

Definition at line 420 of file ePlayer.cpp.

Referenced by PasswordCallback().

00420 {return true;}

Here is the caller graph for this function:

static void UnSuspend_conf ( std::istream &  s  )  [static]

Definition at line 6729 of file ePlayer.cpp.

References Suspend_conf_base().

06732 {

Here is the call graph for this function:

static void Voice_conf ( std::istream &  s  )  [static]

Definition at line 6758 of file ePlayer.cpp.

06761 {
06762     if ( se_NeedsServer( "VOICE", s ) )
06763     {
06764         return;
06765     }
06766 
06767     ePlayerNetID * p = ReadPlayer( s );
06768     if ( p )
06769     {
06770         sn_ConsoleOut( tOutput( "$player_voiced", p->GetName() ) );
06771         p->SetSilenced( false );


Variable Documentation

bool ass = true [static]

Definition at line 5894 of file ePlayer.cpp.

Referenced by se_AutoShowScores().

rCenterDisplayCallback c_d& cd [static]

Definition at line 5946 of file ePlayer.cpp.

Referenced by gGame::GameLoop().

nDescriptor chat_handler(200, handle_chat,"Chat") [static]

Referenced by se_NewChatMessage().

nDescriptor chat_handler_client(203, handle_chat_client,"Chat Client") [static]

Referenced by se_ServerControlledChatMessageConsole().

tConfItemFunc ConsoleSay_c("SAY",&ConsoleSay_conf) [static]

char const* default_instant_chat[] [static]

Initial value:

    {"/team \\",
     "/msg \\",
     "/me \\",
     "LOL!",
     "/team 1 Yes Oui Ja",
     "/team 0 No Non Nein",
     "/team I'm going in!",
     "Give the rim a break; hug a tree instead.",
     "Lag is a myth. It is only in your brain.",
     "Rubber kills gameplay!",
     "Every time you double bind, God kills a kitten.",
     "http://www.armagetronad.net",
     "Only idiots keep their instant chat at default values.",
     "/me wanted to download pr0n, but only got this stupid game.",
     "Speed for weaks!",
     "This server sucks! I'm going home.",
     "Grind EVERYTHING! And 180 some more!",
     "/me has an interesting mental disorder.",
     "Ah, a nice, big, roomy box all for me!",
     "Go that way! No, the other way!",
     "WD! No points!",
     "/me is a noob.",
     "/me just installed this game and still doesn't know how to talk.",
     "/team You all suck, I want a new team.",
     "Are you the real \"Player 1\"?",
     "0x5aff91Only idiots0xffa962 write in0xc560ff color all0x87dfff the time!",
     NULL}

Definition at line 957 of file ePlayer.cpp.

Referenced by ePlayer::ePlayer().

nNOInitialisator<ePlayerNetID> ePlayerNetID_init(201,"ePlayerNetID")

rSmallConsoleCallback sc& force_small_cons [static]

Definition at line 5927 of file ePlayer.cpp.

int IMPOSSIBLY_LOW_SCORE = (-1 << 31) [static]

Definition at line 3696 of file ePlayer.cpp.

Referenced by ePlayerNetID::ePlayerNetID(), and ePlayerNetID::LogScoreDifference().

tConfItemFunc kill_conf("KILL",&Kill_conf) [static]

const int maxPingCharity = 300 [static]

Definition at line 3675 of file ePlayer.cpp.

Referenced by sg_ClampPingCharity().

const unsigned short NEW_TEAM = 1

Definition at line 6249 of file ePlayer.cpp.

Referenced by ePlayerNetID::CreateNewTeamWish(), and ePlayerNetID::ReceiveControlNet().

int pingCharity = 100

Definition at line 3674 of file ePlayer.cpp.

Referenced by net_options().

nDescriptor player_removed_from_game(202,&player_removed_from_game_handler,"player_removed_from_game") [static]

tConfItemFunc players("PLAYERS",&players_conf) [static]

Referenced by gGame::Analysis(), do_chat(), gServerMenuItem::RenderBackground(), and ePlayerNetID::Update().

tConfItem<int> pws("PASSWORD_STORAGE","$password_storage_help", se_PasswordStorageMode) [static]

tArray<PasswordStorage> S_passwords [static]

Definition at line 131 of file ePlayer.cpp.

Referenced by PasswordCallback().

static uActionGlobalFunc saf & score [static]

Definition at line 5943 of file ePlayer.cpp.

Referenced by eGrid::DrawLine(), eGrid::FindSurroundingFace(), eGameObject::Move(), gBaseZoneHack::OnConquest(), and gServerMenuItem::Render().

rPerFrameTask pf& scores [static]

Definition at line 5921 of file ePlayer.cpp.

bool se_allowControlDuringChat = false [static]

Definition at line 3524 of file ePlayer.cpp.

nSettingItem<bool> se_allowControlDuringChatConf("ALLOW_CONTROL_DURING_CHAT", se_allowControlDuringChat) [static]

bool se_allowEnemiesSameClient = false [static]

Definition at line 7237 of file ePlayer.cpp.

Referenced by ePlayerNetID::Enemies().

tSettingItem< bool > se_allowEnemiesSameClientConf("ALLOW_ENEMIES_SAME_CLIENT", se_allowEnemiesSameClient) [static]

bool se_allowEnemiesSameIP = false [static]

Definition at line 7234 of file ePlayer.cpp.

Referenced by ePlayerNetID::Enemies().

tSettingItem< bool > se_allowEnemiesSameIPConf("ALLOW_ENEMIES_SAME_IP", se_allowEnemiesSameIP) [static]

bool se_allowImposters = false [static]

Definition at line 4622 of file ePlayer.cpp.

Referenced by ePlayerNetID::UpdateName().

tSettingItem< bool > se_allowImposters1("ALLOW_IMPOSTERS", se_allowImposters) [static]

tSettingItem< bool > se_allowImposters2("ALLOW_IMPOSTORS", se_allowImposters) [static]

bool se_allowShuffleUp = false [static]

Definition at line 2550 of file ePlayer.cpp.

Referenced by se_ChatShuffle().

tSettingItem<bool> se_allowShuffleUpConf("TEAM_ALLOW_SHUFFLE_UP", se_allowShuffleUp) [static]

bool se_allowTeamChanges = true [static]

Definition at line 105 of file ePlayer.cpp.

Referenced by ePlayerNetID::TeamChangeAllowed().

tSettingItem< bool > se_allowTeamChangesConf("ALLOW_TEAM_CHANGE", se_allowTeamChanges) [static]

tConfItemFunc se_allowTeamChangesPlayerConf("ALLOW_TEAM_CHANGE_PLAYER",&se_allowTeamChangesPlayer) [static]

REAL se_alreadySaidTimeout = 5.0 [static]

Definition at line 2544 of file ePlayer.cpp.

Referenced by eChatSpamTester::Check().

tSettingItem<REAL> se_alreadySaidTimeoutConf("SPAM_PROTECTION_REPEAT", se_alreadySaidTimeout) [static]

bool se_assignTeamAutomatically = true

Definition at line 102 of file ePlayer.cpp.

Referenced by ePlayerNetID::ReceiveControlNet(), se_ChatTeamLeave(), ePlayerNetID::SetDefaultTeam(), ePlayerNetID::SetTeamWish(), and ePlayerNetID::Update().

tSettingItem< bool > se_assignTeamAutomaticallyConf("AUTO_TEAM", se_assignTeamAutomatically) [static]

tAccessLevelSetter se_atcConfLevel(se_allowTeamChangesPlayerConf, tAccessLevel_TeamLeader) [static]

tConfItemFunc se_banConf("BAN",&se_BanConf) [static]

tAccessLevelSetter se_banConfLevel(se_banConf, tAccessLevel_Moderator) [static]

bool se_bugColorOverflow = true [static]

Definition at line 4531 of file ePlayer.cpp.

tSettingItem< bool > se_bugColorOverflowColor("BUG_COLOR_OVERFLOW", se_bugColorOverflow)

tAccessLevel se_chatAccessLevel = tAccessLevel_Program [static]

Definition at line 2564 of file ePlayer.cpp.

Referenced by eChatSpamTester::Check().

tSettingItem< tAccessLevel > se_chatAccessLevelConf("ACCESS_LEVEL_CHAT", se_chatAccessLevel) [static]

nVersionFeature se_chatHandlerClient(6) [static]

todo: lower this number or increase network version before next release

Referenced by se_BroadcastChat(), se_BroadcastChatLine(), se_SendPrivateMessage(), and se_SendTeamMessage().

int se_chatHistoryMaxSize = 10 [static]

Definition at line 3375 of file ePlayer.cpp.

tSettingItem< int > se_chatHistoryMaxSizeConf("HISTORY_SIZE_CHAT", se_chatHistoryMaxSize) [static]

nVersionFeature se_chatRelay(3) [static]

Referenced by se_BroadcastChat(), se_BroadcastChatLine(), se_SendPrivateMessage(), and se_SendTeamMessage().

REAL se_chatRequestTimeout = 60

Definition at line 2568 of file ePlayer.cpp.

Referenced by eChatSpamTester::Check().

tSettingItem< REAL > se_chatRequestTimeoutConf("ACCESS_LEVEL_CHAT_TIMEOUT", se_chatRequestTimeout) [static]

nSpamProtectionSettings se_chatSpamSettings(1.0f,"SPAM_PROTECTION_CHAT", tOutput("$spam_protection")) [static]

ePlayer* se_chatter = NULL [static]

Definition at line 3473 of file ePlayer.cpp.

Referenced by do_chat().

ePlayer* se_chatterPlanned = NULL [static]

Definition at line 3472 of file ePlayer.cpp.

Referenced by do_chat().

REAL se_chatterRemoveTime = 180.0 [static]

Definition at line 5769 of file ePlayer.cpp.

Referenced by ePlayerNetID::RemoveChatbots().

tSettingItem< REAL > se_chatterRemoveTimeConf("CHATTER_REMOVE_TIME", se_chatterRemoveTime) [static]

tSettingItem< bool > se_coloredNamesConf("FILTER_COLOR_NAMES", se_filterColorNames)

bool se_consoleLadderLog = false [static]

Definition at line 4917 of file ePlayer.cpp.

tSettingItem< bool > se_consoleLadderLogConf("CONSOLE_LADDER_LOG", se_consoleLadderLog) [static]

tString se_defaultKickReason("") [static]

tConfItemLine se_defaultKickReasonConf("DEFAULT_KICK_REASON", se_defaultKickReason) [static]

int se_defaultKickToPort = 4534 [static]

Definition at line 6563 of file ePlayer.cpp.

tSettingItem< int > se_defaultKickToPortConf("DEFAULT_KICK_TO_PORT", se_defaultKickToPort) [static]

tString se_defaultKickToReason("") [static]

tConfItemLine se_defaultKickToReasonConf("DEFAULT_KICK_TO_REASON", se_defaultKickToReason) [static]

tString se_defaultKickToServer("") [static]

tSettingItem< tString > se_defaultKickToServerConf("DEFAULT_KICK_TO_SERVER", se_defaultKickToServer) [static]

tConfItemFunc se_disallowTeamChangesPlayerConf("DISALLOW_TEAM_CHANGE_PLAYER",&se_disallowTeamChangesPlayer) [static]

tAccessLevelSetter se_dtcConfLevel(se_disallowTeamChangesPlayerConf, tAccessLevel_TeamLeader) [static]

bool se_enableChat = true [static]

Definition at line 108 of file ePlayer.cpp.

Referenced by IsSilencedWithWarning(), se_DisplayChatLocally(), and se_DisplayChatLocallyClient().

bool se_enableNameHilighting = true [static]

Definition at line 1443 of file ePlayer.cpp.

Referenced by se_DisplayChatLocallyClient().

tSettingItem< bool > se_enableNameHilightingConf("ENABLE_NAME_HILIGHTING", se_enableNameHilighting) [static]

tSettingItem<bool> se_enaChat("ENABLE_CHAT", se_enableChat) [static]

bool se_filterColorNames = false [static]

Definition at line 4626 of file ePlayer.cpp.

Referenced by se_OptionalNameFilters().

tString se_helpMessage("") [static]

tConfItemLine se_helpMessageConf("HELP_MESSAGE", se_helpMessage) [static]

REAL se_idleKickTime = 0 [static]

Definition at line 5777 of file ePlayer.cpp.

Referenced by ePlayerNetID::RemoveChatbots().

tSettingItem< REAL > se_idleKickTimeConf("IDLE_KICK_TIME", se_idleKickTime) [static]

REAL se_idleRemoveTime = 0 [static]

Definition at line 5773 of file ePlayer.cpp.

Referenced by ePlayerNetID::RemoveChatbots().

tSettingItem< REAL > se_idleRemoveTimeConf("IDLE_REMOVE_TIME", se_idleRemoveTime) [static]

tAccessLevel se_ipAccessLevel = tAccessLevel_Moderator [static]

Definition at line 2580 of file ePlayer.cpp.

Referenced by se_ListPlayers().

tSettingItem< tAccessLevel > se_ipAccessLevelConf("ACCESS_LEVEL_IPS", se_ipAccessLevel) [static]

tConfItemFunc se_kickConf("KICK",&se_KickConf) [static]

tAccessLevelSetter se_kickConfLevel(se_kickConf, tAccessLevel_Moderator) [static]

tConfItemFunc se_kickToConf("KICK_TO",&se_KickToConf) [static]

tAccessLevelSetter se_kickToConfLevel(se_kickToConf, tAccessLevel_Moderator) [static]

tAccessLevelSetter se_killConfLevel(kill_conf, tAccessLevel_Moderator) [static]

bool se_legacyLogNames = false

Definition at line 138 of file ePlayer.cpp.

Referenced by se_UnauthenticatedUserName(), and ePlayerNetID::UpdateName().

nCallbackLoginLogout se_legacySpectatorClearer(se_LegacySpectatorClearer) [static]

tJUST_CONTROLLED_PTR< ePlayerNetID > se_legacySpectators[MAXCLIENTS+2] [static]

Definition at line 3835 of file ePlayer.cpp.

Referenced by se_ClearLegacySpectator().

tSettingItem<bool> se_llnConf("LEGACY_LOG_NAMES", se_legacyLogNames) [static]

nDescriptor se_loginWanted(204, se_LoginWanted,"AuthWanted") [static]

Referenced by se_WantLogin().

int se_maxPlayersPerIP = 4 [static]

Definition at line 3830 of file ePlayer.cpp.

Referenced by ePlayerNetID::MyInitAfterCreation().

tSettingItem<int> se_maxPlayersPerIPConf("MAX_PLAYERS_SAME_IP", se_maxPlayersPerIP) [static]

tAccessLevelSetter se_messConfLevel(se_PlayerMessage_c, tAccessLevel_Moderator) [static]

tAccessLevelSetter se_moveConfLevel(se_moveToConf, tAccessLevel_Moderator) [static]

tConfItemFunc se_moveToConf("MOVE_TO",&se_MoveToConf) [static]

tAccessLevel se_msgSpyAccessLevel = tAccessLevel_Owner [static]

Definition at line 2576 of file ePlayer.cpp.

Referenced by se_ChatMsg().

tSettingItem< tAccessLevel > se_msgSpyAccessLevelConf("ACCESS_LEVEL_SPY_MSG", se_msgSpyAccessLevel) [static]

tConfItemPassword se_p [static]

Definition at line 354 of file ePlayer.cpp.

int se_PasswordStorageMode = 0

Definition at line 423 of file ePlayer.cpp.

int se_pingCharityMax = 500 [static]

Definition at line 5413 of file ePlayer.cpp.

Referenced by ePlayerNetID::Update().

tSettingItem<int> se_pingCharityMaxConf("PING_CHARITY_MAX", se_pingCharityMax) [static]

int se_pingCharityMin = 0 [static]

Definition at line 5413 of file ePlayer.cpp.

Referenced by ePlayerNetID::Update().

tSettingItem<int> se_pingCharityMinConf("PING_CHARITY_MIN", se_pingCharityMin) [static]

nSettingItem<int> se_pingCharityServerConf("PING_CHARITY_SERVER", sn_pingCharityServer) [static]

Referenced by ePlayerNetID::Update().

nVersionFeature se_pingCharityServerControlled(14) [static]

Referenced by ePlayerNetID::Update().

tConfItemFunc se_PlayerMessage_c("PLAYER_MESSAGE",&se_PlayerMessageConf) [static]

tList<ePlayerNetID> se_PlayerNetIDs

Definition at line 99 of file ePlayer.cpp.

Referenced by gGame::Analysis(), BestIQ(), CompareBufferToPlayerNames(), do_chat(), eVoteItem::Evaluate(), exit_game_objects(), gAIPlayer::gAIPlayer(), GameLoop(), gGame::GameLoop(), gServerInfoAdmin::GetUsers(), eVoter::GetVoter(), init_game_objects(), eVoter::KickMenu(), ePlayerNetID::LogScoreDifferences(), main(), eVoter::Name(), PrepareTeamText(), ePlayerNetID::Ranking(), ePlayerNetID::RemoveChatbots(), ePlayerNetID::RequestScheduledLogins(), ePlayerNetID::ResetScoreDifferences(), se_ChatMsg(), se_ChatTeam(), se_GetAccessLevel(), se_GetAlivePlayerFromUserID(), se_IsNameTaken(), se_ListPlayers(), se_SetWatchedObject(), zSelectorAnotherNotTeammateDead::select(), zSelectorAllDead::select(), zSelectorAnyDead::select(), zSelectorAnother::select(), zSelectorAllButSelf::select(), zSelectorAll::select(), gAIPlayer::SetNumberOfAIs(), cCockpit::SetPlayer(), sg_FullscreenMessage(), sg_NumHumans(), ePlayerNetID::SortByScore(), stc_updateFastest(), ePlayerNetID::SwapPlayersNo(), ePlayerNetID::Update(), ePlayerNetID::WaitToLeaveChat(), and eTeam::~eTeam().

tReferenceHolder< ePlayerNetID > se_PlayerReferences [static]

Definition at line 111 of file ePlayer.cpp.

ePlayer* se_Players = NULL [static]

Definition at line 100 of file ePlayer.cpp.

REAL se_playerWaitFraction = .05f [static]

Definition at line 5657 of file ePlayer.cpp.

Referenced by ePlayerNetID::WaitToLeaveChat().

tSettingItem< REAL > se_playerWaitFractionConf("PLAYER_CHAT_WAIT_FRACTION", se_playerWaitFraction) [static]

REAL se_playerWaitMax = 10.0f [static]

Definition at line 5653 of file ePlayer.cpp.

Referenced by ePlayerNetID::WaitToLeaveChat().

tSettingItem< REAL > se_playerWaitMaxConf("PLAYER_CHAT_WAIT_MAX", se_playerWaitMax) [static]

bool se_playerWaitSingle = false [static]

Definition at line 5661 of file ePlayer.cpp.

Referenced by ePlayerNetID::WaitToLeaveChat().

tSettingItem< bool > se_playerWaitSingleConf("PLAYER_CHAT_WAIT_SINGLE", se_playerWaitSingle) [static]

bool se_playerWaitTeamleader = true [static]

Definition at line 5665 of file ePlayer.cpp.

Referenced by ePlayerNetID::WaitToLeaveChat().

tSettingItem< bool > se_playerWaitTeamleaderConf("PLAYER_CHAT_WAIT_TEAMLEADER", se_playerWaitTeamleader) [static]

bool se_randomizeColor = true

Definition at line 5360 of file ePlayer.cpp.

Referenced by ePlayerNetID::Update().

tSettingItem< bool > se_randomizeColorConf("PLAYER_RANDOM_COLOR", se_randomizeColor) [static]

tString se_say [static]

Definition at line 3474 of file ePlayer.cpp.

Referenced by do_chat().

tSettingItem<bool> se_silAll("SILENCE_ALL", se_silenceAll) [static]

bool se_silenceAll = false [static]

Definition at line 2561 of file ePlayer.cpp.

Referenced by IsSilencedWithWarning(), and ePlayerNetID::MyInitAfterCreation().

tAccessLevelSetter se_silenceConfLevel(silence_conf, tAccessLevel_Moderator) [static]

tSettingItem< bool > se_stripConf("FILTER_NAME_ENDS", se_stripNames)

bool se_stripMiddle = true [static]

Definition at line 4630 of file ePlayer.cpp.

Referenced by se_OptionalNameFilters().

tSettingItem< bool > se_stripMiddleConf("FILTER_NAME_MIDDLE", se_stripMiddle)

bool se_stripNames = true [static]

Definition at line 4628 of file ePlayer.cpp.

Referenced by se_OptionalNameFilters().

tAccessLevelSetter se_suspendConfLevel(suspend_conf, tAccessLevel_Moderator) [static]

tAccessLevel se_teamSpyAccessLevel = tAccessLevel_Moderator [static]

Definition at line 2572 of file ePlayer.cpp.

Referenced by se_ChatTeam().

tSettingItem< tAccessLevel > se_teamSpyAccessLevelConf("ACCESS_LEVEL_SPY_TEAM", se_teamSpyAccessLevel) [static]

uActionPlayer se_toggleSpectator("TOGGLE_SPECTATOR", 0)

tAccessLevelSetter se_unsuspendConfLevel(unsuspend_conf, tAccessLevel_Moderator) [static]

tAccessLevelSetter se_voiceConfLevel(voice_conf, tAccessLevel_Moderator) [static]

tString sg_adminPass("NONE") [static]

tConfItemLine sg_adminPassConf("ADMIN_PASS", sg_adminPass) [static]

tString sg_options("Nothing special.") [static]

gServerInfoAdmin sg_serverAdmin [static]

Definition at line 6819 of file ePlayer.cpp.

tString sg_url [static]

Definition at line 6776 of file ePlayer.cpp.

tSettingItem< tString > sg_urlConf("URL", sg_url) [static]

bool show_scores = false [static]

Definition at line 5893 of file ePlayer.cpp.

Referenced by scores(), se_AutoShowScores(), se_UserShowScores(), and sf().

tConfItemFunc silence_conf("SILENCE",&Silence_conf) [static]

tConfItemFunc suspend_conf("SUSPEND",&Suspend_conf) [static]

const unsigned short TEAMCHANGE = 0

Definition at line 6248 of file ePlayer.cpp.

Referenced by ePlayerNetID::ReceiveControlNet(), and ePlayerNetID::SetTeamWish().

tConfItemFunc teams("TEAMS",&teams_conf) [static]

tConfItemFunc unsuspend_conf("UNSUSPEND",&UnSuspend_conf) [static]

tConfItemFunc voice_conf("VOICE",&Voice_conf) [static]

tConfItemBase* vpbtp[MAX_VIEWPORTS] [static]

Definition at line 3628 of file ePlayer.cpp.

Referenced by ePlayer::Init().


Generated on Sat Mar 15 22:58:28 2008 for Armagetron Advanced by  doxygen 1.5.4