20 Commits

Author SHA1 Message Date
adtpdn 04e40f5b76 feat: edit tiles placement 2026-07-06 19:43:12 +08:00
adtpdn 90ada5ace4 docs: add completed tasks for July 6 to TODO.md 2026-07-06 19:11:31 +08:00
adtpdn ffbc3956ee chore: reset EditorTileReference scale to 1:1 global size for perfectly accurate tile footprint visualization in editor 2026-07-06 19:06:37 +08:00
adtpdn 6dae67fce4 fix: normalize arena root transforms to zero and restructure so EditorTileReference flawlessly aligns with world grid tiles 2026-07-06 18:59:35 +08:00
adtpdn baeb2f6cfc fix: counter-scale EditorTileReference in freemode so it renders correctly despite root 100x scale 2026-07-06 18:31:10 +08:00
adtpdn 7c3e55e904 chore: re-save Stop N Go scene to confirm shadow render priorities 2026-07-06 18:14:29 +08:00
adtpdn 4fd46af3c0 feat: embed tile height placeholder inside arena .tscn files and bake terrain transform shifts natively instead of using code hacks 2026-07-06 18:08:06 +08:00
adtpdn c114dd5175 chore: remove leftover test_mp.gd.uid file 2026-07-06 17:54:58 +08:00
adtpdn b4ac0afda7 chore: clean up temporary test scripts 2026-07-06 17:53:59 +08:00
adtpdn 48b748849b fix: set stop n go arena shadow planes render priority to -1 to prevent z-fighting with tiles 2026-07-06 17:51:27 +08:00
adtpdn f1ef43cb38 fix: adjust safe zone elevation and transparency sorting priority to prevent it covering tiles or clipping with terrain 2026-07-06 17:42:26 +08:00
adtpdn b879c7b684 fix: restrict 0.08 tile elevation exclusively to Stop n Go and Freemode 2026-07-06 17:35:19 +08:00
adtpdn ce515365a7 fix: elevate all gridmap meshes by 0.08 to prevent clipping into terrain shifted at -0.22 2026-07-06 17:31:02 +08:00
adtpdn b86011a6c6 fix: make non-walkable red blocks (Tile 4) invisible in 3D arenas 2026-07-06 16:42:54 +08:00
adtpdn 4bf9f7aee1 fix: adjust arena shift offset to -0.22 based on visual check for freemode and stopngo 2026-07-06 16:34:49 +08:00
adtpdn d3322f14ad fix: lower Stop N Go arena by 0.28 to fix buried tiles 2026-07-06 16:29:05 +08:00
adtpdn adad53e94d fix: resolve static cyclic references and unresolvable script dependencies in editor by retrieving Nakama session via get() and loading Autoloads via get_node_or_null 2026-07-06 16:17:16 +08:00
adtpdn 14d46b8823 fix: shift Freemode 3D arena down to Y=0 to prevent buried tiles, remove deprecated mesh elevation hacks 2026-07-06 16:01:58 +08:00
adtpdn acd927eef6 fix: correct JSON payload key for gacha pull RPC and update gacha panel UI labels 2026-07-06 14:37:22 +08:00
adtpdn af6870f6a9 fix: use https instead of http for gitea API and clones
Release / Build & Release (push) Successful in 15m53s
2026-07-06 13:47:23 +08:00
16 changed files with 5294 additions and 66 deletions
+7 -7
View File
@@ -20,8 +20,8 @@ jobs:
- name: Checkout Code - name: Checkout Code
run: | run: |
git config --global credential.helper store git config --global credential.helper store
echo "http://god:${{ secrets.TEKTON_RELEASE_TOKEN }}@git.klud.top" > ~/.git-credentials echo "https://god:${{ secrets.TEKTON_RELEASE_TOKEN }}@git.klud.top" > ~/.git-credentials
git clone http://git.klud.top/danchie/tekton.git . git clone https://git.klud.top/danchie/tekton.git .
git checkout $TAG_NAME git checkout $TAG_NAME
- name: Setup Godot (Cached) - name: Setup Godot (Cached)
@@ -85,7 +85,7 @@ jobs:
- name: Create Gitea Release - name: Create Gitea Release
run: | run: |
set -e set -e
API="http://git.klud.top/api/v1/repos/danchie/tekton/releases" API="https://git.klud.top/api/v1/repos/danchie/tekton/releases"
TAG="$TAG_NAME" TAG="$TAG_NAME"
echo "Checking existing release for $TAG..." echo "Checking existing release for $TAG..."
RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG" 2>/dev/null || echo "") RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG" 2>/dev/null || echo "")
@@ -116,7 +116,7 @@ jobs:
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: multipart/form-data" \ -H "Content-Type: multipart/form-data" \
-F "attachment=@build/tekton_armageddon_windows_${TAG_NAME}.zip" \ -F "attachment=@build/tekton_armageddon_windows_${TAG_NAME}.zip" \
"http://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets" "https://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
echo "Windows uploaded" echo "Windows uploaded"
- name: Upload Linux asset - name: Upload Linux asset
@@ -126,7 +126,7 @@ jobs:
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: multipart/form-data" \ -H "Content-Type: multipart/form-data" \
-F "attachment=@build/tekton_armageddon_linux_${TAG_NAME}.zip" \ -F "attachment=@build/tekton_armageddon_linux_${TAG_NAME}.zip" \
"http://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets" "https://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
echo "Linux uploaded" echo "Linux uploaded"
- name: Upload macOS asset - name: Upload macOS asset
@@ -137,7 +137,7 @@ jobs:
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: multipart/form-data" \ -H "Content-Type: multipart/form-data" \
-F "attachment=@build/tekton_armageddon_macos_${TAG_NAME}.zip" \ -F "attachment=@build/tekton_armageddon_macos_${TAG_NAME}.zip" \
"http://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets" "https://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
echo "macOS uploaded" echo "macOS uploaded"
else else
echo "macOS asset not built, skipping" echo "macOS asset not built, skipping"
@@ -150,5 +150,5 @@ jobs:
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"draft":false}' \ -d '{"draft":false}' \
"http://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID" "https://git.klud.top/api/v1/repos/danchie/tekton/releases/$RELEASE_ID"
echo "Published: https://git.klud.top/danchie/tekton/releases/tag/$TAG_NAME" echo "Published: https://git.klud.top/danchie/tekton/releases/tag/$TAG_NAME"
+2 -2
View File
@@ -22,7 +22,7 @@ jobs:
env: env:
GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }} GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }}
run: | run: |
git clone --depth 1 http://god:$GITEA_TOKEN@git.klud.top/danchie/tekton.git . git clone --depth 1 https://god:$GITEA_TOKEN@git.klud.top/danchie/tekton.git .
git config user.name "god" git config user.name "god"
git config user.email "god@noreply.git.klud.top" git config user.email "god@noreply.git.klud.top"
@@ -61,7 +61,7 @@ jobs:
git init git init
git config user.name "god" git config user.name "god"
git config user.email "god@noreply.git.klud.top" git config user.email "god@noreply.git.klud.top"
git remote add origin http://god:$GITEA_TOKEN@git.klud.top/danchie/tekton.git git remote add origin https://god:$GITEA_TOKEN@git.klud.top/danchie/tekton.git
git checkout -b patches git checkout -b patches
git add . git add .
git commit -m "patch ${{ github.event.inputs.version }}" git commit -m "patch ${{ github.event.inputs.version }}"
+24
View File
@@ -120,3 +120,27 @@ This document serves as an exhaustive, technical record of all modifications, re
- **Compile Integrity**: Fixed a trailing `_on_doors_update()` call in `lobby_room.gd` leftover from a different branch. Verified flawless compilation via `godot --headless --build-solutions`. - **Compile Integrity**: Fixed a trailing `_on_doors_update()` call in `lobby_room.gd` leftover from a different branch. Verified flawless compilation via `godot --headless --build-solutions`.
- **Gitea Documentation**: Automated the closure and deep-technical documentation of Issues #54, 55, 56, 57, 65, 66, 67, 68, 69, and 70 directly to the tracking server. - **Gitea Documentation**: Automated the closure and deep-technical documentation of Issues #54, 55, 56, 57, 65, 66, 67, 68, 69, and 70 directly to the tracking server.
- **Wiki Accuracy**: Overhauled `Game-Modes.-.md` to perfectly mirror the new Sabotage input maps, Blueprint rules, RPC structures, and Mekton behavior. - **Wiki Accuracy**: Overhauled `Game-Modes.-.md` to perfectly mirror the new Sabotage input maps, Blueprint rules, RPC structures, and Mekton behavior.
### Completed (July 6, 2026)
- [x] **CI Pipeline Fixes**
- [x] Downgraded Godot runner version to 4.6.3 to match local engine build.
- [x] Updated Gitea API and Git clone URLs to use `https://` instead of `http://` to prevent silent redirect failures during release.
- [x] **Runtime & Compilation Crash Fixes**
- [x] Fixed `bot_controller.gd`: Replaced dead `_execute_move()` with proper `enhanced_gridmap.find_path()` logic.
- [x] Fixed `bot_controller.gd` & `player_movement_manager.gd`: Changed `.is_active` to `.active` for CandySurvivalManager checks.
- [x] Fixed `candy_survival_manager.gd`: Merged duplicate `start_game_mode()` implementations.
- [x] Fixed `special_tiles_manager.gd` indentation errors.
- [x] Fixed `main.gd` duplicate variable declarations.
- [x] **Editor & Test Environment Fixes**
- [x] Resolved "Cyclic Reference" errors in `leaderboard_panel.gd` by accessing Nakama session via `get()`.
- [x] Fixed `BackendService.gd` Autoload dependencies failing in isolated tests by using `get_node_or_null()`.
- [x] **Gacha System Fixes**
- [x] Corrected `BackendService.gd` payload to send `"banner_id"` instead of `"gacha_id"`, fixing HTTP 500 errors on pull.
- [x] Configured Unique Names (`%`) for left-side BalanceRow labels in `gacha_panel.tscn` so currency updates instantly upon rolling.
- [x] **3D Arena & GridMap Elevation Fixes**
- [x] Normalized root node transforms of all arenas (`freemode.tscn`, `stop_n_go.scn`, `candy_survival.tscn`) to `(0,0,0)` and scale `(1,1,1)`.
- [x] Removed hardcoded terrain shifts and `0.08` mesh elevations from `main.gd`.
- [x] Added `EditorTileReference` to arena scenes as a perfect 1:1 footprint guide.
- [x] Baked terrain height shifts directly into `.tscn` files to match the reference tile perfectly.
- [x] Scaled red `non-walkable` blocks (Tile 4) to 0 so they act as invisible collision walls in 3D arenas.
- [x] Fixed Stop N Go safe zone clipping by adjusting render priorities (`1` for safe zone, `-1` for baked terrain shadows).
+15 -2
View File
@@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://bx5a31fqhw8h8"] [gd_scene format=3 uid="uid://dmkx71ms3cfc"]
[ext_resource type="PackedScene" uid="uid://h84tka1n1alg" path="res://assets/models/arena/candy_survival/candy_survival_terrain.gltf" id="1_86fyc"] [ext_resource type="PackedScene" uid="uid://h84tka1n1alg" path="res://assets/models/arena/candy_survival/candy_survival_terrain.gltf" id="1_86fyc"]
@@ -24,10 +24,18 @@ albedo_color = Color(0.4973, 0.6, 0.12599999, 1)
material = SubResource("StandardMaterial3D_86fyc") material = SubResource("StandardMaterial3D_86fyc")
size = Vector2(50, 50) size = Vector2(50, 50)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_q8eld"]
transparency = 1
albedo_color = Color(1, 0, 1, 0.5)
[sub_resource type="BoxMesh" id="BoxMesh_l6h1c"]
material = SubResource("StandardMaterial3D_q8eld")
size = Vector3(1, 0.05, 1)
[node name="Candy Survival" type="Node3D" unique_id=1063002869] [node name="Candy Survival" type="Node3D" unique_id=1063002869]
[node name="PlaceholderFloor" type="MeshInstance3D" parent="." unique_id=932640085] [node name="PlaceholderFloor" type="MeshInstance3D" parent="." unique_id=932640085]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, 10) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -0.3, 10)
visible = false visible = false
mesh = SubResource("PlaneMesh_floor") mesh = SubResource("PlaneMesh_floor")
@@ -41,3 +49,8 @@ mesh = SubResource("BoxMesh_cannon")
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1749367969] [node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1749367969]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.192932, 0, 9.441385) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.192932, 0, 9.441385)
mesh = SubResource("PlaneMesh_ugtui") mesh = SubResource("PlaneMesh_ugtui")
[node name="EditorTileReference" type="MeshInstance3D" parent="." unique_id=1116403213]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0)
visible = false
mesh = SubResource("BoxMesh_l6h1c")
+5196 -15
View File
File diff suppressed because one or more lines are too long
Binary file not shown.
+25 -17
View File
@@ -165,43 +165,51 @@ func _instantiate_3d_arena(scene_path: String):
if arena_scene: if arena_scene:
var arena_instance = arena_scene.instantiate() var arena_instance = arena_scene.instantiate()
arena_instance.name = "ArenaEnvironment3D" arena_instance.name = "ArenaEnvironment3D"
# Note: We no longer shift the arena via code (e.g., position.y = -0.22)
# The physical shifts have been baked directly into the .tscn files using EditorTileReference.
add_child(arena_instance) add_child(arena_instance)
move_child(arena_instance, 0) move_child(arena_instance, 0)
# Clean up the EditorTileReference if it was left in the scene
var editor_ref = arena_instance.get_node_or_null("EditorTileReference")
if editor_ref:
editor_ref.queue_free()
print("Instantiated 3D Arena: ", scene_path) print("Instantiated 3D Arena: ", scene_path)
func _hide_ground_tiles(): func _hide_ground_tiles():
# Make normal and auxiliary ground floors invisible # Make normal and auxiliary ground floors invisible
# by shrinking their scale to 0. We EXCLUDE Item 4 (Wall) and 5 (Freeze) # by shrinking their scale to 0. We also hide 4 (non-walkable red block)
# so they can still be seen above the 3D arena. # as 3D arenas provide their own visual boundaries. We EXCLUDE 5 (Freeze).
var em = $EnhancedGridMap var em = $EnhancedGridMap
if em and em.mesh_library: if em and em.mesh_library:
var ml = em.mesh_library.duplicate() var ml = em.mesh_library.duplicate()
for id in [0, 6]: for id in [0, 4, 6]:
# Scale to 0 to hide it without triggering invalid mesh errors # Scale to 0 to hide it without triggering invalid mesh errors
ml.set_item_mesh_transform(id, Transform3D().scaled(Vector3.ZERO)) ml.set_item_mesh_transform(id, Transform3D().scaled(Vector3.ZERO))
em.mesh_library = ml em.mesh_library = ml
print("[Main] Hide tiles 0, 6 via zero-scale transform.") print("[Main] Hide tiles 0, 4, 6 via zero-scale transform.")
func _setup_effect_elevation(): func _setup_effect_elevation():
var em = get_node_or_null("EnhancedGridMap") var em = get_node_or_null("EnhancedGridMap")
if em and em.mesh_library: if em and em.mesh_library:
# USER REQUEST: Do not apply visual Y-elevation for walls in Stop n Go mode
if LobbyManager.game_mode == "Stop n Go":
print("[Main] Stop n Go mode detected: Skipping effect elevation for walls.")
return
var ml = em.mesh_library.duplicate() var ml = em.mesh_library.duplicate()
# Height 0.8: Above 3D arena, but below pickups (Y=1.0) # Now that terrain heights are perfectly aligned inside the .tscn files,
var lift_transform = Transform3D().translated(Vector3(0, 0.28, 0)) # we no longer need to dynamically lift all tiles by 0.08.
# However, we still need to slightly drop TILE_SAFE (id 2) so it
# Lift Wall (4) and Freeze (5) # renders strictly as a floor decal without clipping.
ml.set_item_mesh_transform(4, lift_transform) if LobbyManager.game_mode in ["Stop n Go", "Freemode"]:
ml.set_item_mesh_transform(5, lift_transform) if ml.find_item_by_name("safe_zone") != -1 or 2 in ml.get_item_list():
var id = 2
var current_transform = ml.get_item_mesh_transform(id)
# Push it down by -0.02 so it sits perfectly between terrain and tiles
ml.set_item_mesh_transform(id, Transform3D().translated(Vector3(0, -0.02, 0)) * current_transform)
em.mesh_library = ml em.mesh_library = ml
print("[Main] MeshLibrary elevation applied: Wall(4) and Freeze(5) at Y=0.8")
# Force gridmap cell size to match player logic (1, 0.05, 1) - >0.001 to avoid errors # Force gridmap cell size to match player logic (1, 0.05, 1) - >0.001 to avoid errors
if not em: if not em:
@@ -1276,7 +1284,7 @@ func _create_static_setup(pos: Vector2i, tekton_id: int, shape_idx: int):
if "cell_size" in enhanced_gridmap: if "cell_size" in enhanced_gridmap:
world_pos = Vector3( world_pos = Vector3(
pos.x * enhanced_gridmap.cell_size.x + enhanced_gridmap.cell_size.x / 2, pos.x * enhanced_gridmap.cell_size.x + enhanced_gridmap.cell_size.x / 2,
0.28, # Match the 0.28 elevation of the arena floor 0.0, # Floor is now at 0.0 after arena shift
pos.y * enhanced_gridmap.cell_size.z + enhanced_gridmap.cell_size.z / 2 pos.y * enhanced_gridmap.cell_size.z + enhanced_gridmap.cell_size.z / 2
) )
stand.global_position = world_pos stand.global_position = world_pos
+4 -2
View File
@@ -293,7 +293,8 @@ size_flags_horizontal = 0
size_flags_vertical = 4 size_flags_vertical = 4
texture = ExtResource("tex_gold") texture = ExtResource("tex_gold")
[node name="GoldLabel" type="Label" parent="MainMargin/MainVBox/ContentHBox/LeftPanel/LeftMargin/LeftVBox/BalanceRow/GoldPanel/MarginContainer/HBoxContainer" unique_id=1159494172] [node name="LeftGoldLabel" type="Label" parent="MainMargin/MainVBox/ContentHBox/LeftPanel/LeftMargin/LeftVBox/BalanceRow/GoldPanel/MarginContainer/HBoxContainer" unique_id=1159494172]
unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_fonts/font = ExtResource("3_font") theme_override_fonts/font = ExtResource("3_font")
@@ -327,7 +328,8 @@ size_flags_horizontal = 0
size_flags_vertical = 4 size_flags_vertical = 4
texture = ExtResource("tex_star") texture = ExtResource("tex_star")
[node name="StarLabel" type="Label" parent="MainMargin/MainVBox/ContentHBox/LeftPanel/LeftMargin/LeftVBox/BalanceRow/StarPanel/MarginContainer/HBoxContainer" unique_id=1357103504] [node name="LeftStarLabel" type="Label" parent="MainMargin/MainVBox/ContentHBox/LeftPanel/LeftMargin/LeftVBox/BalanceRow/StarPanel/MarginContainer/HBoxContainer" unique_id=1357103504]
unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_fonts/font = ExtResource("3_font") theme_override_fonts/font = ExtResource("3_font")
+2 -1
View File
@@ -40,7 +40,8 @@ func pull(banner_id: String, count: int) -> Array:
var result = await BackendService.perform_gacha_pull(banner_id, count) var result = await BackendService.perform_gacha_pull(banner_id, count)
if result.get("success", false) == false: if result.get("success", false) == false:
var msg = str(result.get("error", "Unknown error")) var err_val = result.get("error", "Unknown error")
var msg = result.get("message", str(err_val))
push_error("[GachaManager] Gacha pull failed: " + msg) push_error("[GachaManager] Gacha pull failed: " + msg)
return [] return []
+2
View File
@@ -674,6 +674,8 @@ func _animate_safe_zone_appear():
# Duplicate mesh+material so we animate without touching the shared .tres on disk. # Duplicate mesh+material so we animate without touching the shared .tres on disk.
var anim_mat: StandardMaterial3D = mat.duplicate() var anim_mat: StandardMaterial3D = mat.duplicate()
anim_mat.albedo_color = Color(mat.albedo_color.r, mat.albedo_color.g, mat.albedo_color.b, 0.0) anim_mat.albedo_color = Color(mat.albedo_color.r, mat.albedo_color.g, mat.albedo_color.b, 0.0)
# Force render priority so the transparent decal correctly sorts over the terrain
anim_mat.render_priority = 1
var anim_mesh = original_mesh.duplicate() var anim_mesh = original_mesh.duplicate()
anim_mesh.material = anim_mat anim_mesh.material = anim_mat
+4 -4
View File
@@ -65,12 +65,12 @@ func _initialize_steamworks_for_auth() -> void:
push_error("BackendService: Failed to load Steamworks manager") push_error("BackendService: Failed to load Steamworks manager")
func _initialize_nakama() -> void: func _initialize_nakama() -> void:
nakama_backend = NakamaManager nakama_backend = get_node_or_null("/root/NakamaManager")
if nakama_backend: if nakama_backend:
_connect_nakama_signals() _connect_nakama_signals()
print("BackendService: Initialized Nakama backend") print("BackendService: Initialized Nakama backend")
else: else:
push_error("BackendService: NakamaManager not found") push_error("BackendService: NakamaManager not found at /root/NakamaManager")
func _connect_nakama_signals() -> void: func _connect_nakama_signals() -> void:
pass pass
@@ -181,8 +181,8 @@ func respond_friend_request(target_id: String, accept: bool) -> Dictionary:
var payload = JSON.stringify({"target_user_id": target_id, "accept": accept}) var payload = JSON.stringify({"target_user_id": target_id, "accept": accept})
return await api_rpc_async("respond_friend_request", payload) return await api_rpc_async("respond_friend_request", payload)
func perform_gacha_pull(gacha_id: String, count: int) -> Dictionary: func perform_gacha_pull(banner_id: String, count: int) -> Dictionary:
var payload = JSON.stringify({"gacha_id": gacha_id, "count": count}) var payload = JSON.stringify({"banner_id": banner_id, "count": count})
return await api_rpc_async("perform_gacha_pull", payload) return await api_rpc_async("perform_gacha_pull", payload)
func get_mail(payload: String = "{}") -> Dictionary: func get_mail(payload: String = "{}") -> Dictionary:
+7
View File
@@ -12,6 +12,8 @@ signal closed
@onready var banner_label := %BannerLabel as Label @onready var banner_label := %BannerLabel as Label
@onready var gold_label := %GoldLabel as Label @onready var gold_label := %GoldLabel as Label
@onready var star_label := %StarLabel as Label @onready var star_label := %StarLabel as Label
@onready var left_gold_label := %LeftGoldLabel as Label
@onready var left_star_label := %LeftStarLabel as Label
@onready var pity_label := %PityLabel as Label @onready var pity_label := %PityLabel as Label
@onready var pull_1_btn := %Pull1Btn as Button @onready var pull_1_btn := %Pull1Btn as Button
@onready var pull_10_btn := %Pull10Btn as Button @onready var pull_10_btn := %Pull10Btn as Button
@@ -142,6 +144,11 @@ func _refresh_ui() -> void:
star_label.text = str(UserProfileManager.wallet.get("star", 0)) star_label.text = str(UserProfileManager.wallet.get("star", 0))
gold_label.text = str(UserProfileManager.wallet.get("gold", 0)) gold_label.text = str(UserProfileManager.wallet.get("gold", 0))
if left_star_label:
left_star_label.text = str(UserProfileManager.wallet.get("star", 0))
if left_gold_label:
left_gold_label.text = str(UserProfileManager.wallet.get("gold", 0))
pity_label.text = "Pity: %d / %d" % [pity, pity_at] pity_label.text = "Pity: %d / %d" % [pity, pity_at]
cost_1_label.text = "%s %d" % [icon, c1] cost_1_label.text = "%s %d" % [icon, c1]
cost_10_label.text = "%s %d" % [icon, c10] cost_10_label.text = "%s %d" % [icon, c10]
+6 -6
View File
@@ -71,7 +71,7 @@ func show_panel() -> void:
show() show()
status_label.text = "Syncing scores..." status_label.text = "Syncing scores..."
# Bulk-sync all users' storage stats to native leaderboard (server-side operation) # Bulk-sync all users' storage stats to native leaderboard (server-side operation)
if NakamaManager.session: if NakamaManager.get("session"):
var sync_result = await BackendService.sync_leaderboard() var sync_result = await BackendService.sync_leaderboard()
if sync_result.get("success", false) == false: if sync_result.get("success", false) == false:
push_error("[Leaderboard] sync_leaderboard RPC failed: " + str(sync_result.get("error", ""))) push_error("[Leaderboard] sync_leaderboard RPC failed: " + str(sync_result.get("error", "")))
@@ -87,7 +87,7 @@ func _on_close_pressed() -> void:
# Data # Data
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
func _fetch_leaderboard_data() -> void: func _fetch_leaderboard_data() -> void:
if not NakamaManager.session: if not NakamaManager.get("session"):
status_label.text = "Not connected to Nakama" status_label.text = "Not connected to Nakama"
return return
@@ -115,7 +115,7 @@ func _fetch_leaderboard_data() -> void:
func _fetch_native_leaderboard() -> Array: func _fetch_native_leaderboard() -> Array:
"""Use the Nakama client API to list native leaderboard records directly.""" """Use the Nakama client API to list native leaderboard records directly."""
var result = await NakamaManager.client.list_leaderboard_records_async( var result = await NakamaManager.client.list_leaderboard_records_async(
NakamaManager.session, NakamaManager.get("session"),
"global_high_score", "global_high_score",
[], # no specific owner filter [], # no specific owner filter
null, # expiry = null (no filter) null, # expiry = null (no filter)
@@ -133,7 +133,7 @@ func _fetch_native_leaderboard() -> Array:
var parsed = JSON.parse_string(record.metadata) var parsed = JSON.parse_string(record.metadata)
if parsed is Dictionary: if parsed is Dictionary:
meta = parsed meta = parsed
if record.owner_id == NakamaManager.session.user_id: if record.owner_id == NakamaManager.get("session").user_id:
print("[Leaderboard] Local player meta: ", meta) print("[Leaderboard] Local player meta: ", meta)
data.append({ data.append({
@@ -177,9 +177,9 @@ func _calculate_win_rates() -> void:
entry["win_rate"] = float(won) / float(played) * 100.0 if played > 0 else 0.0 entry["win_rate"] = float(won) / float(played) * 100.0 if played > 0 else 0.0
func _apply_local_overrides(data: Array) -> void: func _apply_local_overrides(data: Array) -> void:
if not NakamaManager.session: if not NakamaManager.get("session"):
return return
var my_id = NakamaManager.session.user_id var my_id = NakamaManager.get("session").user_id
for entry in data: for entry in data:
if entry.get("user_id") == my_id: if entry.get("user_id") == my_id:
entry["display_name"] = UserProfileManager.get_display_name(entry.get("display_name", "Unknown")) entry["display_name"] = UserProfileManager.get_display_name(entry.get("display_name", "Unknown"))
-4
View File
@@ -1,4 +0,0 @@
extends SceneTree
func _init():
print("Testing candy_survival multiplayer")
quit()
-1
View File
@@ -1 +0,0 @@
uid://ddniv6k6aj2u
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/expect -f
spawn ssh admin@193.180.213.215 "ls -la /home/admin/nakama/data/modules/"
expect "password:"
send "Mieayamtelur17\r"
expect eof