Ejemplo n.º 1
0
        protected void BroadcastTurnPhaseUpdateToPlayer(Phase p, PacketPhaseUpdate.UpdateKind type)
        {
            PacketPhaseUpdate upd = new PacketPhaseUpdate();

            upd.PhaseUpdateKind = type;
            upd.Phase           = p;
            Log.LogMsg("Broadcast [" + type.ToString() + "] for phase [" + upd.Phase.PhaseName + "]");
            BroadcastToPlayersInGame(upd, true);
        }
Ejemplo n.º 2
0
        protected virtual void OnPhaseEntered(INetworkConnection sender, Packet p)
        {
            PacketPhaseUpdate msg = p as PacketPhaseUpdate;

            if (msg.PhaseUpdateKind == PacketPhaseUpdate.UpdateKind.EnteredWithDelay)
            {
                DateTime when = new DateTime(msg.Phase.ResponseTime, DateTimeKind.Utc);
                TimeSpan len  = when - DateTime.UtcNow;
                Log.LogMsg("Phase [" + msg.Phase.PhaseName + "] will execute in [" + len.TotalSeconds + " seconds]");
                m_PendingPhase = msg.Phase;
            }
            else
            {
                Log.LogMsg("Phase [" + msg.Phase.PhaseName + "] update: [" + msg.PhaseUpdateKind.ToString() + "]");
                m_CurPhase = msg.Phase;
            }

            if (msg.Phase.PhaseID == (int)PhaseId.RoundStartup)
            {
                m_RoundNumber++;
            }

            FirePhaseEntered(this, msg.Phase, msg.PhaseUpdateKind);
        }
Ejemplo n.º 3
0
 protected void BroadcastTurnPhaseUpdateToPlayer(Phase p, PacketPhaseUpdate.UpdateKind type)
 {
     PacketPhaseUpdate upd = new PacketPhaseUpdate();
     upd.PhaseUpdateKind = type;
     upd.Phase = p;
     Log.LogMsg("Broadcast [" + type.ToString() + "] for phase [" + upd.Phase.PhaseName + "]");
     BroadcastToPlayersInGame(upd, true);
 }