void NetworkCommunications_OnGameCreatedReceived(GameDetails gameInformation) { if (!m_knownGames.ContainsKey(gameInformation.GameTitle)) { m_knownGames.Add(gameInformation.GameTitle, gameInformation.CreatorsIpAddress); if (!GameSettings.Settings.IamGameCreator) { AvailableGamesListView.Items.Add(gameInformation.GameTitle); CreateGameButton.IsEnabled = false; } } }
private void GameCreatedReceived(HostName remoteAddress, NetworkMessagePacket message) { if (remoteAddress.CanonicalName != CurrentIPAddress()) { GameDetails gameInformation = new GameDetails() { CreatorsIpAddress = remoteAddress.CanonicalName, GameTitle = message.MessageText }; if (OnGameCreatedReceived != null) { OnGameCreatedReceived(gameInformation); } } }
void NetworkCommunications_OnGameCancelledReceived(GameDetails gameInformation) { m_knownGames.Remove(gameInformation.GameTitle); AvailableGamesListView.Items.Remove(gameInformation.GameTitle); }