3#ifndef ENGINE_SHARED_CONSOLE_H
4#define ENGINE_SHARED_CONSOLE_H
64 void ExecuteLineStroked(
int Stroke,
const char *pStr,
int ClientId = -1,
bool InterpretSemicolons =
true)
override;
102 for(
unsigned i = 0; i < Other.
m_NumArgs; ++i)
111 const char *
GetString(
unsigned Index)
const override;
112 int GetInteger(
unsigned Index)
const override;
113 float GetFloat(
unsigned Index)
const override;
114 std::optional<ColorHSLA>
GetColor(
unsigned Index,
float DarkestLighting)
const override;
119 for(
unsigned i = Index; i <
m_NumArgs - 1; i++)
152 int ParseArgs(CResult *pResult,
const char *pFormat,
bool IsColor =
false);
182 void Init()
override;
187 void ParseArguments(
int NumArgs,
const char **ppArguments)
override;
188 void Register(
const char *pName,
const char *pParams,
int Flags,
FCommandCallback pfnFunc,
void *pUser,
const char *pHelp)
override;
189 void RegisterTemp(
const char *pName,
const char *pParams,
int Flags,
const char *pHelp)
override;
196 void ExecuteLine(
const char *pStr,
int ClientId = -1,
bool InterpretSemicolons =
true)
override;
197 void ExecuteLineFlag(
const char *pStr,
int FlagMask,
int ClientId = -1,
bool InterpretSemicolons =
true)
override;
FCommandCallback m_pfnCallback
Definition: console.h:32
void * m_pUserData
Definition: console.h:34
void * m_pCallbackUserData
Definition: console.h:33
FChainCommandCallback m_pfnChainCallback
Definition: console.h:31
const CCommandInfo * NextCommandInfo(int AccessLevel, int FlagMask) const override
Definition: console.cpp:86
void SetAccessLevel(int AccessLevel)
Definition: console.h:25
CCommand * m_pNext
Definition: console.h:17
void * m_pUserData
Definition: console.h:21
bool m_Temp
Definition: console.h:19
FCommandCallback m_pfnCallback
Definition: console.h:20
int m_Flags
Definition: console.h:18
CExecFile * m_pPrev
Definition: console.h:46
const char * m_pFilename
Definition: console.h:45
Definition: console.h:163
CCommand * m_pCommand
Definition: console.h:165
CExecutionQueueEntry(CCommand *pCommand, CResult Result)
Definition: console.h:167
CResult m_Result
Definition: console.h:166
float GetFloat(unsigned Index) const override
Definition: console.cpp:36
const char * m_apArgs[MAX_PARTS]
Definition: console.h:85
void AddArgument(const char *pArg)
Definition: console.h:106
void RemoveArgument(unsigned Index) override
Definition: console.h:116
CResult(const CResult &Other)
Definition: console.h:96
CResult(int ClientId)
Definition: console.h:87
void SetVictim(int Victim)
Definition: console.cpp:1070
char m_aStringStorage[CONSOLE_MAX_STR_LENGTH+1]
Definition: console.h:81
int m_Victim
Definition: console.h:134
char * m_pArgsStart
Definition: console.h:82
bool HasVictim() const
Definition: console.cpp:1065
void ResetVictim()
Definition: console.cpp:1060
int GetVictim() const override
Definition: console.cpp:1055
@ VICTIM_ALL
Definition: console.h:131
@ VICTIM_ME
Definition: console.h:130
@ VICTIM_NONE
Definition: console.h:129
std::optional< ColorHSLA > GetColor(unsigned Index, float DarkestLighting) const override
Definition: console.cpp:43
const char * m_pCommand
Definition: console.h:84
int GetInteger(unsigned Index) const override
Definition: console.cpp:29
const char * GetString(unsigned Index) const override
Definition: console.cpp:22
static void ConUserCommandStatus(IConsole::IResult *pResult, void *pUser)
Definition: console.cpp:751
void ParseArguments(int NumArgs, const char **ppArguments) override
Definition: console.cpp:832
const CCommandInfo * FirstCommandInfo(int AccessLevel, int FlagMask) const override
Definition: console.cpp:98
~CConsole()
Definition: console.cpp:802
void SetFlagMask(int FlagMask) override
Definition: console.h:214
void DeregisterTempAll() override
Definition: console.cpp:973
bool m_Cheated
Definition: console.h:176
static void Con_Echo(IResult *pResult, void *pUserData)
Definition: console.cpp:675
FTeeHistorianCommandCallback m_pfnTeeHistorianCommandCallback
Definition: console.h:66
void StoreCommands(bool Store) override
Definition: console.cpp:1026
bool Cheated() const override
Definition: console.h:211
bool m_StoreCommands
Definition: console.h:38
void SetAccessLevel(int AccessLevel) override
Definition: console.h:205
void Init() override
Definition: console.cpp:827
void SetUnknownCommandCallback(FUnknownCommandCallback pfnCallback, void *pUser) override
Definition: console.cpp:348
void Register(const char *pName, const char *pParams, int Flags, FCommandCallback pfnFunc, void *pUser, const char *pHelp) override
Definition: console.cpp:880
void AddCommandSorted(CCommand *pCommand)
Definition: console.cpp:856
CCommand * m_pFirstCommand
Definition: console.h:40
void ExecuteLineStroked(int Stroke, const char *pStr, int ClientId=-1, bool InterpretSemicolons=true) override
Definition: console.cpp:420
void * m_pUnknownCommandUserdata
Definition: console.h:70
CConsole(int FlagMask)
Definition: console.cpp:773
static void TraverseChain(FCommandCallback *ppfnCallback, void **ppUserData)
Definition: console.cpp:763
int m_FlagMask
Definition: console.h:37
int ParseStart(CResult *pResult, const char *pString, int Length)
Definition: console.cpp:111
const char * m_apStrokeStr[2]
Definition: console.h:39
FUnknownCommandCallback m_pfnUnknownCommandCallback
Definition: console.h:69
void DeregisterTemp(const char *pName) override
Definition: console.cpp:941
void * m_pTeeHistorianCommandUserdata
Definition: console.h:67
@ PARSEARGS_INVALID_INTEGER
Definition: console.h:148
@ PARSEARGS_OK
Definition: console.h:146
@ PARSEARGS_INVALID_FLOAT
Definition: console.h:149
@ PARSEARGS_MISSING_VALUE
Definition: console.h:147
int FlagMask() const override
Definition: console.h:213
void RegisterTemp(const char *pName, const char *pParams, int Flags, const char *pHelp) override
Definition: console.cpp:907
void ExecuteLineFlag(const char *pStr, int FlagMask, int ClientId=-1, bool InterpretSemicolons=true) override
Definition: console.cpp:624
CExecFile * m_pFirstExec
Definition: console.h:49
int ParseArgs(CResult *pResult, const char *pFormat, bool IsColor=false)
Definition: console.cpp:136
static void ConCommandAccess(IResult *pResult, void *pUser)
Definition: console.cpp:685
void Chain(const char *pName, FChainCommandCallback pfnChainFunc, void *pUser) override
Definition: console.cpp:1001
void ExecuteLine(const char *pStr, int ClientId=-1, bool InterpretSemicolons=true) override
Definition: console.cpp:618
CCommand * FindCommand(const char *pName, int FlagMask)
Definition: console.cpp:604
@ MAX_PARTS
Definition: console.h:75
@ CONSOLE_MAX_STR_LENGTH
Definition: console.h:74
bool ExecuteFile(const char *pFilename, int ClientId=-1, bool LogFailure=false, int StorageType=IStorage::TYPE_ALL) override
Definition: console.cpp:632
bool LineIsValid(const char *pStr) override
Definition: console.cpp:372
void InitChecksum(CChecksumData *pData) const override
Definition: console.cpp:354
char NextParam(const char *&pFormat)
Definition: console.cpp:270
static void Con_Exec(IResult *pResult, void *pUserData)
Definition: console.cpp:680
CCommand * m_pRecycleList
Definition: console.h:53
int m_AccessLevel
Definition: console.h:51
int PossibleCommands(const char *pStr, int FlagMask, bool Temp, FPossibleCallback pfnCallback, void *pUser) override
Definition: console.cpp:587
IStorage * m_pStorage
Definition: console.h:50
const CCommandInfo * GetCommandInfo(const char *pName, int FlagMask, bool Temp) override
Definition: console.cpp:1039
void SetTeeHistorianCommandCallback(FTeeHistorianCommandCallback pfnCallback, void *pUser) override
Definition: console.cpp:342
static void ConCommandStatus(IConsole::IResult *pResult, void *pUser)
Definition: console.cpp:716
void Print(int Level, const char *pFrom, const char *pStr, ColorRGBA PrintColor=gs_ConsoleDefaultColor) const override
Definition: console.cpp:328
static void Con_Chain(IResult *pResult, void *pUserData)
Definition: console.cpp:995
CHeap m_TempCommands
Definition: console.h:54
std::vector< CExecutionQueueEntry > m_vExecutionQueue
Definition: console.h:171
int m_AccessLevel
Definition: console.h:76
unsigned m_NumArgs
Definition: console.h:47
static bool EmptyUnknownCommandCallback(const char *pCommand, void *pUser)
Definition: console.h:97
bool(* FUnknownCommandCallback)(const char *pCommand, void *pUser)
Definition: console.h:94
void(* FChainCommandCallback)(IResult *pResult, void *pUserData, FCommandCallback pfnCallback, void *pCallbackUserData)
Definition: console.h:93
void(* FPossibleCallback)(int Index, const char *pCmd, void *pUser)
Definition: console.h:91
void(* FCommandCallback)(IResult *pResult, void *pUserData)
Definition: console.h:92
@ ACCESS_LEVEL_ADMIN
Definition: console.h:28
@ ACCESS_LEVEL_USER
Definition: console.h:31
void(* FTeeHistorianCommandCallback)(int ClientId, int FlagMask, const char *pCmd, IResult *pResult, void *pUser)
Definition: console.h:90
@ TYPE_ALL
Definition: storage.h:26
static const ColorRGBA gs_ConsoleDefaultColor(1, 1, 1, 1)
#define dbg_assert(test, msg)
Definition: system.h:76
void mem_zero(T *block, size_t size)
Definition: system.h:178
void mem_copy(void *dest, const void *source, size_t size)
Definition: system.cpp:174