major refactor: auth v3
This commit is contained in:
parent
8a8b4b2573
commit
179d21d7b6
18 changed files with 376 additions and 166 deletions
|
|
@ -413,6 +413,35 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!g_NetworkManager.IsHost())
|
||||
{
|
||||
try {
|
||||
connection->beginAuth();
|
||||
while (!connection->authComplete && !connection->isClosed() && IsInSession() && !g_NetworkManager.IsLeavingGame())
|
||||
{
|
||||
connection->tick();
|
||||
Sleep(50);
|
||||
}
|
||||
} catch (...) {
|
||||
app.DebugPrintf("AUTH: exception during auth handshake\n");
|
||||
connection->close();
|
||||
delete connection;
|
||||
connection = nullptr;
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!connection->authComplete)
|
||||
{
|
||||
app.DebugPrintf("Auth handshake did not complete, aborting connection\n");
|
||||
connection->close();
|
||||
delete connection;
|
||||
connection = nullptr;
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
connection->send(std::make_shared<PreLoginPacket>(minecraft->user->name));
|
||||
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue