docs: add jump-to-top links below all section headings

2026-07-05 12:58:18 +08:00
parent 6733f9cfc0
commit caae09a09c
+324
@@ -1,9 +1,15 @@
# Tekton Nakama Lua Server API Reference # Tekton Nakama Lua Server API Reference
<a id="top"></a>
> Auto-generated from source code. For AI agents -- call these RPCs without reading Lua. > Auto-generated from source code. For AI agents -- call these RPCs without reading Lua.
## Table of Contents ## Table of Contents
[↑ Back to top](#top)
1. [Authentication & Core (core.lua)](#1-authentication--core-coreluau) 1. [Authentication & Core (core.lua)](#1-authentication--core-coreluau)
2. [Utilities (utils.lua)](#2-utilities-utilsluau) 2. [Utilities (utils.lua)](#2-utilities-utilsluau)
3. [User Module (user.lua)](#3-user-module-userluau) 3. [User Module (user.lua)](#3-user-module-userluau)
@@ -22,8 +28,14 @@
## 1. Authentication & Core (`core.lua`) ## 1. Authentication & Core (`core.lua`)
[↑ Back to top](#top)
### After-Hook: `after_authenticate_steam` ### After-Hook: `after_authenticate_steam`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Trigger** | `AuthenticateSteam` | | **Trigger** | `AuthenticateSteam` |
@@ -36,6 +48,9 @@
### Startup (not an RPC) ### Startup (not an RPC)
[↑ Back to top](#top)
``` ```
nk.leaderboard_create("global_high_score", true, "desc", "best", nil, {}) 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`) ## 2. Utilities (`utils.lua`)
[↑ Back to top](#top)
Shared helpers used by other modules. Shared helpers used by other modules.
### Constants ### Constants
[↑ Back to top](#top)
| Constant | Value | Purpose | | Constant | Value | Purpose |
|---|---|---| |---|---|---|
| `ADMIN_ROLES` | `{admin=true, moderator=true, owner=true}` | Roles with admin privileges | | `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)` ### `utils.is_admin(context)`
[↑ Back to top](#top)
Checks if caller has admin/moderator/owner role. Checks if caller has admin/moderator/owner role.
| Param | Type | Description | | Param | Type | Description |
@@ -70,6 +94,9 @@ Checks if caller has admin/moderator/owner role.
### `utils.is_match_host(context, match_id)` ### `utils.is_match_host(context, match_id)`
[↑ Back to top](#top)
Checks if caller is the host of a match. Checks if caller is the host of a match.
| Param | Type | Description | | Param | Type | Description |
@@ -82,14 +109,23 @@ Checks if caller is the host of a match.
### `utils.require_admin(context)` ### `utils.require_admin(context)`
[↑ Back to top](#top)
Errors with `"Admin privileges required"` if caller is not admin/moderator/owner. Errors with `"Admin privileges required"` if caller is not admin/moderator/owner.
### `utils.require_admin_or_host(context, match_id)` ### `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. Errors with `"Admin or host privileges required"` if caller is neither admin nor match host.
### `utils.resolve_channel_id(channel_id)` ### `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. Resolves a friendly room name (e.g. `"social_global"`) to a hashed Nakama channel ID.
| Param | Type | Description | | 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`) ## 3. User Module (`user.lua`)
[↑ Back to top](#top)
### RPC: `get_user_profile` ### RPC: `get_user_profile`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `user.rpc_get_user_profile` | | **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` ### RPC: `update_user_profile`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `user.rpc_update_user_profile` | | **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` ### RPC: `search_users`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `user.rpc_search_users` | | **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` ### RPC: `change_credentials`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `user.rpc_change_credentials` | | **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` ### RPC: `send_lobby_invite`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `user.rpc_send_lobby_invite` | | **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` ### RPC: `send_friend_request`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `user.rpc_send_friend_request` | | **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` ### RPC: `admin_get_user_history`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `user.rpc_admin_get_user_history` | | **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` ### After-Hook: `after_authenticate`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Trigger** | `AuthenticateDevice`, `AuthenticateEmail`, `AuthenticateCustom` | | **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`) ## 4. Economy Module (`economy.lua`)
[↑ Back to top](#top)
### Shop Catalog ### Shop Catalog
[↑ Back to top](#top)
Hardcoded items available for purchase: Hardcoded items available for purchase:
| ID | Name | Category | Gold | Star | Rarity | Character | | ID | Name | Category | Gold | Star | Rarity | Character |
@@ -335,6 +404,9 @@ Hardcoded items available for purchase:
### RPC: `get_shop_catalog` ### RPC: `get_shop_catalog`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `economy.rpc_get_shop_catalog` | | **Function** | `economy.rpc_get_shop_catalog` |
@@ -354,6 +426,9 @@ Hardcoded items available for purchase:
### RPC: `buy_currency` ### RPC: `buy_currency`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `economy.rpc_buy_currency` | | **Function** | `economy.rpc_buy_currency` |
@@ -406,6 +481,9 @@ Hardcoded items available for purchase:
### RPC: `purchase_item` ### RPC: `purchase_item`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `economy.rpc_purchase_item` | | **Function** | `economy.rpc_purchase_item` |
@@ -443,6 +521,9 @@ Hardcoded items available for purchase:
### RPC: `admin_set_featured_banners` ### RPC: `admin_set_featured_banners`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `economy.rpc_admin_set_featured_banners` | | **Function** | `economy.rpc_admin_set_featured_banners` |
@@ -470,6 +551,9 @@ Hardcoded items available for purchase:
### RPC: `admin_get_featured_banners` ### RPC: `admin_get_featured_banners`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `economy.rpc_admin_get_featured_banners` | | **Function** | `economy.rpc_admin_get_featured_banners` |
@@ -488,8 +572,14 @@ Hardcoded items available for purchase:
## 5. Gacha Module (`gacha.lua`) ## 5. Gacha Module (`gacha.lua`)
[↑ Back to top](#top)
### Gacha Banners ### Gacha Banners
[↑ Back to top](#top)
| Banner ID | Name | Currency | Pull 1 Cost | Pull 10 Cost | Pity At | | Banner ID | Name | Currency | Pull 1 Cost | Pull 10 Cost | Pity At |
|---|---|---|---|---|---| |---|---|---|---|---|---|
| `star` | Star Banner | star | 160 | 1440 | 90 | | `star` | Star Banner | star | 160 | 1440 | 90 |
@@ -497,6 +587,9 @@ Hardcoded items available for purchase:
### Drop Rates ### Drop Rates
[↑ Back to top](#top)
| Rarity | Probability | Pool Items | | Rarity | Probability | Pool Items |
|---|---|---| |---|---|---|
| `real_prize` | 1.0% | `skin_gacha_rainbow_suit`, `skin_gacha_dragon_hat`, `skin_gacha_phantom_gloves`, `skin_gacha_neon_acc` | | `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 ### Real Prize Catalog
[↑ Back to top](#top)
| Item ID | Name | Category | | Item ID | Name | Category |
|---|---|---| |---|---|---|
| `skin_gacha_rainbow_suit` | Rainbow Suit | costume | | `skin_gacha_rainbow_suit` | Rainbow Suit | costume |
@@ -515,6 +611,9 @@ Hardcoded items available for purchase:
### Fragment Items ### Fragment Items
[↑ Back to top](#top)
| ID | Name | Rarity | | ID | Name | Rarity |
|---|---|---| |---|---|---|
| `frag_common` | Common Fragment | common | | `frag_common` | Common Fragment | common |
@@ -523,6 +622,9 @@ Hardcoded items available for purchase:
### RPC: `perform_gacha_pull` ### RPC: `perform_gacha_pull`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `gacha.rpc_perform_gacha_pull` | | **Function** | `gacha.rpc_perform_gacha_pull` |
@@ -567,8 +669,14 @@ Hardcoded items available for purchase:
## 6. Leaderboard Module (`leaderboard.lua`) ## 6. Leaderboard Module (`leaderboard.lua`)
[↑ Back to top](#top)
### Leaderboard Config ### Leaderboard Config
[↑ Back to top](#top)
| Property | Value | | Property | Value |
|---|---| |---|---|
| **ID** | `"global_high_score"` | | **ID** | `"global_high_score"` |
@@ -579,6 +687,9 @@ Hardcoded items available for purchase:
### RPC: `get_leaderboard_stats` ### RPC: `get_leaderboard_stats`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `leaderboard.rpc_get_leaderboard_stats` | | **Function** | `leaderboard.rpc_get_leaderboard_stats` |
@@ -608,6 +719,9 @@ Hardcoded items available for purchase:
### RPC: `submit_score` ### RPC: `submit_score`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `leaderboard.rpc_submit_score` | | **Function** | `leaderboard.rpc_submit_score` |
@@ -636,6 +750,9 @@ Hardcoded items available for purchase:
### RPC: `sync_leaderboard` ### RPC: `sync_leaderboard`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `leaderboard.rpc_sync_leaderboard` | | **Function** | `leaderboard.rpc_sync_leaderboard` |
@@ -661,6 +778,9 @@ Hardcoded items available for purchase:
### RPC: `reset_stats` ### RPC: `reset_stats`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `leaderboard.rpc_reset_stats` | | **Function** | `leaderboard.rpc_reset_stats` |
@@ -679,6 +799,9 @@ Hardcoded items available for purchase:
### RPC: `admin_update_stats` ### RPC: `admin_update_stats`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `leaderboard.rpc_admin_update_stats` | | **Function** | `leaderboard.rpc_admin_update_stats` |
@@ -706,6 +829,9 @@ Hardcoded items available for purchase:
### RPC: `admin_delete_stats` ### RPC: `admin_delete_stats`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `leaderboard.rpc_admin_delete_stats` | | **Function** | `leaderboard.rpc_admin_delete_stats` |
@@ -722,6 +848,9 @@ Hardcoded items available for purchase:
### RPC: `admin_sync_leaderboard` ### RPC: `admin_sync_leaderboard`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `leaderboard.rpc_admin_sync_leaderboard` | | **Function** | `leaderboard.rpc_admin_sync_leaderboard` |
@@ -734,8 +863,14 @@ Hardcoded items available for purchase:
## 7. Inbox/Mail Module (`inbox.lua`) ## 7. Inbox/Mail Module (`inbox.lua`)
[↑ Back to top](#top)
### RPC: `admin_send_mail` ### RPC: `admin_send_mail`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_admin_send_mail` | | **Function** | `inbox.rpc_admin_send_mail` |
@@ -767,6 +902,9 @@ Hardcoded items available for purchase:
### RPC: `get_mail` ### RPC: `get_mail`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_get_mail` | | **Function** | `inbox.rpc_get_mail` |
@@ -795,6 +933,9 @@ Hardcoded items available for purchase:
### RPC: `claim_mail_reward` ### RPC: `claim_mail_reward`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_claim_mail_reward` | | **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` ### RPC: `delete_mail`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_delete_mail` | | **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` ### RPC: `save_mail_state`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_save_mail_state` | | **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` ### RPC: `admin_list_mail`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_admin_list_mail` | | **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` ### RPC: `admin_update_mail`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_admin_update_mail` | | **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` ### RPC: `admin_delete_mail_server`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `inbox.rpc_admin_delete_mail_server` | | **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`) ## 8. Daily Rewards Module (`daily_rewards.lua`)
[↑ Back to top](#top)
### Default Reward Schedule ### Default Reward Schedule
[↑ Back to top](#top)
Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`. Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`.
| Day | Reward | | Day | Reward |
@@ -934,6 +1096,9 @@ Days 1-31, each day gives `star` currency: `min(10 + (day-1)*5, 100)`.
### RPC: `claim_daily_reward` ### RPC: `claim_daily_reward`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `daily_rewards.rpc_claim_daily_reward` | | **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` ### RPC: `get_daily_reward_state`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `daily_rewards.rpc_get_daily_reward_state` | | **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] ### RPC: `set_daily_reward_config` [Admin]
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `daily_rewards.rpc_set_daily_reward_config` | | **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] ### RPC: `get_daily_reward_config_admin` [Admin]
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `daily_rewards.rpc_get_daily_reward_config_admin` | | **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`) ## 9. Admin Module (`admin.lua`)
[↑ Back to top](#top)
### RPC: `admin_kick_player` ### RPC: `admin_kick_player`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_kick_player` | | **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` ### RPC: `admin_ban_player`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_ban_player` | | **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` ### RPC: `admin_unban_player`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_unban_player` | | **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` ### RPC: `admin_get_ban_list`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_get_ban_list` | | **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` ### RPC: `admin_get_server_stats`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_get_server_stats` | | **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` ### RPC: `admin_end_match`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_end_match` | | **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` ### RPC: `admin_set_user_role`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_set_user_role` | | **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` ### RPC: `admin_topup_gold`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_topup_gold` | | **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` ### RPC: `admin_clear_global_chat`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_clear_global_chat` | | **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` ### RPC: `admin_list_users`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_list_users` | | **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` ### RPC: `admin_delete_users`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_delete_users` | | **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` ### RPC: `admin_get_user_detail`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_get_user_detail` | | **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` ### RPC: `admin_update_user_identity`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_update_user_identity` | | **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` ### RPC: `admin_set_user_password`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_set_user_password` | | **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` ### RPC: `admin_get_player_list`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_get_player_list` | | **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` ### RPC: `admin_get_chat_config`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_get_chat_config` | | **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` ### RPC: `admin_set_chat_config`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_set_chat_config` | | **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` ### RPC: `admin_purge_old_messages`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_purge_old_messages` | | **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` ### RPC: `admin_list_channel_messages`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_list_channel_messages` | | **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` ### RPC: `admin_delete_channel_message`
[↑ Back to top](#top)
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Function** | `admin.rpc_admin_delete_channel_message` | | **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 ## 10. Storage Collections Reference
[↑ Back to top](#top)
### Collection: `"shop_config"` ### Collection: `"shop_config"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | Key | User | Permission Read | Permission Write | Schema |
|---|---|---|---|---| |---|---|---|---|---|
| `featured_banners` | SYSTEM | 2 (public) | 0 (owner) | `{banners: [{item_id, ...}]}` | | `featured_banners` | SYSTEM | 2 (public) | 0 (owner) | `{banners: [{item_id, ...}]}` |
### Collection: `"receipts"` ### Collection: `"receipts"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | Key | User | Permission Read | Permission Write | Schema |
|---|---|---|---|---| |---|---|---|---|---|
| `<idempotency_key>` | Owner | 1 (owner-read) | 0 (owner) | `{type, package_id/ item_id, status, changeset, receipt, processed_at, ...}` | | `<idempotency_key>` | Owner | 1 (owner-read) | 0 (owner) | `{type, package_id/ item_id, status, changeset, receipt, processed_at, ...}` |
### Collection: `"inventory"` ### Collection: `"inventory"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | Key | User | Permission Read | Permission Write | Schema |
|---|---|---|---|---| |---|---|---|---|---|
| `<item_id>` | Owner | 1 (owner-read) | 0 (owner) | `{category, purchased_at, quantity}` (or `{acquired_via, purchased_at}` for skins) | | `<item_id>` | 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"` ### Collection: `"profiles"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | Key | User | Permission Read | Permission Write | Schema |
|---|---|---|---|---| |---|---|---|---|---|
| `"pity_counters"` | Owner | 1 (owner-read) | 0 (owner) | `{star: N, gold: N}` (per-banner pity) | | `"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"` ### Collection: `"history"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | Key | User | Permission Read | Permission Write | Schema |
|---|---|---|---|---| |---|---|---|---|---|
| `"logins"` | Owner | 0 (no-read) | 0 (owner) | `{logins: [{time, ip}, ...]}` (max 20) | | `"logins"` | Owner | 0 (no-read) | 0 (owner) | `{logins: [{time, ip}, ...]}` (max 20) |
### Collection: `"stats"` ### Collection: `"stats"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | 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}` | | `"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"` ### Collection: `"inbox"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | 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}]}` | | `"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"` ### Collection: `"daily_rewards"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | 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"}` | | `"state"` | Owner | 1 (owner-read) | 0 (owner) | `{claimed_days: [number], last_claim_date: "YYYY-MM-DD", month: "MM"}` |
### Collection: `"config"` (system-level) ### Collection: `"config"` (system-level)
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | Key | User | Permission Read | Permission Write | Schema |
|---|---|---|---|---| |---|---|---|---|---|
| `"daily_rewards"` | SYSTEM | 2 (public) | 0 (owner) | `{"MM": [{type, amount}, ...]}` (month->rewards map) | | `"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"` ### Collection: `"bans"`
[↑ Back to top](#top)
| Key | User | Permission Read | Permission Write | Schema | | Key | User | Permission Read | Permission Write | Schema |
|---|---|---|---|---| |---|---|---|---|---|
| `<user_id>` | SYSTEM | 2 (public) | 0 (owner) | `{user_id, username, banned_by, banned_at, reason, expires}` | | `<user_id>` | SYSTEM | 2 (public) | 0 (owner) | `{user_id, username, banned_by, banned_at, reason, expires}` |
### Collection: `"matches"` (per-user) ### Collection: `"matches"` (per-user)
[↑ Back to top](#top)
| Key | User | Permission | Schema | | Key | User | Permission | Schema |
|---|---|---|---| |---|---|---|---|
| `<match_id>` | Owner | 0 (owner) | Match result data (keyed by match ID, varies) | | `<match_id>` | 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 ## 11. Leaderboard Config
[↑ Back to top](#top)
| Property | Value | | Property | Value |
|---|---| |---|---|
| **ID** | `"global_high_score"` | | **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 ## 12. Error Strings Reference
[↑ Back to top](#top)
### Auth errors (raised by utils) ### Auth errors (raised by utils)
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"Admin privileges required"` | Non-admin calls admin RPC | | `"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 ### Economy errors
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"Package ID required"` | `buy_currency` called without `package_id` | | `"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 ### User errors
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"Account not found"` | User ID doesn't exist | | `"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 ### Gacha errors
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"Banner ID required"` | Missing `banner_id` | | `"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 ### Leaderboard errors
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"Failed to submit score"` | Leaderboard write failed | | `"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 ### Inbox errors
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"mail_id required"` | Missing mail ID | | `"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 ### Daily reward errors
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"Already claimed today"` | `last_claim_date == today` | | `"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 ### Admin errors
[↑ Back to top](#top)
| Error String | Trigger | | Error String | Trigger |
|---|---| |---|---|
| `"Cannot kick yourself"` | Self-kick attempt | | `"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 ## 13. Permission Levels
[↑ Back to top](#top)
### Role Hierarchy ### Role Hierarchy
[↑ Back to top](#top)
| Role | Can Call Admin RPCs | Can Modify Roles | Notes | | Role | Can Call Admin RPCs | Can Modify Roles | Notes |
|---|---|---|---| |---|---|---|---|
| `"player"` | No | No | Default role | | `"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 ### Auth Check Functions Summary
[↑ Back to top](#top)
| Check | What It Allows | | Check | What It Allows |
|---|---| |---|---|
| `utils.require_admin` | Any RPC gated by this. Roles: admin, moderator, owner | | `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 ### Storage Permission Bits
[↑ Back to top](#top)
| Value | Meaning | | Value | Meaning |
|---|---| |---|---|
| `0` | Owner only (no one can read/write except server) | | `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 ### System User ID
[↑ Back to top](#top)
``` ```
00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000
``` ```
@@ -1569,6 +1887,9 @@ Used for global/shared storage collections (bans, config, global_mail, shop_conf
## RPC Summary Table ## RPC Summary Table
[↑ Back to top](#top)
| RPC Name | Module | Auth | Admin? | | RPC Name | Module | Auth | Admin? |
|---|---|---|---| |---|---|---|---|
| `get_user_profile` | user | None | No | | `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 ## Wallet Update Summary
[↑ Back to top](#top)
| Operation | Changeset | Context | | Operation | Changeset | Context |
|---|---|---| |---|---|---|
| IAP: gold packages (verified) | `{gold: +N}` | `buy_currency` | | IAP: gold packages (verified) | `{gold: +N}` | `buy_currency` |