add: implement authentication system ui and handshake.

This commit is contained in:
Matthew Toro 2026-03-28 04:48:18 -04:00
parent 7a24494d3c
commit d42da07721
23 changed files with 701 additions and 28 deletions

View file

@ -11,13 +11,14 @@
ConnectScreen::ConnectScreen(Minecraft *minecraft, const wstring& ip, int port)
{
aborted = false;
preLoginSent = false;
// System.out.println("Connecting to " + ip + ", " + port);
minecraft->setLevel(nullptr);
#if 1
// 4J - removed from separate thread, but need to investigate what we actually need here
connection = new ClientConnection(minecraft, ip, port);
if (aborted) return;
connection->send(std::make_shared<PreLoginPacket>(minecraft->user->name));
connection->beginAuth();
#else
new Thread() {
@ -47,6 +48,11 @@ void ConnectScreen::tick()
{
if (connection != nullptr)
{
if (!preLoginSent && connection->authComplete)
{
preLoginSent = true;
connection->send(std::make_shared<PreLoginPacket>(minecraft->user->name));
}
connection->tick();
}
}