port: verify root pack ledger and repair runtime adapters

This commit is contained in:
shen
2026-09-24 00:18:33 -07:00
parent c84f913cfd
commit 330ec9745b
89 changed files with 17085 additions and 6808 deletions
+9
View File
@@ -38,6 +38,7 @@
#include "ScriptLib/StdAfx.h"
#include "../src/platform/ScriptLib/PythonBoot.h"
#include "../src/platform/ScriptLib/PythonHost.h"
#include "../src/platform/UserInterface/ServerClock.h"
#include "../src/platform/UserInterface/UserInterface.h"
#include "../src/platform/EterBase/TraceErrorObserver.h"
#include "../src/platform/EterLib/RenderCommands3D.h"
@@ -233,6 +234,11 @@ int main(int argc, char** argv)
if (!started)
std::fprintf(stderr, "PythonBoot::Start: %s\n", error.c_str());
CHECK(started);
// 40250 keeps a server-supplied base plus local elapsed time. Check both units before the
// fake server's GC_TIME packet replaces this base during the game phase.
SetPlatformServerTime(123456789);
CHECK(GetPlatformServerTime() >= 123456789 && GetPlatformServerTime() < 123457789);
CHECK(GetPlatformServerTimeStamp() >= 123456789 && GetPlatformServerTimeStamp() <= 123456791);
PythonBoot::SetUISize(800, 600);
const bool ran = PythonBoot::RunMainScript("", &error);
if (!ran)
@@ -386,6 +392,9 @@ int main(int argc, char** argv)
return failed() || (server && server->Has("game2:burst_pong"));
});
CHECK(live || (burst && !failed()));
// The fake server's GC_TIME is milliseconds since this test server started, so its
// value is small. The sentinel set before login must have been replaced by RecvTimePacket.
CHECK(live || (GetPlatformServerTime() < 120000 && GetPlatformServerTimeStamp() < 120000));
CHECK(py_true(gaming));
CHECK(py("import net\nassert net.IsConnect(), 'disconnected in the game phase'"));
CHECK(count_syserr("Unknown packet header") == 0);