Example #1
0
        private void CreateMatch()
        {
            //Used to track completion of requested spawn
            string uniqueID = Guid.NewGuid().ToString();

            //Specify the match details
            RequestSpawn requestSpawn = new RequestSpawn()
            {
                ProcessAlias = "gameserver",
                SceneName    = "SuperAwesomeGame",
                UniqueID     = uniqueID
            };

            List <UserContainer> matchUsers = new List <UserContainer>();

            //This should check to make sure that the max players is not higher than the number in queue
            //Add the players from the queue into this match:
            for (int i = playerQueue.Count - 1; i >= 0; i--)
            {
                matchUsers.Add(playerQueue[i]);
                playerQueue.RemoveAt(i);
            }

            matchList.Add(new MatchContainer(this, requestSpawn, matchUsers));
        }
Example #2
0
 public MatchContainer(ServerMatchMaking MatchModule, RequestSpawn MatchProperties, List <UserContainer> MatchUsers)
 {
     matchModule     = MatchModule;
     matchProperties = MatchProperties;
     matchModule.gameManager.RequestGameSpawn(matchProperties);
     matchUsers     = MatchUsers;
     matchStartTime = DateTime.UtcNow;
 }