Skip to content

Commit

Permalink
Implemented support for more than two players
Browse files Browse the repository at this point in the history
  • Loading branch information
b3s1r committed Oct 31, 2020
1 parent 7675148 commit 74bfe53
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Quiscit/Assets/Scripts/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ public class GameServer : NetworkManager
/// </summary>
public JSONNode GameInfos { get; private set; }

/// <summary>
/// The number of player that want to play the game. The Server will wait until that number of players joined the game
/// </summary>
/// \author SWT-P_SS_20_Dixit
public int playersWantToPlay = 2;

/// <summary>
/// The <c>GameManager</c>
/// </summary>
Expand Down Expand Up @@ -108,7 +102,7 @@ public override void OnServerAddPlayer(NetworkConnection conn)

NetworkServer.AddPlayerForConnection(conn, player);

if (numPlayers == playersWantToPlay)
if (numPlayers == GameInfos["playerAmount"])
StartCoroutine(WaitAndStart());
}

Expand Down Expand Up @@ -216,6 +210,7 @@ private void LoadPlayerInfoMockup()
GameInfos.Add("Rounds", "3");
GameInfos.Add("Answer Time", "15");
GameInfos.Add("Picking Time", "15");
GameInfos.Add("playerAmount", "2");
}

/// <summary>
Expand Down

0 comments on commit 74bfe53

Please sign in to comment.