mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-12-02 22:18:09 +01:00
replace WinsockNetLayer with PlatformNetworkManagerWindows, implement external server stats
This commit is contained in:
1 parent
62b92d5c0b
commit
f434aae3af
42 files changed
+2621
-3406
No files matched your search
@@ -28,6 +28,7 @@
|
||||
#include "../ChatScreen.h"
|
||||
#include "KeyboardMouseInput.h"
|
||||
#include "ControllerBinds.h"
|
||||
#include "../Common/Network/ExternalServerList.h"
|
||||
#include "../User.h"
|
||||
#include "../../Minecraft.World/Socket.h"
|
||||
#include "../../Minecraft.World/ThreadName.h"
|
||||
@@ -49,7 +50,7 @@
|
||||
#include "../../Minecraft.World/OldChunkStorage.h"
|
||||
#include "Common/PostProcesser.h"
|
||||
#include "../GameRenderer.h"
|
||||
#include "Network/WinsockNetLayer.h"
|
||||
#include "Network/WindowsNetworkConfig.h"
|
||||
#include "Windows64_Xuid.h"
|
||||
#include "Common/UI/UI.h"
|
||||
#include "stb_image_write.h"
|
||||
@@ -1567,8 +1568,6 @@ static Minecraft* InitialiseMinecraftRuntime()
|
||||
}
|
||||
wcscpy_s(IQNet::m_player[0].m_gamertag, 32, g_Win64UsernameW);
|
||||
|
||||
WinsockNetLayer::Initialize();
|
||||
|
||||
ProfileManager.SetDebugFullOverride(true);
|
||||
|
||||
Tesselator::CreateNewThreadStorage(1024 * 1024);
|
||||
@@ -1735,26 +1734,11 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
|
||||
if (!migEntries.empty())
|
||||
{
|
||||
FILE* dbFile = nullptr;
|
||||
if (fopen_s(&dbFile, "servers.db", "wb") == 0 && dbFile)
|
||||
{
|
||||
fwrite("MCSV", 1, 4, dbFile);
|
||||
uint32_t ver = 1;
|
||||
uint32_t cnt = (uint32_t)migEntries.size();
|
||||
fwrite(&ver, sizeof(uint32_t), 1, dbFile);
|
||||
fwrite(&cnt, sizeof(uint32_t), 1, dbFile);
|
||||
for (size_t i = 0; i < migEntries.size(); i++)
|
||||
{
|
||||
uint16_t ipLen = (uint16_t)migEntries[i].ip.length();
|
||||
fwrite(&ipLen, sizeof(uint16_t), 1, dbFile);
|
||||
fwrite(migEntries[i].ip.c_str(), 1, ipLen, dbFile);
|
||||
fwrite(&migEntries[i].port, sizeof(uint16_t), 1, dbFile);
|
||||
uint16_t nameLen = (uint16_t)migEntries[i].name.length();
|
||||
fwrite(&nameLen, sizeof(uint16_t), 1, dbFile);
|
||||
fwrite(migEntries[i].name.c_str(), 1, nameLen, dbFile);
|
||||
}
|
||||
fclose(dbFile);
|
||||
}
|
||||
std::vector<ExternalServerList::Entry> entries;
|
||||
for (const MigEntry& entry : migEntries)
|
||||
entries.push_back({ entry.ip, entry.port, entry.name });
|
||||
if (!ExternalServerList::Write(entries))
|
||||
app.DebugPrintf("Failed to migrate the existing external server list.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user