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
@@ -43,7 +43,8 @@ bool LC_IsKorea(){return false;}bool LC_IsYMIR(){return false;}
#define M2_DELETE(p) delete (p)
#define M2_DESTROY_ITEM(p) ITEM_MANAGER::instance().DestroyItem(p)
struct Desc {const char* GetHostName(){return "mock";}};
struct CHARACTER {struct Points{CItem* pItems[400]={};WORD bItemGrid[400]={};CItem* pCubeItems[4]={};CItem* pSashMaterials[3]={};}m_pointsInstant;int64_t gold=1000;CItem* m_pQuestItem=nullptr;
struct CHARACTER {struct Cells{CItem* pItems[400]={};WORD bItemGrid[400]={};CItem* pCubeItems[4]={};CItem* pSashMaterials[3]={};};struct Points:Cells{Cells* pItemCells=this;Points()=default;Points(const Points& x):Cells(x){} Points& operator=(const Points& x){static_cast<Cells&>(*this)=x;pItemCells=this;return *this;}}m_pointsInstant;
const Cells& ItemCells()const{return m_pointsInstant;}int64_t gold=1000;CItem* m_pQuestItem=nullptr;
const char* GetName(){return "mock";}unsigned GetPlayerID(){return 1;}Desc* GetDesc(){return nullptr;}
CItem* GetInventoryItem(unsigned cell){return m_pointsInstant.pItems[cell];}void SetGold(int64_t value){gold=value;}
bool PortCubeInstallImage(const PortCube::InventoryImage&,const std::vector<CItem*>&,const std::vector<CItem*>&);};
@@ -57,7 +58,10 @@ struct DBDesc {void DBPacketHeader(unsigned,unsigned,unsigned){++packets;}void P
struct CSkillProto {};
struct CSkillManager {static CSkillManager& instance(){static CSkillManager m;return m;}CSkillProto* Get(unsigned){static CSkillProto p;return skills?&p:nullptr;}};
struct Limit {unsigned type=0;long value=0;};
struct TItemTable {unsigned bType=ITEM_WEAPON,bSubType=0,bSize=1;union{unsigned flags=0;unsigned dwFlags;};long values[3]={7,9,0};Limit limits[2];int sAddonType=0;unsigned bAlterToMagicItemPct=100,bGainSocketPct=0;};
namespace PortMaterialStackPolicy {inline unsigned Limit(unsigned,bool stackable,bool,unsigned){return stackable?2000:200;}inline bool LegacyGrowthMode(){return false;}}
namespace quest {struct CQuestManager{static CQuestManager& instance(){static CQuestManager q;return q;}int GetEventFlag(const char*){return 0;}};}
constexpr unsigned ITEM_ANTIFLAG_STACK=1;
struct TItemTable {unsigned dwAntiFlags=0,dwVnum=0;unsigned bType=ITEM_WEAPON,bSubType=0,bSize=1;union{unsigned flags=0;unsigned dwFlags;};long values[3]={7,9,0};Limit limits[2];int sAddonType=0;unsigned bAlterToMagicItemPct=100,bGainSocketPct=0;};
struct Attr {BYTE bType=0;short sValue=0;};
#pragma pack(push,1)
struct Extra {int32_t sockets[5]={};BYTE types[8]={};int16_t values[8]={};char name[25]={};};
@@ -76,7 +80,7 @@ struct CItem {
void SetWindow(unsigned w){m_bWindow=w;}unsigned GetWindow(){return m_bWindow;}
bool isLocked(){return locked;}bool IsExchanging(){return exchanging;}bool PortCubeHasPendingMutation(){return clock;}
void PortCubeInitNewAttach();bool PortCubeRestoreMetadata(const PortEconomy::Reward&);void PortCubeAttachRestored(CHARACTER*,WORD);
bool IsStackable(){return proto->flags&1;}unsigned GetFlag(){return proto->flags;}long GetValue(unsigned i){return proto->values[i];}
unsigned GetStackLimit(){return IsStackable()?2000:200;}bool IsStackable(){return proto->flags&1;}unsigned GetFlag(){return proto->flags;}long GetValue(unsigned i){return proto->values[i];}
void SetID(unsigned value){id=value;}unsigned GetID(){return id;}void SetVID(unsigned value){vid=value;}unsigned GetVID(){return vid;}
void SetSkipSave(bool value){m_bSkipSave=value;}bool GetSkipSave(){return m_bSkipSave;}
void Save();void UpdatePacket(){if(!m_portCubeTemplate)++packets;}