From 4101acd747beac6cc95afabf68a77e7e82a8c0de Mon Sep 17 00:00:00 2001 From: Learath2 Date: Mon, 6 Mar 2017 10:31:05 +0100 Subject: [PATCH] Add rcon_login --- src/engine/client/client.cpp | 7 +++++++ src/engine/client/client.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 55f4fbad5..18307a347 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2957,6 +2957,12 @@ void CClient::Con_RconAuth(IConsole::IResult *pResult, void *pUserData) pSelf->RconAuth("", pResult->GetString(0)); } +void CClient::Con_RconLogin(IConsole::IResult *pResult, void *pUserData) +{ + CClient *pSelf = (CClient *)pUserData; + pSelf->RconAuth(pResult->GetString(0), pResult->GetString(1)); +} + void CClient::Con_AddFavorite(IConsole::IResult *pResult, void *pUserData) { CClient *pSelf = (CClient *)pUserData; @@ -3286,6 +3292,7 @@ void CClient::RegisterCommands() m_pConsole->Register("screenshot", "", CFGFLAG_CLIENT, Con_Screenshot, this, "Take a screenshot"); m_pConsole->Register("rcon", "r[rcon-command]", CFGFLAG_CLIENT, Con_Rcon, this, "Send specified command to rcon"); m_pConsole->Register("rcon_auth", "s[password]", CFGFLAG_CLIENT, Con_RconAuth, this, "Authenticate to rcon"); + m_pConsole->Register("rcon_login", "s[username] s[password]", CFGFLAG_CLIENT, Con_RconLogin, this, "Authenticate to rcon with a username"); m_pConsole->Register("play", "r[file]", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Play, this, "Play the file specified"); m_pConsole->Register("record", "?s[file]", CFGFLAG_CLIENT, Con_Record, this, "Record to the file"); m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording"); diff --git a/src/engine/client/client.h b/src/engine/client/client.h index 8a3eff8a8..2da21411b 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -331,6 +331,7 @@ public: static void Con_Screenshot(IConsole::IResult *pResult, void *pUserData); static void Con_Rcon(IConsole::IResult *pResult, void *pUserData); static void Con_RconAuth(IConsole::IResult *pResult, void *pUserData); + static void Con_RconLogin(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);