feat: skin update

This commit is contained in:
2026-04-20 19:32:52 +08:00
parent b492dc99b6
commit f2e14f20f3
28 changed files with 1396 additions and 113 deletions
+27 -1
View File
@@ -1,4 +1,14 @@
extends Node
# ---------------
# Old vs New Name
# ---------------
# Masbro is Dabro
# Bob is Pip
# Gatot is Gatot
# Oldpop is Copper
# ---------------
## UserProfileManager - Manages user profile data with Nakama storage
signal profile_loaded(profile: Dictionary)
@@ -129,7 +139,8 @@ func load_inventory() -> void:
if not result.is_exception() and result.objects:
for obj in result.objects:
inventory.append(obj.key)
if not inventory.has(obj.key):
inventory.append(obj.key)
func load_stats() -> Dictionary:
# Reset stats first to ensure fresh data for new logins
@@ -334,6 +345,21 @@ func fetch_shop_catalog() -> void:
shop_catalog = payload.catalog
emit_signal("profile_updated")
## Admin-only: grants a large amount of gold via a server-authoritative RPC.
## The Nakama function requireAdmin() on the server prevents non-admin abuse.
func admin_topup_gold() -> bool:
if not NakamaManager.session: return false
var result = await NakamaManager.client.rpc_async(
NakamaManager.session,
"admin_topup_gold",
"{}"
)
if result.is_exception():
push_error("[UserProfileManager] Topup failed: ", result.get_exception().message)
return false
await _reload_wallet()
return true
func buy_currency(package_id: String) -> bool:
if not NakamaManager.session: return false