#include #define EXPECTED_CLIENT_HEADER 0xDEADBEEF namespace Login { bool RemoteLoginServer::Start(ByteArray &RawLoginHeader) { if(RawLoginHeader.empty()) return false; // Epic direct casts :---DDDD m_Header = *reinterpret_cast(&RawLoginHeader[0]); return true; } RemoteLoginResponse RemoteLoginServer::GetLoginResponse() { // The header seems to be wrong, tell the client to update. if(m_Header.m_ClientHeader != EXPECTED_CLIENT_HEADER) return RemoteLoginResponse::OUTDATED_CLIENT; // TODO: Check login, HWID, bans with websockets. // User failed to obtain HWID? if(!m_Header.m_HardwareId) { // TODO: Shadow ban the user. //return RemoteLoginResponse::INVALID_HARDWARE; } // Checksum validation. uint8_t Checksum = m_Header.m_IntegrityBit1 | m_Header.m_IntegrityBit2 | m_Header.m_IntegrityBit3; if(Checksum || Checksum != m_Header.m_IntegrityBit4) { // TODO: Shadow ban the user. return RemoteLoginResponse::INTEGRITY_FAILURE; } // Assume that they are authorised to use the cheat. return RemoteLoginResponse::ACCESS_SPECIAL_USER; } ByteArray RemoteLoginServer::GetResponse() { // The way the server handles data transmission is homosexual. // That is the only reason this autism is here. ByteArray Response; Response.push_back(GetLoginResponse()); return Response; } }