public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { if (m_IsOwner) { if (info.ButtonID == 3) { // Switch the allow spectators flag m_Game.AllowSpectators = !m_AllowSpectators; sender.Mobile.SendGump(new StartGameGump(sender.Mobile, m_Game, m_IsOwner, !m_AllowSpectators)); } else if (info.ButtonID == 2) { m_Game.CancelGameStart(sender.Mobile); } else if (info.ButtonID == 1) { sender.Mobile.Target = new ChessTarget(m_Game, sender.Mobile, "Please select your partner...", new ChessTargetCallback(m_Game.ChooseOpponent)); sender.Mobile.SendGump(new StartGameGump(sender.Mobile, m_Game, m_IsOwner, m_AllowSpectators)); } } else { if (info.ButtonID == 2) { m_Game.CancelGameStart(sender.Mobile); } else if (info.ButtonID == 1) { m_Game.AcceptGame(sender.Mobile); } } }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { switch (info.ButtonID) { case 0: return; case 1: sender.Mobile.SendGump(new ChessSetGump(m_User, m_Game, m_IsOwner, m_AllowSpectators, --m_Page)); break; case 2: sender.Mobile.SendGump(new ChessSetGump(m_User, m_Game, m_IsOwner, m_AllowSpectators, ++m_Page)); break; case 3: m_Game.CancelGameStart(sender.Mobile); break; default: int index = info.ButtonID - 10; ChessSet s = (ChessSet)Enum.Parse(typeof(Arya.Chess.ChessSet), Sets[index], false); m_Game.SetChessSet(s); sender.Mobile.SendGump(new StartGameGump(sender.Mobile, m_Game, m_IsOwner, m_AllowSpectators)); sender.Mobile.Target = new ChessTarget(m_Game, sender.Mobile, "Please select your parnter...", new ChessTargetCallback(m_Game.ChooseOpponent)); break; } }