コード例 #1
0
ファイル: Game.cs プロジェクト: tim-low/SSAD-game-server
        public void StartNewCycle()
        {
            Reset();
            Board.ClearInaccessible();
            if (Questions.Count() == 0)
            {
                EndGame();
                return;
            }
            // Broadcast to ask all player to do quiz
            var quizAck = new StartQuizAck()
            {
                DurationInSec = Duration,
                Question      = Questions.Peek()
            };

            Broadcast(quizAck.CreatePacket());
            StartQuizTimer();
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: tim-low/SSAD-game-server
 public void AcknowlegeInitialized(GameClient client)
 {
     PlayerManager.PlayerAcknowledge(client);
     if (PlayerManager.CanSendInitializeAck())
     {
         var ack = new InitializeGameAck()
         {
             PlayerSequence = PlayerManager.GetPlayers().ToArray(),
             GameTurn       = TotalQuestion
         };
         Broadcast(ack.CreatePacket());
         var ack2 = new StartQuizAck()
         {
             DurationInSec = Duration,
             Question      = Questions.Peek()
         };
         Broadcast(ack2.CreatePacket());
         // Start Quiz Timer here
         StartQuizTimer();
     }
 }