public void ShowResultBoard(MatchGameResult matchGameResult) { Debug.Log("Result Board : " + matchGameResult + "/ Match Type : " + (int)BackEndMatchManager.instance.nowMatchType); BackEndMatchManager.instance.GetMyMatchRecord(0, null); foreach (var user in matchGameResult.m_winners) { if (BackEndMatchManager.instance.IsMySessionId(user)) { SoundPlayer.instance.PlaySound("WinSound"); BackEndServerManager.instance.myInfo.point += 30; ResultText.text = "승리"; ScoreText.text = BackEndServerManager.instance.myInfo.point + "+(30)"; } } foreach (var user in matchGameResult.m_losers) { if (BackEndMatchManager.instance.IsMySessionId(user)) { BackEndServerManager.instance.myInfo.point += 18; ResultText.text = "패배"; ScoreText.text = BackEndServerManager.instance.myInfo.point + "+(18)"; } } PlayerStats.instance.SavePoint(); Invoke("StartShowResult", 2f); }
private MatchGameResult OneOnOneRecord(Stack <SessionId> record) { MatchGameResult nowGameResult = new MatchGameResult(); nowGameResult.m_winners = new List <SessionId>(); nowGameResult.m_winners.Add(record.Pop()); nowGameResult.m_losers = new List <SessionId>(); nowGameResult.m_losers.Add(record.Pop()); nowGameResult.m_draws = null; return(nowGameResult); }
public void MatchGameOver(Stack <SessionId> record) { if (nowModeType == MatchModeType.OneOnOne) { matchGameResult = OneOnOneRecord(record); } else { Debug.LogError("알수없는 매치모드 타입" + nowModeType); return; } RemoveAISessionInGameResult(); Backend.Match.MatchEnd(matchGameResult); }
// 서버로 게임 결과 전송 // 서버에서 각 클라이언트가 보낸 결과를 종합 public void MatchGameOver(Stack <SessionId> record) { Debug.Log("Match Over"); if (nowModeType == MatchModeType.OneOnOne) { matchGameResult = OneOnOneRecord(record); } else { Debug.LogError("게임 결과 종합 실패 - 알수없는 매치모드타입입니다.\n" + nowModeType); return; } RemoveAISessionInGameResult(); // 승/패 나누는 메세지 띄움 Backend.Match.MatchEnd(matchGameResult); }