コード例 #1
0
        public bool startTournament(ref RunningTournamentGame game, IIncommingMessage rawMsg)
        {
            if (gameInfo.connectedPeers.Count == 0)
            {
                rawMsg.Respond("Tried to start tournament, but there was not enough players!", ResponseStatus.Failed);
                return(false);
            }

            gameInfo.connectedPeers.ForEach(p => p.Disconnected -= playerDissconnected);
            game = new RunningTournamentGame(gameInfo, ServerUtils.tournamentInfoToGameSpecs(gameInfo.specs), gameInfo.doubleElimination);
            gameInfo.connectedPeers.ForEach(p => p.SendMessage((short)CustomMasterServerMSG.startTournament, gameInfo.specs));
            rawMsg.Respond(gameInfo.specs, ResponseStatus.Success);
            return(true);
        }
コード例 #2
0
 public void setServerVariables(IPeer admin, RunningTournamentGame runningGame)
 {
     isServer      = true;
     this.admin    = admin;
     theTournament = runningGame;
 }