예제 #1
0
        /// <summary>
        /// This function is called when one of the two players initializing the game decides to cancel
        /// </summary>
        /// <param name="from">The player refusing</param>
        public void CancelGameStart(Mobile from)
        {
            if (from == Owner)
            {
                // End this game
                if (Guest != null)
                {
                    Guest.SendMessage(0x40, "The owner of this game decided to cancel.");
                    Guest.CloseGump(typeof(StartGameGump));
                }

                if (from.Target != null && from.Target is ChessTarget)
                {
                    (from.Target as ChessTarget).Remove(from);
                }

                Cleanup();
            }
            else if (from == Guest)
            {
                Guest = null;

                Owner.SendGump(new StartGameGump(Owner, this, true, m_AllowSpectators));
                Owner.Target = new ChessTarget(this, Owner, "The selected partner refused the game. Please select another partner...",
                                               ChooseOpponent);
            }
        }