feat: support Linux/ARM cross-platform build and AVA2 feature updates

- Port server core and libraries to Linux and 32-bit ARM (armhf):
  * Replace FreeBSD kqueue with Linux epoll in libthecore fdwatch
  * Fix unaligned float and 64-bit int memory stores in utils.h str_to_number to avoid ARM VFP alignment fault (SIGBUS)
  * Fix getopt loop variable type in main.cpp (char -> int) to eliminate infinite loop caused by default unsigned char on ARM
  * Add -fsigned-char and multi-architecture flags to Makefiles (x86_64 -m32, i386, and ARM armhf)
  * Update libsql for modern MariaDB client library (removed reconnect field) and C++20 concept/syntax compatibility
  * Replace Win32 xdirent with standard POSIX dirent on Unix/Linux
  * Include xmd5 in libthecore on non-FreeBSD platforms
- AVA2 unlock features and tools:
  * Material stacking up to 2000 count, refine material resolution and test suites
  * AVA2 ticket shop and point drop configuration updates
This commit is contained in:
shenlei
2026-11-11 00:59:49 -08:00
parent 30ea96f418
commit bb0963210e
71 changed files with 1778 additions and 485 deletions
+12 -9
View File
@@ -36,7 +36,7 @@ class CubeMutation(unittest.TestCase):
self.assertIn('misses aliases',report['warning'])
def test_item_admission_is_read_only_and_preserves_expiry_paths(self):
body=(SRC/'port_cube_item.inc').read_text()
body=(SRC/'port_cube_item.inc').read_bytes().decode('latin1')
run(r'''
#include <cassert>
#include <initializer_list>
@@ -53,7 +53,7 @@ int main(){CItem item;assert(item.PortCubeHasPendingMutation());Proto proto;item
''')
def test_actual_preparation_admission_combines_context_and_owned_item_hazards(self):
body=function((SRC/'port_cube_actor.cpp').read_text(),'uint32_t PortCubeAdmission(')
body=function((SRC/'port_cube_actor.cpp').read_bytes().decode('latin1'),'uint32_t PortCubeAdmission(')
run(r'''
#include "src/server/common/cube_mutation.h"
#include <cassert>
@@ -74,8 +74,8 @@ int main(){using namespace PortCube;CHARACTER ch;Item item;ch.items={&item};asse
ch.desc=false;assert(PortCubeAdmission(&ch)==MissingState);assert(PortCubeAdmission(nullptr)==MissingState);
}
''')
current=(SRC/'item.cpp').read_text()
original=subprocess.check_output(['git','show','HEAD:src/server/game/src/item.cpp'],cwd=ROOT).decode()
current=(SRC/'item.cpp').read_bytes().decode('latin1')
original=subprocess.check_output(['git','show','HEAD:src/server/game/src/item.cpp'],cwd=ROOT).decode('latin1')
for event in ['unique_expire_event','timer_based_on_wear_expire_event','real_time_expire_event','accessory_socket_expire_event']:
current_body=function(current,'EVENTFUNC('+event+')')
original_body=function(original,'EVENTFUNC('+event+')')
@@ -84,12 +84,15 @@ int main(){using namespace PortCube;CHARACTER ch;Item item;ch.items={&item};asse
# original expiry deadlines, effects and scheduling stay exact.
checked='const item_vid_event_info* info = dynamic_cast<const item_vid_event_info*>(event->info); // PORT: prepared clock info is a checked subtype.'
self.assertEqual(current_body.count(checked),1)
legacy=re.search(r'[^\n]*info = reinterpret_cast<[^\n]*',original_body).group(0).lstrip()
current_body=current_body.replace(checked,legacy)
legacy=re.search(r'[^\n]*info = reinterpret_cast<[^\n]*',original_body)
if legacy:
current_body=current_body.replace(checked,legacy.group(0).lstrip())
else:
self.assertIn(checked,original_body)
self.assertEqual(current_body,original_body)
def test_item_save_notifies_but_does_not_drop_or_redirect_original_save(self):
body=function((SRC/'item.cpp').read_text(),'void CItem::Save()')
body=function((SRC/'item.cpp').read_bytes().decode('latin1'),'void CItem::Save()')
run(r'''
#include "src/server/common/cube_mutation.h"
#include <cassert>
@@ -124,7 +127,7 @@ int main(){PC pc;pc.SetFlag("gem.points",5);assert(pc.m_FlagMap.at("gem.points")
''')
def test_switchbot_yields_whole_roll_before_state_rng_or_cost(self):
text=(SRC/'port_switchbot.cpp').read_text()
text=(SRC/'port_switchbot.cpp').read_bytes().decode('latin1')
prefix=text.split('void CSwitchbot::SwitchItems()',1)[1].split('for (BYTE bSlot',1)[0]
run(r'''
#include <cassert>
@@ -142,7 +145,7 @@ int main(){CSwitchbot bot;bot.SwitchItems();assert(rolls==0);held=false;bot.Swit
self.assertLess(text.index('PortCubeActorHeld(',text.index('void CSwitchbot::SwitchItems()')),text.index('m_table.finished[bSlot] = false;',text.index('void CSwitchbot::SwitchItems()')))
def test_gold_and_lifecycle_notifications_are_not_setter_vetoes(self):
text=(SRC/'char.cpp').read_text()
text=(SRC/'char.cpp').read_bytes().decode('latin1')
self.assertIn('if(type==POINT_GOLD&&amount)PortCubeAssetMutation(this,PortCube::GoldWrite);',function(text,'void CHARACTER::PointChange('))
for signature in ['void CHARACTER::Disconnect(', 'bool CHARACTER::WarpSet(long x, long y, long lPrivateMapIndex, BYTE targetChannel)']:
self.assertIn('PortCubeAssetMutation(this,PortCube::LifecycleWrite);',function(text,signature))