port: verify root pack ledger and repair runtime adapters
This commit is contained in:
@@ -9,11 +9,17 @@
|
||||
|
||||
void mt_platform_stub_called(const char* function, bool* reported);
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define MT_PLATFORM_FUNCTION_SIGNATURE __FUNCSIG__
|
||||
#else
|
||||
#define MT_PLATFORM_FUNCTION_SIGNATURE __PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
#define MT_PLATFORM_STUB() \
|
||||
do \
|
||||
{ \
|
||||
static bool mt_platform_stub_reported = false; \
|
||||
mt_platform_stub_called(__func__, &mt_platform_stub_reported); \
|
||||
mt_platform_stub_called(MT_PLATFORM_FUNCTION_SIGNATURE, &mt_platform_stub_reported); \
|
||||
} while (0)
|
||||
|
||||
template <class T>
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "PythonHost.h"
|
||||
#include "../EterLib/UIRenderCommands.h"
|
||||
#include "../EterBase/LogBox.h"
|
||||
#include "../UserInterface/ServerClock.h"
|
||||
|
||||
#include <condition_variable>
|
||||
#include <cstdlib>
|
||||
@@ -83,7 +84,7 @@ public:
|
||||
float GetGlobalTime() override { return CTimer::Instance().GetCurrentSecond(); }
|
||||
float GetGlobalElapsedTime() override { return CTimer::Instance().GetElapsedSecond(); }
|
||||
void SkipRenderBuffering(DWORD) override {}
|
||||
void SetServerTime(time_t) override {}
|
||||
void SetServerTime(time_t server_time) override { SetPlatformServerTime(server_time); }
|
||||
void SetCenterPosition(float x, float y, float z) override
|
||||
{
|
||||
CPythonApplication::Instance().SetCenterPosition(x, y, z);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "../EterLib/RenderCommands3D.h"
|
||||
#include "EterLib/GrpDevice.h"
|
||||
#include "../ScriptLib/PythonBoot.h"
|
||||
#include "ServerClock.h"
|
||||
|
||||
// 2V0-d link surface; 2V0-f adds the application lifecycle (Create/Loop/Process/Exit) that
|
||||
// prototype.RunApp() drives. The rest of the members still wait for the game slices (2V1-2V3).
|
||||
@@ -387,10 +388,40 @@ void CPythonApplication::SetMouseHandler(PyObject* poMouseHandler)
|
||||
{
|
||||
s_poMouseHandler = poMouseHandler;
|
||||
}
|
||||
void CPythonApplication::SetGlobalCenterPosition(LONG, LONG) { MT_PLATFORM_STUB(); }
|
||||
void CPythonApplication::SetGlobalCenterPosition(LONG x, LONG y)
|
||||
{
|
||||
// 40250 PythonApplication.cpp:1284: the background owns the global-to-local map offset.
|
||||
CPythonBackground& background = CPythonBackground::Instance();
|
||||
background.GlobalPositionToLocalPosition(x, y);
|
||||
SetCenterPosition(x, y, background.GetHeight(x, y));
|
||||
}
|
||||
void CPythonApplication::SetFPS(int) {}
|
||||
time_t CPythonApplication::GetServerTime() { return time(nullptr); }
|
||||
time_t CPythonApplication::GetServerTimeStamp() { return time(nullptr); }
|
||||
namespace {
|
||||
DWORD s_server_start_msec = 0;
|
||||
time_t s_server_time = 0;
|
||||
time_t s_local_start_time = 0;
|
||||
}
|
||||
|
||||
void SetPlatformServerTime(time_t server_time)
|
||||
{
|
||||
s_server_start_msec = ELTimer_GetMSec();
|
||||
s_server_time = server_time;
|
||||
s_local_start_time = time(nullptr);
|
||||
}
|
||||
|
||||
time_t GetPlatformServerTime()
|
||||
{
|
||||
return static_cast<time_t>(ELTimer_GetMSec() - s_server_start_msec) + s_server_time;
|
||||
}
|
||||
|
||||
time_t GetPlatformServerTimeStamp()
|
||||
{
|
||||
return (time(nullptr) - s_local_start_time) + s_server_time;
|
||||
}
|
||||
|
||||
void CPythonApplication::SetServerTime(time_t server_time) { SetPlatformServerTime(server_time); }
|
||||
time_t CPythonApplication::GetServerTime() { return GetPlatformServerTime(); }
|
||||
time_t CPythonApplication::GetServerTimeStamp() { return GetPlatformServerTimeStamp(); }
|
||||
void CPythonApplication::SetConnectData(const char*, int) { MT_PLATFORM_STUB(); }
|
||||
void CPythonApplication::GetConnectData(std::string& ip, int& port) { MT_PLATFORM_STUB(); ip.clear(); port = 0; }
|
||||
void CPythonApplication::SetForceSightRange(int) { MT_PLATFORM_STUB(); }
|
||||
@@ -540,4 +571,3 @@ bool LoadLocaleData(const char* localePath)
|
||||
NANOEND
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <ctime>
|
||||
|
||||
// CPythonApplication is not constructed by the Godot host. Keep the three values that its
|
||||
// 40250 SetServerTime/GetServerTime/GetServerTimeStamp methods use in the platform adapter.
|
||||
void SetPlatformServerTime(time_t server_time);
|
||||
time_t GetPlatformServerTime();
|
||||
time_t GetPlatformServerTimeStamp();
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "Japanese.h"
|
||||
// PORT: MSVC's precompiled headers declared ::tolower implicitly; Android needs the CRT header.
|
||||
#include <ctype.h>
|
||||
|
||||
//
|
||||
// CP932: Shift-JIS (Japan Industry Standard)
|
||||
|
||||
Reference in New Issue
Block a user