mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
feat: add GetNetStats (latency) and AcceptBattlefieldPort (BG queue)
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
GetNetStats() returns bandwidthIn, bandwidthOut, latencyHome, latencyWorld — with real latency from getLatencyMs(). Used by latency display addons and the default UI's network indicator. AcceptBattlefieldPort(index, accept) accepts or declines a battleground queue invitation. Backed by existing acceptBattlefield and declineBattlefield methods.
This commit is contained in:
parent
a53342e23f
commit
d873f27070
1 changed files with 19 additions and 0 deletions
|
|
@ -5182,6 +5182,25 @@ void LuaEngine::registerCoreAPI() {
|
||||||
if (gh) gh->requestPvpLog();
|
if (gh) gh->requestPvpLog();
|
||||||
return 0;
|
return 0;
|
||||||
}},
|
}},
|
||||||
|
// --- Network & BG Queue ---
|
||||||
|
{"GetNetStats", [](lua_State* L) -> int {
|
||||||
|
auto* gh = getGameHandler(L);
|
||||||
|
uint32_t ms = gh ? gh->getLatencyMs() : 0;
|
||||||
|
lua_pushnumber(L, 0); // bandwidthIn
|
||||||
|
lua_pushnumber(L, 0); // bandwidthOut
|
||||||
|
lua_pushnumber(L, ms); // latencyHome
|
||||||
|
lua_pushnumber(L, ms); // latencyWorld
|
||||||
|
return 4;
|
||||||
|
}},
|
||||||
|
{"AcceptBattlefieldPort", [](lua_State* L) -> int {
|
||||||
|
auto* gh = getGameHandler(L);
|
||||||
|
int accept = lua_toboolean(L, 2);
|
||||||
|
if (gh) {
|
||||||
|
if (accept) gh->acceptBattlefield();
|
||||||
|
else gh->declineBattlefield();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}},
|
||||||
// --- Taxi/Flight Paths ---
|
// --- Taxi/Flight Paths ---
|
||||||
{"NumTaxiNodes", [](lua_State* L) -> int {
|
{"NumTaxiNodes", [](lua_State* L) -> int {
|
||||||
auto* gh = getGameHandler(L);
|
auto* gh = getGameHandler(L);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue