attempt to make stop n go gamemode
This commit is contained in:
@@ -51,15 +51,16 @@ func connect_to_nakama_async(email: String = "", password: String = "") -> bool:
|
||||
# 1. Authenticate
|
||||
if email == "":
|
||||
var device_id = OS.get_unique_id()
|
||||
# For testing, append a random number to device ID to simulate unique users on one machine
|
||||
device_id = device_id + str(randi())
|
||||
# Use a more stable ID for testing instead of randi() every call
|
||||
# If you need multiple clients on one machine, consider a command line arg or config
|
||||
session = await client.authenticate_device_async(device_id)
|
||||
else:
|
||||
session = await client.authenticate_email_async(email, password)
|
||||
|
||||
if session.is_exception():
|
||||
printerr("Auth Error: ", session.get_exception().message)
|
||||
emit_signal("connection_failed", session.get_exception().message)
|
||||
var err = session.get_exception()
|
||||
printerr("[NakamaManager] Auth Error: %s (Code: %s)" % [err.message, err.status_code])
|
||||
emit_signal("connection_failed", err.message)
|
||||
return false
|
||||
|
||||
# 2. Connect Socket
|
||||
@@ -67,8 +68,9 @@ func connect_to_nakama_async(email: String = "", password: String = "") -> bool:
|
||||
var socket_result = await socket.connect_async(session)
|
||||
|
||||
if socket_result.is_exception():
|
||||
printerr("Socket Error: ", socket_result.get_exception().message)
|
||||
emit_signal("connection_failed", socket_result.get_exception().message)
|
||||
var err = socket_result.get_exception()
|
||||
printerr("[NakamaManager] Socket Error: %s (Code: %s)" % [err.message, err.status_code])
|
||||
emit_signal("connection_failed", err.message)
|
||||
return false
|
||||
|
||||
# 3. Initialize Multiplayer Bridge
|
||||
|
||||
Reference in New Issue
Block a user