コード例 #1
0
        private void EndMatch_One(string[] segments)
        {
            string matchId = segments[2];

            MatchHandler.EndMatch(matchId);

            MatchEventDispatcher.InvokeMatchEndEvent(new MatchEndEventArgs(matchId));
        }
コード例 #2
0
        internal static void RemoveUserFromMatch(MatchState match, string accountId)
        {
            PlayerState   userRemoved;
            DepartureType departureType = DepartureType.Unknown;

            match.RemoveUserFromMatch(accountId, out departureType, out userRemoved);

            if (match.PlayerOne == null & match.PlayerTwo == null)
            {
                if (m_Matches.ContainsKey(match.MatchIdentity))
                {
                    m_Matches.Remove(match.MatchIdentity);
                    MatchEventDispatcher.InvokeMatchEndEvent
                        (new MatchEndEventArgs(match.MatchIdentity));
                }
            }

            else
            {
                MatchEventDispatcher.InvokeUserDepartedEvent
                    (new UserDepartedEventArgs(match, departureType, userRemoved));
            }
        }