コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
 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);
         }
     }
 }
コード例 #3
0
        void NetworkCommunications_OnGameCancelledReceived(GameDetails gameInformation)
        {
            m_knownGames.Remove(gameInformation.GameTitle);

            AvailableGamesListView.Items.Remove(gameInformation.GameTitle);
        }