feat: update

This commit is contained in:
2026-06-11 18:28:25 +08:00
parent 8520f9db3c
commit 8a2fb36a98
65 changed files with 4407 additions and 572 deletions
@@ -130,11 +130,31 @@ class AsyncRequest:
else:
return type.create(ns, data.get(result_key))
func _resume_conn(p_err : int):
func _socket_exception_from_error(p_error) -> NakamaException:
if p_error is NakamaException:
return p_error
if typeof(p_error) == TYPE_INT:
var message := "Socket connection failed"
match p_error:
ERR_TIMEOUT:
message = "Socket connection timed out"
ERR_CANT_CONNECT:
message = "Socket connection refused or closed"
ERR_CANT_RESOLVE:
message = "Socket host could not be resolved"
ERR_CONNECTION_ERROR:
message = "Socket connection error"
ERR_UNAVAILABLE:
message = "Socket connection unavailable"
return NakamaException.new(message, p_error)
return NakamaException.new(str(p_error), -1)
func _resume_conn(p_error = OK):
if _conn:
if p_err: # Exception
logger.warning("Connection error: %d" % p_err)
_conn.resume(NakamaAsyncResult.new(NakamaException.new()))
if p_error != OK:
var exception := _socket_exception_from_error(p_error)
logger.warning("Connection error: %s" % exception.message)
_conn.resume(NakamaAsyncResult.new(exception))
else:
logger.info("Connected!")
_conn.resume(NakamaAsyncResult.new())
@@ -16,7 +16,7 @@
[ext_resource type="BoxMesh" uid="uid://b5cc3prem52r6" path="res://addons/enhanced_gridmap/meshlibrary/tile_freeze.tres" id="11_pgnbl"]
[ext_resource type="BoxMesh" uid="uid://dcjdwbffgtutt" path="res://addons/enhanced_gridmap/meshlibrary/tile_non_walkable.tres" id="11_uwjsj"]
[ext_resource type="Texture2D" uid="uid://cdnxwlysxnujd" path="res://assets/textures/tile_heart.png" id="12_heart_tex"]
[ext_resource type="BoxMesh" uid="uid://bj2bvvno3cqh2" path="res://addons/enhanced_gridmap/meshlibrary/tile_sticky.tres" id="13_sticky"]
[ext_resource type="BoxMesh" uid="uid://cqv6ebaxhasr3" path="res://addons/enhanced_gridmap/meshlibrary/tile_sticky.tres" id="13_sticky"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_uxput"]
resource_name = "boost"
@@ -1,4 +1,4 @@
[gd_resource type="BoxMesh" format=3 uid="uid://bj2bvvno3cqh2"]
[gd_resource type="BoxMesh" format=3 uid="uid://cqv6ebaxhasr3"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_sticky"]
transparency = 1