コード例 #1
0
    private void HandleGamePieceSync_One(string[] segments)
    {
        if (MatchHandler.CurrentMatch == null)
        {
            return;
        }

        try
        {
            GamePieceNetworkState netState = new GamePieceNetworkState
                                             (
                segments[3],
                Int32.Parse(segments[4]),
                segments[5],
                segments[6],
                Int32.Parse(segments[7]),
                Int32.Parse(segments[8]),
                Int32.Parse(segments[9]),
                Int32.Parse(segments[10]),
                Int32.Parse(segments[11]),
                Int32.Parse(segments[12]),
                float.Parse(segments[13])
                                             );

            InterEventDispatcher.InvokeGamePieceSyncReceivedEvent
                (new GamePieceSyncReceivedEventArgs(segments[2], netState.ControllerIdentity, netState));
        }

        catch (Exception e) { Debug.Log(e.ToString()); }
    }
コード例 #2
0
    private void HandleNetworkPieceMoveEvent_One(string[] segments)
    {
        try
        {
            InterEventDispatcher.InvokeNetworkGamePieceMoveEvent
                (new NetworkGamePieceMoveEventArgs(segments[2], segments[3], Int32.Parse(segments[4]), Int32.Parse(segments[5])));
        }

        catch (Exception e) { Debug.Log(e.ToString()); }
    }
コード例 #3
0
    private void HandleTurnSync_One(string[] segments)
    { //0#|cmd#|matchId#|controllerId#|stepVal#|lowestStep
        try
        {
            InterEventDispatcher.InvokeTurnStateSyncEvent
                (new TurnStateSyncEventArgs(segments[2], segments[3], Int32.Parse(segments[4]), Int32.Parse(segments[5])));
        }

        catch (Exception e) { Debug.Log(e.ToString()); }
    }
コード例 #4
0
 private void HandleProcessAttack_One(string[] segments)
 {
     try
     {
         InterEventDispatcher.InvokeAttackSyncCompleteEvent
             (new AttackSyncCompleteEventArgs
                 (segments[2], segments[3], segments[4], Int32.Parse(segments[5]), Int32.Parse(segments[6])));
     }
     catch (Exception e) { Debug.Log(e.ToString()); }
 }
コード例 #5
0
        internal static void HandleTurnStateUpdate(string matchId, int turnStep)
        {
            if (m_Matches.ContainsKey(matchId))
            {
                MatchState match = m_Matches[matchId];
                match.TurnState.SetCurrentStep((TurnStep)turnStep);

                InterEventDispatcher.InvokeTurnStateSyncEvent(new TurnStateSyncEventArgs(matchId,
                                                                                         match.TurnState.CurrentPlayerId, (int)match.TurnState.CurrentTurnStep, (int)match.TurnState.LowestTurnStep));
            }
        }
コード例 #6
0
    private void HandleStartMatch_One(string[] segments)
    {
        try
        {
            InterEventDispatcher.InvokeMatchStartEvent
                (new MatchStartEventArgs(segments[2], segments[3]));

            Debug.LogFormat("Match Start Message Received For Match [{0}]", segments[2]);
        }

        catch (Exception e) { Debug.Log(e.ToString()); }
    }
コード例 #7
0
    private void HandleMatchInProgLeft_One(string[] segments)
    {
        MatchState match = MatchHandler.GetMatchById(segments[2]);

        if (match != null)
        {
            PlayerState playerState = match.GetPlayerStateById(segments[3]);
            if (playerState != null)
            {
                InterEventDispatcher.InvokeDCFromMatchInProgressEvent
                    (new DCFromMatchInProgressEventArgs(match, playerState));
            }
        }
    }
コード例 #8
0
        internal static void HandleDisconnectFromMatch(MatchState match, string accountId)
        {
            if (match.InProgress && (match.OpposingPlayerInMatch(accountId) || match.AwaitingPlayerTimeout()))
            {
                if (match.IsParticipantId(accountId))
                {
                    match.BeginDepartureTimer(accountId);
                    InterEventDispatcher.InvokeDCFromMatchInProgressEvent
                        (new DCFromMatchInProgressEventArgs(match, match.GetPlayerStateById(accountId)));
                }

                else
                {
                    RemoveUserFromMatch(match, accountId);
                }
            }

            else
            {
                RemoveUserFromMatch(match, accountId);
            }
        }
コード例 #9
0
 private void HandlePieceSyncComplete_One(string[] segments)
 {
     InterEventDispatcher.InvokeGamePieceSyncCompleteEvent
         (new GamePieceSyncCompleteEventArgs(segments[2], segments[3]));
 }