From 0ab00afd37c199a4effa3efc0a84a316ab873c26 Mon Sep 17 00:00:00 2001 From: god Date: Sun, 5 Jul 2026 12:58:23 +0800 Subject: [PATCH] docs: add jump-to-top links below all section headings --- server/nakama/lua/README.md | 324 ++++++++++++++++++++++++++++++++++++ 1 file changed, 324 insertions(+) diff --git a/server/nakama/lua/README.md b/server/nakama/lua/README.md index 88325da..98de4ae 100644 --- a/server/nakama/lua/README.md +++ b/server/nakama/lua/README.md @@ -1,9 +1,15 @@ # Tekton Nakama Lua Server API Reference + + + > Auto-generated from source code. For AI agents -- call these RPCs without reading Lua. ## Table of Contents +[↑ Back to top](#top) + + 1. [Authentication & Core (core.lua)](#1-authentication--core-coreluau) 2. [Utilities (utils.lua)](#2-utilities-utilsluau) 3. [User Module (user.lua)](#3-user-module-userluau) @@ -22,8 +28,14 @@ ## 1. Authentication & Core (`core.lua`) +[↑ Back to top](#top) + + ### After-Hook: `after_authenticate_steam` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Trigger** | `AuthenticateSteam` | @@ -36,6 +48,9 @@ ### Startup (not an RPC) +[↑ Back to top](#top) + + ``` nk.leaderboard_create("global_high_score", true, "desc", "best", nil, {}) ``` @@ -46,10 +61,16 @@ Creates native leaderboard `"global_high_score"` on module load (also created in ## 2. Utilities (`utils.lua`) +[↑ Back to top](#top) + + Shared helpers used by other modules. ### Constants +[↑ Back to top](#top) + + | Constant | Value | Purpose | |---|---|---| | `ADMIN_ROLES` | `{admin=true, moderator=true, owner=true}` | Roles with admin privileges | @@ -60,6 +81,9 @@ Shared helpers used by other modules. ### `utils.is_admin(context)` +[↑ Back to top](#top) + + Checks if caller has admin/moderator/owner role. | Param | Type | Description | @@ -70,6 +94,9 @@ Checks if caller has admin/moderator/owner role. ### `utils.is_match_host(context, match_id)` +[↑ Back to top](#top) + + Checks if caller is the host of a match. | Param | Type | Description | @@ -82,14 +109,23 @@ Checks if caller is the host of a match. ### `utils.require_admin(context)` +[↑ Back to top](#top) + + Errors with `"Admin privileges required"` if caller is not admin/moderator/owner. ### `utils.require_admin_or_host(context, match_id)` +[↑ Back to top](#top) + + Errors with `"Admin or host privileges required"` if caller is neither admin nor match host. ### `utils.resolve_channel_id(channel_id)` +[↑ Back to top](#top) + + Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channel ID. | Param | Type | Description | @@ -103,8 +139,14 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ## 3. User Module (`user.lua`) +[↑ Back to top](#top) + + ### RPC: `get_user_profile` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `user.rpc_get_user_profile` | @@ -137,6 +179,9 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ### RPC: `update_user_profile` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `user.rpc_update_user_profile` | @@ -162,6 +207,9 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ### RPC: `search_users` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `user.rpc_search_users` | @@ -193,6 +241,9 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ### RPC: `change_credentials` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `user.rpc_change_credentials` | @@ -223,6 +274,9 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ### RPC: `send_lobby_invite` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `user.rpc_send_lobby_invite` | @@ -250,6 +304,9 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ### RPC: `send_friend_request` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `user.rpc_send_friend_request` | @@ -277,6 +334,9 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ### RPC: `admin_get_user_history` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `user.rpc_admin_get_user_history` | @@ -303,6 +363,9 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ### After-Hook: `after_authenticate` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Trigger** | `AuthenticateDevice`, `AuthenticateEmail`, `AuthenticateCustom` | @@ -314,8 +377,14 @@ Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channe ## 4. Economy Module (`economy.lua`) +[↑ Back to top](#top) + + ### Shop Catalog +[↑ Back to top](#top) + + Hardcoded items available for purchase: | ID | Name | Category | Gold | Star | Rarity | Character | @@ -335,6 +404,9 @@ Hardcoded items available for purchase: ### RPC: `get_shop_catalog` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `economy.rpc_get_shop_catalog` | @@ -354,6 +426,9 @@ Hardcoded items available for purchase: ### RPC: `buy_currency` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `economy.rpc_buy_currency` | @@ -406,6 +481,9 @@ Hardcoded items available for purchase: ### RPC: `purchase_item` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `economy.rpc_purchase_item` | @@ -443,6 +521,9 @@ Hardcoded items available for purchase: ### RPC: `admin_set_featured_banners` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `economy.rpc_admin_set_featured_banners` | @@ -470,6 +551,9 @@ Hardcoded items available for purchase: ### RPC: `admin_get_featured_banners` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `economy.rpc_admin_get_featured_banners` | @@ -488,8 +572,14 @@ Hardcoded items available for purchase: ## 5. Gacha Module (`gacha.lua`) +[↑ Back to top](#top) + + ### Gacha Banners +[↑ Back to top](#top) + + | Banner ID | Name | Currency | Pull 1 Cost | Pull 10 Cost | Pity At | |---|---|---|---|---|---| | `star` | Star Banner | star | 160 | 1440 | 90 | @@ -497,6 +587,9 @@ Hardcoded items available for purchase: ### Drop Rates +[↑ Back to top](#top) + + | Rarity | Probability | Pool Items | |---|---|---| | `real_prize` | 1.0% | `skin_gacha_rainbow_suit`, `skin_gacha_dragon_hat`, `skin_gacha_phantom_gloves`, `skin_gacha_neon_acc` | @@ -506,6 +599,9 @@ Hardcoded items available for purchase: ### Real Prize Catalog +[↑ Back to top](#top) + + | Item ID | Name | Category | |---|---|---| | `skin_gacha_rainbow_suit` | Rainbow Suit | costume | @@ -515,6 +611,9 @@ Hardcoded items available for purchase: ### Fragment Items +[↑ Back to top](#top) + + | ID | Name | Rarity | |---|---|---| | `frag_common` | Common Fragment | common | @@ -523,6 +622,9 @@ Hardcoded items available for purchase: ### RPC: `perform_gacha_pull` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `gacha.rpc_perform_gacha_pull` | @@ -567,8 +669,14 @@ Hardcoded items available for purchase: ## 6. Leaderboard Module (`leaderboard.lua`) +[↑ Back to top](#top) + + ### Leaderboard Config +[↑ Back to top](#top) + + | Property | Value | |---|---| | **ID** | `"global_high_score"` | @@ -579,6 +687,9 @@ Hardcoded items available for purchase: ### RPC: `get_leaderboard_stats` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `leaderboard.rpc_get_leaderboard_stats` | @@ -608,6 +719,9 @@ Hardcoded items available for purchase: ### RPC: `submit_score` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `leaderboard.rpc_submit_score` | @@ -636,6 +750,9 @@ Hardcoded items available for purchase: ### RPC: `sync_leaderboard` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `leaderboard.rpc_sync_leaderboard` | @@ -661,6 +778,9 @@ Hardcoded items available for purchase: ### RPC: `reset_stats` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `leaderboard.rpc_reset_stats` | @@ -679,6 +799,9 @@ Hardcoded items available for purchase: ### RPC: `admin_update_stats` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `leaderboard.rpc_admin_update_stats` | @@ -706,6 +829,9 @@ Hardcoded items available for purchase: ### RPC: `admin_delete_stats` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `leaderboard.rpc_admin_delete_stats` | @@ -722,6 +848,9 @@ Hardcoded items available for purchase: ### RPC: `admin_sync_leaderboard` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `leaderboard.rpc_admin_sync_leaderboard` | @@ -734,8 +863,14 @@ Hardcoded items available for purchase: ## 7. Inbox/Mail Module (`inbox.lua`) +[↑ Back to top](#top) + + ### RPC: `admin_send_mail` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_admin_send_mail` | @@ -767,6 +902,9 @@ Hardcoded items available for purchase: ### RPC: `get_mail` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_get_mail` | @@ -795,6 +933,9 @@ Hardcoded items available for purchase: ### RPC: `claim_mail_reward` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_claim_mail_reward` | @@ -837,6 +978,9 @@ Array format: `[{type="star", amount=100}, {type="gold", amount=50}, {type="frag ### RPC: `delete_mail` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_delete_mail` | @@ -851,6 +995,9 @@ Array format: `[{type="star", amount=100}, {type="gold", amount=50}, {type="frag ### RPC: `save_mail_state` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_save_mail_state` | @@ -865,6 +1012,9 @@ Array format: `[{type="star", amount=100}, {type="gold", amount=50}, {type="frag ### RPC: `admin_list_mail` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_admin_list_mail` | @@ -881,6 +1031,9 @@ Array format: `[{type="star", amount=100}, {type="gold", amount=50}, {type="frag ### RPC: `admin_update_mail` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_admin_update_mail` | @@ -902,6 +1055,9 @@ Array format: `[{type="star", amount=100}, {type="gold", amount=50}, {type="frag ### RPC: `admin_delete_mail_server` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `inbox.rpc_admin_delete_mail_server` | @@ -920,8 +1076,14 @@ Array format: `[{type="star", amount=100}, {type="gold", amount=50}, {type="frag ## 8. Daily Rewards Module (`daily_rewards.lua`) +[↑ Back to top](#top) + + ### Default Reward Schedule +[↑ Back to top](#top) + + Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. | Day | Reward | @@ -934,6 +1096,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `claim_daily_reward` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `daily_rewards.rpc_claim_daily_reward` | @@ -968,6 +1133,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `get_daily_reward_state` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `daily_rewards.rpc_get_daily_reward_state` | @@ -989,6 +1157,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `set_daily_reward_config` [Admin] +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `daily_rewards.rpc_set_daily_reward_config` | @@ -1003,6 +1174,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `get_daily_reward_config_admin` [Admin] +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `daily_rewards.rpc_get_daily_reward_config_admin` | @@ -1013,8 +1187,14 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ## 9. Admin Module (`admin.lua`) +[↑ Back to top](#top) + + ### RPC: `admin_kick_player` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_kick_player` | @@ -1038,6 +1218,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_ban_player` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_ban_player` | @@ -1063,6 +1246,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_unban_player` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_unban_player` | @@ -1077,6 +1263,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_get_ban_list` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_get_ban_list` | @@ -1085,6 +1274,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_get_server_stats` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_get_server_stats` | @@ -1108,6 +1300,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_end_match` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_end_match` | @@ -1123,6 +1318,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_set_user_role` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_set_user_role` | @@ -1142,6 +1340,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_topup_gold` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_topup_gold` | @@ -1152,6 +1353,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_clear_global_chat` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_clear_global_chat` | @@ -1168,6 +1372,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_list_users` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_list_users` | @@ -1178,6 +1385,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_delete_users` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_delete_users` | @@ -1198,6 +1408,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_get_user_detail` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_get_user_detail` | @@ -1215,6 +1428,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_update_user_identity` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_update_user_identity` | @@ -1236,6 +1452,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_set_user_password` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_set_user_password` | @@ -1255,6 +1474,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_get_player_list` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_get_player_list` | @@ -1263,6 +1485,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_get_chat_config` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_get_chat_config` | @@ -1273,6 +1498,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_set_chat_config` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_set_chat_config` | @@ -1291,6 +1519,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_purge_old_messages` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_purge_old_messages` | @@ -1306,6 +1537,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_list_channel_messages` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_list_channel_messages` | @@ -1323,6 +1557,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### RPC: `admin_delete_channel_message` +[↑ Back to top](#top) + + | Field | Value | |---|---| | **Function** | `admin.rpc_admin_delete_channel_message` | @@ -1340,20 +1577,32 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ## 10. Storage Collections Reference +[↑ Back to top](#top) + + ### Collection: `"shop_config"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `featured_banners` | SYSTEM | 2 (public) | 0 (owner) | `{banners: [{item_id, ...}]}` | ### Collection: `"receipts"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `` | Owner | 1 (owner-read) | 0 (owner) | `{type, package_id/ item_id, status, changeset, receipt, processed_at, ...}` | ### Collection: `"inventory"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `` | Owner | 1 (owner-read) | 0 (owner) | `{category, purchased_at, quantity}` (or `{acquired_via, purchased_at}` for skins) | @@ -1361,6 +1610,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Collection: `"profiles"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `"pity_counters"` | Owner | 1 (owner-read) | 0 (owner) | `{star: N, gold: N}` (per-banner pity) | @@ -1369,12 +1621,18 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Collection: `"history"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `"logins"` | Owner | 0 (no-read) | 0 (owner) | `{logins: [{time, ip}, ...]}` (max 20) | ### Collection: `"stats"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `"game_stats"` | Owner | 1 (owner-read) or 2 (public) | 1 (owner-write) or 0 (owner) | `{games_played, games_won, high_score, total_kills, total_deaths, avatar_url, loadout_character}` | @@ -1382,6 +1640,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Collection: `"inbox"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `"personal"` | Owner | 1 (owner-read) | 0 (owner) | `{mails: [{id, title, content, sender, date, start_date, end_date, expiry_date, rewards, type}]}` | @@ -1389,12 +1650,18 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Collection: `"daily_rewards"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `"state"` | Owner | 1 (owner-read) | 0 (owner) | `{claimed_days: [number], last_claim_date: "YYYY-MM-DD", month: "MM"}` | ### Collection: `"config"` (system-level) +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `"daily_rewards"` | SYSTEM | 2 (public) | 0 (owner) | `{"MM": [{type, amount}, ...]}` (month->rewards map) | @@ -1403,12 +1670,18 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Collection: `"bans"` +[↑ Back to top](#top) + + | Key | User | Permission Read | Permission Write | Schema | |---|---|---|---|---| | `` | SYSTEM | 2 (public) | 0 (owner) | `{user_id, username, banned_by, banned_at, reason, expires}` | ### Collection: `"matches"` (per-user) +[↑ Back to top](#top) + + | Key | User | Permission | Schema | |---|---|---|---| | `` | Owner | 0 (owner) | Match result data (keyed by match ID, varies) | @@ -1417,6 +1690,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ## 11. Leaderboard Config +[↑ Back to top](#top) + + | Property | Value | |---|---| | **ID** | `"global_high_score"` | @@ -1430,8 +1706,14 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ## 12. Error Strings Reference +[↑ Back to top](#top) + + ### Auth errors (raised by utils) +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"Admin privileges required"` | Non-admin calls admin RPC | @@ -1440,6 +1722,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Economy errors +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"Package ID required"` | `buy_currency` called without `package_id` | @@ -1454,6 +1739,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### User errors +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"Account not found"` | User ID doesn't exist | @@ -1469,6 +1757,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Gacha errors +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"Banner ID required"` | Missing `banner_id` | @@ -1481,6 +1772,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Leaderboard errors +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"Failed to submit score"` | Leaderboard write failed | @@ -1489,6 +1783,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Inbox errors +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"mail_id required"` | Missing mail ID | @@ -1500,6 +1797,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Daily reward errors +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"Already claimed today"` | `last_claim_date == today` | @@ -1508,6 +1808,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Admin errors +[↑ Back to top](#top) + + | Error String | Trigger | |---|---| | `"Cannot kick yourself"` | Self-kick attempt | @@ -1532,8 +1835,14 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ## 13. Permission Levels +[↑ Back to top](#top) + + ### Role Hierarchy +[↑ Back to top](#top) + + | Role | Can Call Admin RPCs | Can Modify Roles | Notes | |---|---|---|---| | `"player"` | No | No | Default role | @@ -1543,6 +1852,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Auth Check Functions Summary +[↑ Back to top](#top) + + | Check | What It Allows | |---|---| | `utils.require_admin` | Any RPC gated by this. Roles: admin, moderator, owner | @@ -1551,6 +1863,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### Storage Permission Bits +[↑ Back to top](#top) + + | Value | Meaning | |---|---| | `0` | Owner only (no one can read/write except server) | @@ -1559,6 +1874,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. ### System User ID +[↑ Back to top](#top) + + ``` 00000000-0000-0000-0000-000000000000 ``` @@ -1569,6 +1887,9 @@ Used for global/shared storage collections (bans, config, global_mail, shop_conf ## RPC Summary Table +[↑ Back to top](#top) + + | RPC Name | Module | Auth | Admin? | |---|---|---|---| | `get_user_profile` | user | None | No | @@ -1626,6 +1947,9 @@ Used for global/shared storage collections (bans, config, global_mail, shop_conf ## Wallet Update Summary +[↑ Back to top](#top) + + | Operation | Changeset | Context | |---|---|---| | IAP: gold packages (verified) | `{gold: +N}` | `buy_currency` |