diff options
| author | oy <Tom_Adams@web.de> | 2011-03-27 18:05:11 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-03-27 18:05:11 +0200 |
| commit | 7bd79f9f4399c63d2d9cd77d7cb2ff58b84d5e32 (patch) | |
| tree | 8c253c53ae91a1cbf47439a38b280b0e84882419 /src/engine | |
| parent | a583633cde8f6d257fff99221d4b063ae435379e (diff) | |
| download | zcatch-7bd79f9f4399c63d2d9cd77d7cb2ff58b84d5e32.tar.gz zcatch-7bd79f9f4399c63d2d9cd77d7cb2ff58b84d5e32.zip | |
added remove_favorite command by Choupom
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/client/client.cpp | 9 | ||||
| -rw-r--r-- | src/engine/client/client.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 297828dc..198f5f1a 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2134,6 +2134,14 @@ void CClient::Con_AddFavorite(IConsole::IResult *pResult, void *pUserData) pSelf->m_ServerBrowser.AddFavorite(Addr); } +void CClient::Con_RemoveFavorite(IConsole::IResult *pResult, void *pUserData) +{ + CClient *pSelf = (CClient *)pUserData; + NETADDR Addr; + if(net_addr_from_str(&Addr, pResult->GetString(0)) == 0) + pSelf->m_ServerBrowser.RemoveFavorite(Addr); +} + const char *CClient::DemoPlayer_Play(const char *pFilename, int StorageType) { int Crc; @@ -2285,6 +2293,7 @@ void CClient::RegisterCommands() m_pConsole->Register("record", "?s", CFGFLAG_CLIENT, Con_Record, this, "Record to the file"); m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording"); m_pConsole->Register("add_favorite", "s", CFGFLAG_CLIENT, Con_AddFavorite, this, "Add a server as a favorite"); + m_pConsole->Register("remove_favorite", "s", CFGFLAG_CLIENT, Con_RemoveFavorite, this, "Remove a server from favorites"); // used for server browser update m_pConsole->Chain("br_filter_string", ConchainServerBrowserUpdate, this); diff --git a/src/engine/client/client.h b/src/engine/client/client.h index 31364cd2..b0696b96 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -303,6 +303,7 @@ public: static void Con_Rcon(IConsole::IResult *pResult, void *pUserData); static void Con_RconAuth(IConsole::IResult *pResult, void *pUserData); static void Con_AddFavorite(IConsole::IResult *pResult, void *pUserData); + static void Con_RemoveFavorite(IConsole::IResult *pResult, void *pUserData); static void Con_Play(IConsole::IResult *pResult, void *pUserData); static void Con_Record(IConsole::IResult *pResult, void *pUserData); static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData); |