36 lines
527 B
C++
36 lines
527 B
C++
|
namespace Components
|
||
|
{
|
||
|
class Auth : public Component
|
||
|
{
|
||
|
public:
|
||
|
Auth();
|
||
|
~Auth();
|
||
|
const char* GetName() { return "Auth"; };
|
||
|
|
||
|
private:
|
||
|
|
||
|
enum AuthState
|
||
|
{
|
||
|
STATE_UNKNOWN,
|
||
|
STATE_NEGOTIATING,
|
||
|
STATE_VALID,
|
||
|
STATE_INVALID,
|
||
|
};
|
||
|
|
||
|
struct AuthInfo
|
||
|
{
|
||
|
Utils::Cryptography::ECDSA::Key publicKey;
|
||
|
std::string challenge;
|
||
|
AuthState state;
|
||
|
int time;
|
||
|
};
|
||
|
|
||
|
static AuthInfo ClientAuthInfo[18];
|
||
|
|
||
|
static void Frame();
|
||
|
|
||
|
static void RegisterClient(int clientNum);
|
||
|
static void RegisterClientStub();
|
||
|
};
|
||
|
}
|