feat: backend state machine, Unity URL prod, simplify GameSetup

This commit is contained in:
2026-05-15 09:16:01 +02:00
parent c322793b0d
commit 1e37e44143
6 changed files with 400 additions and 215 deletions

View File

@@ -12,9 +12,7 @@ public class NetworkManager : MonoBehaviour
{
public static NetworkManager Instance { get; private set; }
[Header("Connection")]
[Tooltip("Colyseus server endpoint (overridden by frontend via SetServerURL)")]
public string serverURL = "ws://localhost:2567";
private const string serverURL = "wss://rolld.io:2567";
[Header("Prefab")]
[Tooltip("Prefab for remote players (must have RemotePlayerController)")]
@@ -94,13 +92,6 @@ public class NetworkManager : MonoBehaviour
}
}
/// <summary>Called from frontend JS via SendMessage to override the server URL.</summary>
public void SetServerURL(string url)
{
serverURL = url;
Debug.Log($"[Network] Server URL set to: {url}");
}
public NetworkPlayer GetLocalPlayerState()
{
if (_room == null || _room.State.players == null || string.IsNullOrEmpty(LocalSessionId)) return null;