Fix logging into rcon with dummy

Fixes #4721.
This commit is contained in:
heinrich5991 2022-02-23 20:42:08 +01:00
parent 7d31959ab4
commit eff9abf769

View file

@ -1845,11 +1845,13 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
if(Unpacker.Error() == 0) if(Unpacker.Error() == 0)
m_pConsole->DeregisterTemp(pName); m_pConsole->DeregisterTemp(pName);
} }
else if(!Dummy && (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 && Msg == NETMSG_RCON_AUTH_STATUS) else if((pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 && Msg == NETMSG_RCON_AUTH_STATUS)
{ {
int Result = Unpacker.GetInt(); int Result = Unpacker.GetInt();
if(Unpacker.Error() == 0) if(Unpacker.Error() == 0)
m_RconAuthed[Dummy] = Result; m_RconAuthed[Conn] = Result;
if(Conn == CONN_MAIN)
{
int Old = m_UseTempRconCommands; int Old = m_UseTempRconCommands;
m_UseTempRconCommands = Unpacker.GetInt(); m_UseTempRconCommands = Unpacker.GetInt();
if(Unpacker.Error() != 0) if(Unpacker.Error() != 0)
@ -1857,6 +1859,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
if(Old != 0 && m_UseTempRconCommands == 0) if(Old != 0 && m_UseTempRconCommands == 0)
m_pConsole->DeregisterTempAll(); m_pConsole->DeregisterTempAll();
} }
}
else if(!Dummy && (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 && Msg == NETMSG_RCON_LINE) else if(!Dummy && (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 && Msg == NETMSG_RCON_LINE)
{ {
const char *pLine = Unpacker.GetString(); const char *pLine = Unpacker.GetString();