Skip to content

feat: add game.* Lua API for engine access#1

Merged
Taure merged 1 commit intomainfrom
feat/game-api
Apr 8, 2026
Merged

feat: add game.* Lua API for engine access#1
Taure merged 1 commit intomainfrom
feat/game-api

Conversation

@Taure
Copy link
Copy Markdown
Contributor

@Taure Taure commented Apr 8, 2026

Summary

  • New asobi_lua_api module installs game.* namespace into Luerl state
  • Economy: grant, debit, balance, purchase
  • Leaderboards: submit, top, rank, around
  • Notifications: notify, notify_many
  • Storage: get/set with global and player-scoped variants
  • Chat: send messages to channels
  • Core: id generation, broadcast to match, send to player
  • All functions properly decode Lua args and encode results
  • 8 new tests, 41 total passing

Test plan

  • rebar3 eunit (41 tests, 0 failures)
  • rebar3 xref
  • rebar3 dialyzer
  • rebar3 fmt --check

Expose engine features to Lua scripts via game.* namespace:
- game.id, game.broadcast, game.send
- game.economy.grant/debit/balance/purchase
- game.leaderboard.submit/top/rank/around
- game.notify, game.notify_many
- game.storage.get/set/player_get/player_set
- game.chat.send

API is automatically installed in asobi_lua_match and asobi_lua_world
init, giving Lua game scripts the same power as Erlang implementations.

8 new tests covering API installation and engine calls.
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