private void OnWelcome(IPacketGCMsg packetMsg)
        {
            Timer.Stop();

            int version = -1;

            // TF2 GC is not in sync
            if (AppID == 440)
            {
                var msg = new ClientGCMsgProtobuf <SteamKit2.GC.TF2.Internal.CMsgServerWelcome>(packetMsg).Body;

                version = (int)msg.active_version;
            }
            else
            {
                var msg = new ClientGCMsgProtobuf <CMsgClientWelcome>(packetMsg).Body;

                version = (int)msg.version;
            }

            Log.WriteInfo(Name, "New GC session ({0} -> {1})", LastVersion, version);

            string message = string.Format("New {0}{1}{2} GC session", Colors.OLIVE, SteamProxy.GetAppName(AppID), Colors.NORMAL);

            if (LastVersion == -1 || LastVersion == version)
            {
                message += string.Format(" {0}(version {1})", Colors.DARK_GRAY, version);
            }
            else
            {
                message += string.Format(" {0}(version changed from {1} to {2})", Colors.DARK_GRAY, LastVersion, version);
            }

            if (LastVersion != -1 && (LastVersion != version || LastStatus != GCConnectionStatus.GCConnectionStatus_HAVE_SESSION))
            {
                IRC.SendMain(message);
            }

            IRC.SendAnnounce(message);

            LastVersion = version;
            LastStatus  = GCConnectionStatus.GCConnectionStatus_HAVE_SESSION;

            UpdateStatus(AppID, LastStatus.ToString());
        }
        private void OnConnectionStatus(IPacketGCMsg packetMsg)
        {
            var msg = new ClientGCMsgProtobuf <CMsgConnectionStatus>(packetMsg).Body;

            LastStatus = msg.status;

            Log.WriteInfo(Name, "Status: {0}", LastStatus);

            string message = string.Format("{0}{1}{2} GC status:{3} {4}", Colors.OLIVE, SteamProxy.GetAppName(AppID), Colors.NORMAL, Colors.OLIVE, LastStatus);

            IRC.SendAnnounce(message);

            if (LastStatus == GCConnectionStatus.GCConnectionStatus_NO_SESSION)
            {
                Timer.Interval = TimeSpan.FromSeconds(5).TotalMilliseconds;
                Timer.Start();
            }

            UpdateStatus(AppID, LastStatus.ToString());
        }
        private void OnClientWelcome(IPacketGCMsg packetMsg)
        {
            Timer.Stop();

            var msg = new ClientGCMsgProtobuf<CMsgClientWelcome>(packetMsg).Body;

            Log.WriteInfo(Name, "New GC session ({0} -> {1})", LastVersion, msg.version);

            string message = string.Format("New {0}{1}{2} GC session", Colors.OLIVE, SteamProxy.GetAppName(AppID), Colors.NORMAL);

            if (LastVersion == -1 || LastVersion == msg.version)
            {
                message += string.Format(" {0}(version {1})", Colors.DARK_GRAY, msg.version);
            }
            else
            {
                message += string.Format(" {0}(version changed from {1} to {2})", Colors.DARK_GRAY, LastVersion, msg.version);
            }

            if (LastVersion != -1 && (LastVersion != msg.version || LastStatus != GCConnectionStatus.GCConnectionStatus_HAVE_SESSION))
            {
                IRC.SendMain(message);
            }

            IRC.SendAnnounce(message);

            LastVersion = (int)msg.version;
            LastStatus = GCConnectionStatus.GCConnectionStatus_HAVE_SESSION;

            UpdateStatus(AppID, LastStatus.ToString());
        }
        private void OnClientConnectionStatus(IPacketGCMsg packetMsg)
        {
            var msg = new ClientGCMsgProtobuf<CMsgConnectionStatus>(packetMsg).Body;

            LastStatus = msg.status;

            Log.WriteInfo(Name, "Status: {0}", LastStatus);

            string message = string.Format("{0}{1}{2} GC status:{3} {4}", Colors.OLIVE, SteamProxy.GetAppName(AppID), Colors.NORMAL, Colors.OLIVE, LastStatus);

            IRC.SendAnnounce(message);

            if (LastStatus == GCConnectionStatus.GCConnectionStatus_NO_SESSION)
            {
                Timer.Interval = TimeSpan.FromSeconds(5).TotalMilliseconds;
                Timer.Start();
            }

            UpdateStatus(AppID, LastStatus.ToString());
        }
        private void OnWelcome(IPacketGCMsg packetMsg)
        {
            Timer.Stop();

            int version = -1;

            // TF2 GC is not in sync
            if (AppID == 440)
            {
                var msg = new ClientGCMsgProtobuf<SteamKit2.GC.TF2.Internal.CMsgServerWelcome>(packetMsg).Body;

                version = (int)msg.active_version;
            }
            else
            {
                var msg = new ClientGCMsgProtobuf<CMsgClientWelcome>(packetMsg).Body;

                version = (int)msg.version;
            }

            Log.WriteInfo(Name, "New GC session ({0} -> {1})", LastVersion, version);

            string message = string.Format("New {0}{1}{2} GC session", Colors.OLIVE, Steam.GetAppName(AppID), Colors.NORMAL);

            if (LastVersion == -1 || LastVersion == version)
            {
                message += string.Format(" {0}(version {1})", Colors.DARKGRAY, version);
            }
            else
            {
                message += string.Format(" {0}(version changed from {1} to {2})", Colors.DARKGRAY, LastVersion, version);
            }

            if (LastVersion != -1 && (LastVersion != version || LastStatus != GCConnectionStatus.GCConnectionStatus_HAVE_SESSION))
            {
                IRC.Instance.SendMain(message);
            }

            IRC.Instance.SendAnnounce(message);

            LastVersion = version;
            LastStatus = GCConnectionStatus.GCConnectionStatus_HAVE_SESSION;

            UpdateStatus(AppID, LastStatus.ToString());
        }