MCPcopy Create free account
hub / github.com/ddnet/ddnet / OnNetMsgRconCmd

Method OnNetMsgRconCmd

src/engine/server/server.cpp:2036–2062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2034}
2035
2036void CServer::OnNetMsgRconCmd(int ClientId, const char *pCmd)
2037{
2038 if(!str_comp(pCmd, "crashmeplx"))
2039 {
2040 int Version = m_aClients[ClientId].m_DDNetVersion;
2041 if(GameServer()->PlayerExists(ClientId) && Version < VERSION_DDNET_OLD)
2042 {
2043 m_aClients[ClientId].m_DDNetVersion = VERSION_DDNET_OLD;
2044 }
2045 }
2046 else if(IsRconAuthed(ClientId))
2047 {
2048 if(GameServer()->PlayerExists(ClientId))
2049 {
2050 log_info("server", "ClientId=%d key='%s' rcon='%s'", ClientId, GetAuthName(ClientId), pCmd);
2051 m_RconClientId = ClientId;
2052 m_RconAuthLevel = GetAuthedState(ClientId);
2053 {
2054 CRconClientLogger Logger(this, ClientId);
2055 CLogScope Scope(&Logger);
2056 Console()->ExecuteLineFlag(pCmd, CFGFLAG_SERVER, ClientId);
2057 }
2058 m_RconClientId = IServer::RCON_CID_SERV;
2059 m_RconAuthLevel = AUTHED_ADMIN;
2060 }
2061 }
2062}
2063
2064void CServer::OnNetMsgRconAuth(int ClientId, const char *pName, const char *pPw, bool SendRconCmds)
2065{

Callers

nothing calls this directly

Calls 3

str_compFunction · 0.85
PlayerExistsMethod · 0.80
ExecuteLineFlagMethod · 0.80

Tested by

no test coverage detected