public void EndGame(PlayerMobile winner) { if (m_GameTimer != null) { m_GameTimer.Stop(); m_GameTimer = null; } if (!m_KeepOpenJoin) m_OpenJoin = false; if (m_Running) { m_GameResults = CreatePlayerStats(winner == null ? true : false); ArrayList players = new ArrayList(); players = m_Participants.Clone() as ArrayList; Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerStateCallback(PublishGameResultsCallback), new Object[] { m_GameResults, players }); } ExitPlayers(winner); RemovePlacedBombs(); RemoveWalls(); m_Running = false; }
public void StartGame(Mobile from) { if (m_Participants.Count < 2) { if (from != null) from.SendMessage("Minimum of two participants needed to start the game."); return; } if (m_Participants.Count > m_StartLocations.Count) { if (from != null) from.SendMessage("More participants than start locations existing."); return; } if (m_ExitLosers == Point3D.Zero || m_ExitWinner == Point3D.Zero ||m_ExitOnDraw == Point3D.Zero) { if (from != null) from.SendMessage("You have to define all exit locations."); return; } PlaceWalls(); PreparePlayers(); m_GameTimer = new BMGameTimer(this); m_GameTimer.Start(); m_Running = true; GameBroadcast(34, "The game has started."); }