Example #1
0
        private void ConnectionManager_WelcomeMessageReceived(object sender, EventArgs e)
        {
            btnNewGame.AllowClick          = true;
            btnJoinGame.AllowClick         = true;
            ddCurrentChannel.AllowDropDown = true;
            tbChatInput.Enabled            = true;

            Channel cncnetChannel = connectionManager.FindChannel("#cncnet");

            cncnetChannel.Join();

            string  localGameChatChannelName = gameCollection.GetGameChatChannelNameFromIdentifier(localGameID);
            Channel localGameChatChannel     = connectionManager.FindChannel(localGameChatChannelName);

            localGameChatChannel.Join();

            string localGameBroadcastChannel = gameCollection.GetGameBroadcastingChannelNameFromIdentifier(localGameID);

            connectionManager.FindChannel(localGameBroadcastChannel).Join();

            cncnetChannel.RequestUserInfo();
            localGameChatChannel.RequestUserInfo();

            foreach (CnCNetGame game in gameCollection.GameList)
            {
                if (!game.Supported)
                {
                    continue;
                }

                if (game.InternalName.ToUpper() != localGameID)
                {
                    if (UserINISettings.Instance.IsGameFollowed(game.InternalName.ToUpper()))
                    {
                        connectionManager.FindChannel(game.GameBroadcastChannel).Join();
                        followedGames.Add(game.InternalName);
                    }
                }
            }
        }