Beispiel #1
0
        private static void OnJoined(funapi.Matchmaking.Player player, funapi.Matchmaking.Match match)
        {
            Log.Assert(match.MatchType == (int)MatchmakingType.kMatch1vs1);

            // 팀을 구성합니다. 1vs1 만 있기 때문에 각 플레이어를 A, B 팀으로 나눕니다.

            JToken value;

            if (!match.Context.TryGetValue("A", out value))
            {
                match.Context ["A"] = player.Id;
            }
            else
            {
                match.Context ["B"] = player.Id;
            }
        }
Beispiel #2
0
        private static void OnLeft(funapi.Matchmaking.Player player, funapi.Matchmaking.Match match)
        {
            Log.Assert(match.MatchType == (int)MatchmakingType.kMatch1vs1);

            string team_a = Utility.ReadStringFromJsonObject(match.Context, "A");

            if (team_a == player.Id)
            {
                match.Context.Remove("A");
                return;
            }
            string team_b = Utility.ReadStringFromJsonObject(match.Context, "B");

            if (team_b == player.Id)
            {
                match.Context.Remove("B");
                return;
            }
        }
Beispiel #3
0
 private static bool CheckJoinable(funapi.Matchmaking.Player player, funapi.Matchmaking.Match match)
 {
     Log.Assert(match.MatchType == (int)MatchmakingType.kMatch1vs1);
     // 조건없이 바로 매칭합니다.
     return(true);
 }