| 4177 | } |
| 4178 | |
| 4179 | void CServer::LogoutClient(int ClientId, const char *pReason) |
| 4180 | { |
| 4181 | if(!IsSixup(ClientId)) |
| 4182 | { |
| 4183 | CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS, true); |
| 4184 | Msg.AddInt(0); //authed |
| 4185 | Msg.AddInt(0); //cmdlist |
| 4186 | SendMsg(&Msg, MSGFLAG_VITAL, ClientId); |
| 4187 | } |
| 4188 | else |
| 4189 | { |
| 4190 | CMsgPacker Msg(protocol7::NETMSG_RCON_AUTH_OFF, true, true); |
| 4191 | SendMsg(&Msg, MSGFLAG_VITAL, ClientId); |
| 4192 | } |
| 4193 | |
| 4194 | m_aClients[ClientId].m_AuthTries = 0; |
| 4195 | m_aClients[ClientId].m_pRconCmdToSend = nullptr; |
| 4196 | m_aClients[ClientId].m_MaplistEntryToSend = CClient::MAPLIST_UNINITIALIZED; |
| 4197 | |
| 4198 | if(*pReason) |
| 4199 | { |
| 4200 | char aBuf[64]; |
| 4201 | str_format(aBuf, sizeof(aBuf), "Logged out by %s.", pReason); |
| 4202 | SendRconLine(ClientId, aBuf); |
| 4203 | log_info("server", "ClientId=%d with key='%s' logged out by %s", ClientId, m_AuthManager.KeyIdent(m_aClients[ClientId].m_AuthKey), pReason); |
| 4204 | } |
| 4205 | else |
| 4206 | { |
| 4207 | SendRconLine(ClientId, "Logout successful."); |
| 4208 | log_info("server", "ClientId=%d with key='%s' logged out", ClientId, m_AuthManager.KeyIdent(m_aClients[ClientId].m_AuthKey)); |
| 4209 | } |
| 4210 | |
| 4211 | m_aClients[ClientId].m_AuthKey = -1; |
| 4212 | |
| 4213 | GameServer()->OnSetAuthed(ClientId, AUTHED_NO); |
| 4214 | } |
| 4215 | |
| 4216 | void CServer::LogoutKey(int Key, const char *pReason) |
| 4217 | { |
no test coverage detected