Skip to content

Commit

Permalink
2024
Browse files Browse the repository at this point in the history
  • Loading branch information
sp0ok3r committed Nov 12, 2024
1 parent 5447e9f commit 2bdaa8f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
3 changes: 2 additions & 1 deletion MercuryBOT/AccSettings/AccSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Win32Interop.Methods;
using System.Drawing;
using MercuryBOT.SteamCommunity;
using Mercury;

namespace MercuryBOT.AccSettings
{
Expand All @@ -33,7 +34,7 @@ public AccSettings()

private void btn_setName_Click(object sender, EventArgs e)
{
AccountLoginOFF.ChangeCurrentName(txtBox_nameChange.Text);
HandleLogin.ChangeCurrentName(txtBox_nameChange.Text);
txtBox_nameChange.Clear();
}

Expand Down
5 changes: 3 additions & 2 deletions MercuryBOT/AccSettings/ProfilePrivacy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
█ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █
▐ ▐ ▐ ▐ ▐
*/
using Mercury;
using MercuryBOT.Helpers;
using MetroFramework.Controls;
using System;
Expand Down Expand Up @@ -39,7 +40,7 @@ private void ProfilePrivacy_Load(object sender, EventArgs e)
CollectPrivacySettings.RunWorkerAsync();
btn_changeprofSettings.Enabled = false;

AccountLoginOFF.GetPrivacySettings();
HandleLogin.GetPrivacySettings();

}

Expand All @@ -49,7 +50,7 @@ private void CollectPrivacySettings_DoWork(object sender, DoWorkEventArgs e)

try
{
foreach (KeyValuePair<string, int> setting in AccountLoginOFF.PrivacySettings)
foreach (KeyValuePair<string, int> setting in HandleLogin.PrivacySettings)
{
if (setting.Key == "PrivacyProfile")
{
Expand Down
11 changes: 6 additions & 5 deletions MercuryBOT/Comments/CommentsGather.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Win32Interop.Methods;
using MetroFramework.Controls;
using System.Collections.Generic;
using Mercury;

namespace MercuryBOT
{
Expand Down Expand Up @@ -57,13 +58,13 @@ private void Combox_profileOrClan_SelectedIndexChanged(object sender, EventArgs
switch (combox_GatherProfileOrGroup.SelectedIndex)
{
case 0://Profile
combox_ProfileURLorGroupID.Items.Add(AccountLoginOFF.CurrentSteamID.ToString());
combox_ProfileURLorGroupID.Items.Add(HandleLogin.CurrentSteamID.ToString());
combox_ProfileURLorGroupID.SelectedIndex = 0;
break;
case 1://Clan
foreach (var Officers in AccountLoginOFF.OfficerClanDictionary)
foreach (var Officers in HandleLogin.OfficerClanDictionary)
{
foreach (var Groups in AccountLoginOFF.ClanDictionary)
foreach (var Groups in HandleLogin.ClanDictionary)
{
if (Officers.Key == Groups.Key)
{
Expand Down Expand Up @@ -284,8 +285,8 @@ private void CommentsList_ScrollBar_Scroll(object sender, ScrollEventArgs e)
private void combox_ProfileURLorGroupID_SelectedIndexChanged(object sender, EventArgs e)
{
CheckProfileGroupInfo = (!combox_ProfileURLorGroupID.SelectedItem.ToString().StartsWith("765611"))
? AccountLoginOFF.ClanDictionary.ElementAt(combox_ProfileURLorGroupID.SelectedIndex).Key.ToString() // bug lista officers troca index
: AccountLoginOFF.CurrentSteamID.ToString(); // 666iq
? HandleLogin.ClanDictionary.ElementAt(combox_ProfileURLorGroupID.SelectedIndex).Key.ToString() // bug lista officers troca index
: HandleLogin.CurrentSteamID.ToString(); // 666iq
}
}
}
15 changes: 8 additions & 7 deletions MercuryBOT/Games/SelectGames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.Net.Http;
using System.Windows.Forms;
using Win32Interop.Methods;
using Mercury;

namespace MercuryBOT.GamesGather
{
Expand Down Expand Up @@ -52,7 +53,7 @@ private void SelectGames_Load(object sender, EventArgs e)
var list = JsonConvert.DeserializeObject<RootObject>(File.ReadAllText(Program.AccountsJsonFile));
foreach (var a in list.Accounts)
{
if (a.username == AccountLoginOFF.CurrentUsername)
if (a.username == HandleLogin.CurrentUsername)
{
apikey = a.APIWebKey;
}
Expand Down Expand Up @@ -81,14 +82,14 @@ public async void GET_ALL_GAMES()

WebClient wc = new WebClient();

var OwnedGames = await InterfacePlayerService.GetOwnedGamesAsync(AccountLoginOFF.CurrentSteamID, true, false); // check if correct
var OwnedGames = await InterfacePlayerService.GetOwnedGamesAsync(HandleLogin.CurrentSteamID, true, false); // check if correct

progreeBar_GatherGames.Maximum = Int32.Parse(OwnedGames.Data.GameCount.ToString());
lbl_selgames_count.Text = OwnedGames.Data.GameCount.ToString() + " games loaded.";

const string pictureUrl = "http://media.steampowered.com/steamcommunity/public/images/apps/{0}/{1}.jpg";

string Tempath = Path.GetTempPath() + @"\MercuryTemp\GamesImg\" + AccountLoginOFF.CurrentUsername + @"\";
string Tempath = Path.GetTempPath() + @"\MercuryTemp\GamesImg\" + HandleLogin.CurrentUsername + @"\";
if (!Directory.Exists(Tempath))
{
Directory.CreateDirectory(Tempath);
Expand Down Expand Up @@ -155,7 +156,7 @@ private void AddSelectedGame()
var list = JsonConvert.DeserializeObject<RootObject>(File.ReadAllText(Program.AccountsJsonFile));
foreach (var a in list.Accounts)
{
if (a.username == AccountLoginOFF.CurrentUsername)
if (a.username == HandleLogin.CurrentUsername)
{
for (int i = 0; i < a.Games.Count; i++)
{
Expand Down Expand Up @@ -190,7 +191,7 @@ private void Btn_selectAll_Click(object sender, EventArgs e)

foreach (var Acc in AccountsList.Accounts)
{
if (Acc.username == AccountLoginOFF.CurrentUsername)
if (Acc.username == HandleLogin.CurrentUsername)
{
if (Acc.Games.Count == 0)
{
Expand Down Expand Up @@ -249,7 +250,7 @@ private void txtBox_Game2Find_KeyDown(object sender, KeyEventArgs e)

private void metroLink_GamesIMGPath_Click(object sender, EventArgs e)
{
Process.Start(Path.GetTempPath() + @"\MercuryTemp\GamesImg\"+ AccountLoginOFF.CurrentUsername);
Process.Start(Path.GetTempPath() + @"\MercuryTemp\GamesImg\"+ HandleLogin.CurrentUsername);
}

private void SelectGames_FormClosed(object sender, FormClosedEventArgs e)
Expand All @@ -263,7 +264,7 @@ private void SelectGames_FormClosed(object sender, FormClosedEventArgs e)

if (chck_clearimagescache.Checked)
{
var path = Path.GetTempPath() + @"\MercuryTemp\GamesImg\" + AccountLoginOFF.CurrentUsername;
var path = Path.GetTempPath() + @"\MercuryTemp\GamesImg\" + HandleLogin.CurrentUsername;
Directory.GetFiles(path).ToList().ForEach(File.Delete);
Directory.Delete(path);
}
Expand Down
4 changes: 2 additions & 2 deletions MercuryBOT/HandleLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ private void OnAccountInfo(SteamUser.AccountInfoCallback callback)
}


private void GetPrivacySettings()
private static void GetPrivacySettings()
{
CPlayer_GetPrivacySettings_Request req = new CPlayer_GetPrivacySettings_Request { };
playerRequest = playerService.SendMessage(x => x.GetPrivacySettings(req));
Expand Down Expand Up @@ -1017,7 +1017,7 @@ public void ChangeCurrentState(EPersonaState state)
Console.WriteLine("[" + Program.BOTNAME + "] - State Changed to: " + state);
}

public void ChangeCurrentName(string Name)
public static void ChangeCurrentName(string Name)
{
steamFriends.SetPersonaName(Name);
Console.WriteLine("[" + Program.BOTNAME + "] - Name Changed to: " + Name);
Expand Down

0 comments on commit 2bdaa8f

Please sign in to comment.