示例#1
0
	public static GK_TBM_Match ParceMatchInfo(string[] MatchData, int index) {
		GK_TBM_Match mtach = new GK_TBM_Match();
		
		mtach.Id = MatchData[index];
		mtach.Status = (GK_TurnBasedMatchStatus)  System.Convert.ToInt64(MatchData[index + 1]) ;
		mtach.Message = MatchData[index + 2];
		mtach.CreationTimestamp = DateTime.Parse(MatchData[index + 3]);
		mtach.SetData(MatchData[index + 4]);

		string currentPlayerId = MatchData[index + 5];

		mtach.Participants =  GameCenterManager.ParseParticipantsData(MatchData, index + 6); 

		foreach(GK_TBM_Participant participant in mtach.Participants) {
			participant.SetMatchId(mtach.Id);
		}

		mtach.CurrentParticipant = mtach.GetParticipantByPlayerId(currentPlayerId);

		return mtach;
	}
示例#2
0
    private void OnUpdateMatchResult(string data)
    {
        string[] DataArray = data.Split(SA.Common.Data.Converter.DATA_SPLITTER);

        GK_TBM_MatchDataUpdateResult result;
        string       matchId = DataArray[0];
        GK_TBM_Match m       = GetMatchById(matchId);

        if (m == null)
        {
            SA.Common.Models.Error e = new SA.Common.Models.Error(0, "Match with id: " + matchId + " not found");
            result = new GK_TBM_MatchDataUpdateResult(e);
        }
        else
        {
            m.SetData(DataArray[1]);
            result = new GK_TBM_MatchDataUpdateResult(m);
        }

        ActionMatchDataUpdated(result);
    }
示例#3
0
	private void OnUpdateMatchResult(string data) {
		string[] DataArray = data.Split(IOSNative.DATA_SPLITTER[0]);

		GK_TBM_MatchDataUpdateResult result;
		string matchId = DataArray[0];
		GK_TBM_Match m = GetMatchById(matchId);

		if(m == null) {
			result =  new GK_TBM_MatchDataUpdateResult();
			ISN_Error e =  new ISN_Error();
			e.code = 0;
			e.description = "Match with id: " + matchId + " not found";
			result.SetError(e);
			Debug.LogWarning(e.description);
		} else {
			m.SetData(DataArray[1]);
			result =  new GK_TBM_MatchDataUpdateResult(m);
		}

		ActionMatchDataUpdated(result);
	}