Skip to content

Conversation

@iThorgrim
Copy link

Description

This Pull Request represents a major architectural upgrade of the AzerothCore Lua Engine (ALE), migrating from the raw Lua C-API to Sol3.

The primary goal is to modernize the codebase, improve maintainability and simplify the API for script developers.

What Changed

Before (C-API):

int HasQuest(lua_State* L, Player* player)
{
    uint32 quest = ALE::CHECKVAL<uint32>(L, 2);
    ALE::Push(L, player->IsActiveQuest(quest));
    return 1;
}

After (Sol3):

bool HasQuest(Player* player, uint32 questId)
{
    return player->IsActiveQuest(questId);
}

Measurable Improvements

  • Type Safety: Arguments validated at compile-time instead of runtime
  • No Manual Stack Manipulation: Eliminated lua_push*, lua_check*, lua_settop, etc.

Key Changes

  • Enhanced Hook System:
    • 100+ new PlayerEvent hooks (74-190+)
    • New UnitEvent hooks
    • {...}
  • Better Method Registration: Single centralized registration point.

Developer Benefits

  • Significantly reduced complexity when adding new methods or hooks.
  • Easier debugging with compile-time type checking
  • Cleaner, more maintainable codebase

Migration Impact

This is a complete rewrite of the binding layer. The Lua-facing API remains largely compatible, but the internal C++ architecture is completely modernized.


Description of the PR corrected, reviewed, translated by Claude after a comparison of mod-ale (C API) and mod-ale (Sol3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant