From 55cf4aa1ed0d21119ded0fa295ffa9269d32567f Mon Sep 17 00:00:00 2001 From: opti1337 Date: Wed, 30 Oct 2024 00:19:13 +0300 Subject: [PATCH] upd --- Assets/scenes/minimal.scene | 3 ++- Code/KPTLConnect.cs | 8 +++++--- kakozuzo_2.sbproj | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Assets/scenes/minimal.scene b/Assets/scenes/minimal.scene index 72ea5da..88e9f84 100644 --- a/Assets/scenes/minimal.scene +++ b/Assets/scenes/minimal.scene @@ -6,6 +6,7 @@ "Flags": 0, "Name": "NetworkManager", "Enabled": true, + "NetworkMode": 0, "Components": [ { "__type": "Sandbox.SceneInformation", @@ -16,7 +17,7 @@ }, { "__type": "Sandbox.KPTLConnect", - "__guid": "f04f8f05-a397-4270-a980-0af80440178e", + "__guid": "895b0f93-287e-4607-808e-6ce5bdbb5c05", "PlayerPrefab": { "_type": "gameobject", "prefab": "prefabs/player.prefab" diff --git a/Code/KPTLConnect.cs b/Code/KPTLConnect.cs index 00c5637..5cf74c0 100644 --- a/Code/KPTLConnect.cs +++ b/Code/KPTLConnect.cs @@ -25,9 +25,9 @@ public sealed class KPTLConnect : Component, Component.INetworkListener LoadingScreen.Title = "Creating Lobby"; await Task.DelayRealtimeSeconds( 0.1f ); Networking.CreateLobby(); - } else + } else if (!StartServer && !Networking.IsActive) { - string lobbyId = await Http.RequestStringAsync( "https://sbox.koptilnya.xyz/string" ); + string lobbyId = await Http.RequestStringAsync( "https://sbox.koptilnya.xyz" ); Networking.Connect(lobbyId); } } @@ -63,7 +63,9 @@ public sealed class KPTLConnect : Component, Component.INetworkListener var lobbyList = await Networking.QueryLobbies(); - await Http.RequestAsync( $"https://sbox.koptilnya.xyz/string?text={lobbyList[0].LobbyId}", "POST" ); + await Http.RequestAsync( $"https://sbox.koptilnya.xyz/?text={lobbyList[0].LobbyId}", "POST" ); + + Log.Info( "Lobby ID updated successfully!" ); } /// diff --git a/kakozuzo_2.sbproj b/kakozuzo_2.sbproj index 19f54f2..8cbc917 100644 --- a/kakozuzo_2.sbproj +++ b/kakozuzo_2.sbproj @@ -24,6 +24,6 @@ "CsProjName": "", "StartupScene": "scenes/minimal.scene", "MapStartupScene": "scenes/minimal.scene", - "LaunchMode": "Launcher" + "LaunchMode": "Normal" } } \ No newline at end of file