Example #1
0
        void doWork(object sender, DoWorkEventArgs e)
        {
            loop = true;

            while (true)
            {
                if (worker.CancellationPending)
                {
                    loop     = false;
                    e.Cancel = true;
                    client.Disconnect();
                    return;
                }
                try
                {
                    cb.RunWaitCallbacks(TimeSpan.FromSeconds(5));
                }
                catch (Exception ex)
                {
                    Log(ex.Message, Color.Red);
                }

                try
                {
                    var tray = getTray(txtProcess.Text);
                    labelStatusBar.Text = tray.Replace("\n", "\\n").Replace("\r", "\\r");
                    if (tray.Length > 0)
                    {
                        var presence = Regex.Replace(tray, txtPattern.Text, txtRepl.Text);
                        if (loggedIn)
                        {
                            if (presence != lastPresence)
                            {
                                friends.SetPersonaState(EPersonaState.Busy);
                                var gamePlaying = new SteamKit2.ClientMsgProtobuf <CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);
                                gamePlaying.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed
                                {
                                    game_id         = new GameID(15190414816125648896),
                                    game_extra_info = presence
                                });
                                client.Send(gamePlaying);
                                lastPresence = presence;
                                Log(presence, Color.LightPink);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log(ex.Message, Color.Red);
                }
            }
        }
Example #2
0
        public void SetGamePlaying(int id)
        {
            var gamePlaying = new SteamKit2.ClientMsgProtobuf <CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);

            if (id != 0)
            {
                gamePlaying.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed
                {
                    game_id = new GameID(id),
                });
            }
            SteamClient.Send(gamePlaying);
            CurrentGame = id;
        }
Example #3
0
 public void SetGamePlaying(int id)
 {
     var gamePlaying = new SteamKit2.ClientMsgProtobuf<CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);
     if (id != 0)
         gamePlaying.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed
             {
                 game_id = new GameID(id),
             });
     SteamClient.Send(gamePlaying);
     CurrentGame = id;
 }