diff options
| author | oy <Tom_Adams@web.de> | 2010-10-11 00:30:56 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-10-11 00:30:56 +0200 |
| commit | 5754812dea6598335f60858d125639c92ec67914 (patch) | |
| tree | 3f91baf712e07ad770d5eb10b6ddda68257b4950 /src/game/client | |
| parent | 00c142103455d3d87d43f31df04213db4d92571b (diff) | |
| download | zcatch-5754812dea6598335f60858d125639c92ec67914.tar.gz zcatch-5754812dea6598335f60858d125639c92ec67914.zip | |
clear history of the remote console on disconnect and cleaned up some old stuff in console.cpp
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/components/console.cpp | 43 | ||||
| -rw-r--r-- | src/game/client/components/console.h | 2 |
2 files changed, 11 insertions, 34 deletions
diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index 9808a99f..b99137c2 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -1,4 +1,3 @@ -//#include "gc_console.h" #include <math.h> #include <time.h> @@ -38,10 +37,6 @@ enum CGameConsole::CInstance::CInstance(int Type) { - // init ringbuffers - //history = ringbuf_init(history_data, sizeof(history_data), RINGBUF_FLAG_RECYCLE); - //backlog = ringbuf_init(backlog_data, sizeof(backlog_data), RINGBUF_FLAG_RECYCLE); - m_pHistoryEntry = 0x0; m_Type = Type; @@ -69,6 +64,12 @@ void CGameConsole::CInstance::ClearBacklog() m_BacklogActPage = 0; } +void CGameConsole::CInstance::ClearHistory() +{ + m_History.Init(); + m_pHistoryEntry = 0; +} + void CGameConsole::CInstance::ExecuteLine(const char *pLine) { if(m_Type == 0) @@ -673,34 +674,8 @@ void CGameConsole::OnConsoleInit() Console()->Register("dump_remote_console", "", CFGFLAG_CLIENT, ConDumpRemoteConsole, this, "Dump remote console"); } -/* -static void con_team(void *result, void *user_data) +void CGameConsole::OnStateChange(int NewState, int OldState) { - send_switch_team(console_arg_int(result, 0)); -} - -static void con_kill(void *result, void *user_data) -{ - send_kill(-1); -} - -void send_kill(int client_id); - -static void con_emote(void *result, void *user_data) -{ - send_emoticon(console_arg_int(result, 0)); -} - -extern void con_chat(void *result, void *user_data); - -void client_console_init() -{ - // - MACRO_REGISTER_COMMAND("team", "i", con_team, 0x0); - MACRO_REGISTER_COMMAND("kill", "", con_kill, 0x0); - - // chatting - MACRO_REGISTER_COMMAND("emote", "i", con_emote, 0); - MACRO_REGISTER_COMMAND("+emote", "", con_key_input_state, &emoticon_selector_active); + if(NewState == IClient::STATE_OFFLINE) + m_RemoteConsole.ClearHistory(); } -*/ diff --git a/src/game/client/components/console.h b/src/game/client/components/console.h index a4d22790..ae05aa8b 100644 --- a/src/game/client/components/console.h +++ b/src/game/client/components/console.h @@ -32,6 +32,7 @@ class CGameConsole : public CComponent void Init(CGameConsole *pGameConsole); void ClearBacklog(); + void ClearHistory(); void ExecuteLine(const char *pLine); @@ -72,6 +73,7 @@ public: void PrintLine(int Type, const char *pLine); + virtual void OnStateChange(int NewState, int OldState); virtual void OnConsoleInit(); virtual void OnReset(); virtual void OnRender(); |