Join by ip screen

This commit is contained in:
InviseDivine
2026-03-11 19:04:54 +02:00
parent 933ef9c988
commit 8875342557
10 changed files with 433 additions and 26 deletions

View File

@@ -55,7 +55,6 @@
#include "player/input/XperiaPlayInput.h"
#endif
#include "player/input/MouseTurnInput.h"
#include "../world/entity/MobFactory.h"
#include "../world/level/MobSpawner.h"
@@ -1288,6 +1287,30 @@ bool Minecraft::joinMultiplayer( const PingedCompatibleServer& server )
return false;
}
bool Minecraft::joinMultiplayerFromString( const std::string& server )
{
std::string ip = "";
std::string port = "19132";
size_t pos = server.find(":");
if (pos != std::string::npos) {
ip = server.substr(0, pos);
port = server.substr(pos + 1);
} else {
ip = server;
}
printf("%s \n", port.c_str());
if (isLookingForMultiplayer && netCallback) {
isLookingForMultiplayer = false;
printf("test");
return raknetInstance->connect(ip.c_str(), std::stoi(port));
}
return false;
}
void Minecraft::hostMultiplayer(int port) {
// Tear down last instance
raknetInstance->disconnect();
@@ -1455,6 +1478,12 @@ LevelStorageSource* Minecraft::getLevelSource()
return storageSource;
}
// int Minecraft::getLicenseId() {
// if (!LicenseCodes::isReady(_licenseId))
// _licenseId = platform()->checkLicense();
// return _licenseId;
// }
void Minecraft::audioEngineOn() {
#ifndef STANDALONE_SERVER
soundEngine->enable(true);