feat: add AVA2 64-bit gold protocol and client formatting

This commit is contained in:
shen
2026-10-19 23:23:31 -07:00
parent f386815353
commit 86a769f7dd
12 changed files with 169 additions and 2 deletions
@@ -3,6 +3,9 @@
#include "ScriptLib/PythonLauncher.h"
#include "UserInterface/StdAfx.h"
extern void initapp();
extern void initPlayer();
#include "UserInterface/PythonPlayer.h"
#include <cassert>
#include "../../src/platform/ScriptLib/PythonHost.h"
#include <cstdio>
@@ -29,6 +32,25 @@ int main(int argc, char** argv)
initgrpThing();
initwndMgr();
initapp();
CPythonPlayer player;
initPlayer();
CPythonPlayer::Instance().SetGold64(123456789012345LL);
assert(CPythonPlayer::Instance().GetGold64() == 123456789012345LL);
assert(CPythonPlayer::Instance().GetStatus(POINT_GOLD) == 2000000000);
if (!launcher.RunLine(
"import player\n"
"gold = player.GetElk()\n"
"assert gold == 123456789012345L, 'GetElk mismatch: %r' % gold\n"
"assert player.GetGold64() == 123456789012345L\n"
"def _fmt(v):\n"
" if v >= 1000000000000: return '%.2f T' % (float(v)/1000000000000.0)\n"
" elif v >= 1000000000: return '%.2f B' % (float(v)/1000000000.0)\n"
" return format(int(v), ',')\n"
"assert _fmt(gold) == '123.46 T'\n"
"assert _fmt(5200000000L) == '5.20 B'\n"
"assert _fmt(1234567) == '1,234,567'\n"
))
return 1;
if (!launcher.RunLine("import wndMgr, grp, grpImage, grpText, grpThing, app"))
return 1;
if (!launcher.RunLine(