Skip to content

Commit

Permalink
Temporary fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethanm-0371 committed Jan 15, 2025
1 parent 307ab48 commit 3dc2169
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Assets/Resources/Scripts/NetCode/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class GameServer : MonoBehaviour
Queue<(PacketType, object, EndPoint)> functionsQueue = new Queue<(PacketType, object, EndPoint)>();
Dictionary<PacketType, Action<object, EndPoint>> functionsDictionary;

bool gameStarted = false;
bool gameStarted = true;
float netObjsSendFrequency = 2.0f;

private void Awake()
Expand Down Expand Up @@ -246,7 +246,7 @@ public void EndGame()
netObjectsInfo.Clear();

//Send order to change scene
BroadCastPacket(PacketType.ChangeSceneCommand, new Wrappers.ChangeSceneCommand("Lobby"), null);
BroadCastPacket(PacketType.ChangeSceneCommand, new Wrappers.ChangeSceneCommand("Main_Menu"), null);
}

#endregion
Expand Down
6 changes: 4 additions & 2 deletions Assets/Resources/Scripts/Screen/MainMenuScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ private void Awake()
QualitySettings.vSyncCount = 0;

ScenesHandler.Singleton?.SetReady();

if (GameClient.Singleton != null) { Destroy(GameClient.Singleton.gameObject); }
}

public void OnClickHost()
Expand All @@ -32,7 +34,7 @@ public void OnClickHost()
serverGO.GetComponent<GameServer>().Init();
serverGO.GetComponent<GameClient>().Init(IPAddress.Loopback.ToString(), HostUsernameInputField.text);

ScenesHandler.Singleton.LoadScene("Lobby", LoadSceneMode.Single);
ScenesHandler.Singleton.LoadScene("Level_2", LoadSceneMode.Single);
}
public void OnClickJoin()
{
Expand All @@ -45,7 +47,7 @@ public void OnClickJoin()
GameObject clientGO = (GameObject) Instantiate(clientPrefab);
clientGO.GetComponent<GameClient>().Init(IPInputField.text, ClientUsernameInputField.text);

ScenesHandler.Singleton.LoadScene("Lobby", LoadSceneMode.Single);
ScenesHandler.Singleton.LoadScene("Level_2", LoadSceneMode.Single);
}
public void OnClickExit()
{
Expand Down

0 comments on commit 3dc2169

Please sign in to comment.