Skip to content

Commit 62420ea

Browse files
committed
1.0.3
1 parent 6bb511b commit 62420ea

File tree

6 files changed

+80
-53
lines changed

6 files changed

+80
-53
lines changed

ChatLogger/AccountLogin.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
using Newtonsoft.Json;
55
using SteamKit2;
66
using System;
7-
using System.Collections.Generic;
87
using System.IO;
98
using System.Linq;
10-
using System.Text;
119
using System.Text.RegularExpressions;
1210
using System.Threading;
13-
using System.Threading.Tasks;
1411

1512
namespace ChatLogger
1613
{
@@ -425,8 +422,7 @@ public static string GetAvatarLink(ulong steamid)
425422
return Extensions.ResolveAvatar(steamid.ToString());
426423
}
427424
}
428-
429-
425+
430426
public static string GetPersonaName(ulong steamid)
431427
{
432428
return steamFriends.GetFriendPersonaName((SteamID)steamid);

ChatLogger/Main.Designer.cs

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ChatLogger/Main.cs

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ private void RafadexAutoUpdate600IQ()
7575
catch (Exception)
7676
{
7777
Console.WriteLine("sp0ok3r.tk down :c");
78-
InfoForm.InfoHelper.CustomMessageBox.Show("Alert", "sp0ok3r.tk down :c. Try https://github.com/sp0ok3r/");
78+
InfoForm.InfoHelper.CustomMessageBox.Show("Alert", "sp0ok3r.tk down. Try https://github.com/sp0ok3r/");
79+
Process.Start("https://github.com/sp0ok3r/ChatLogger/releases");
80+
Application.Exit();
7981
}
8082
}
8183

@@ -113,14 +115,28 @@ public Main()
113115
[Obsolete]
114116
private void Main_Shown(object sender, EventArgs e)
115117
{
116-
RafadexAutoUpdate600IQ();
118+
var Settingslist = JsonConvert.DeserializeObject<ChatLoggerSettings>(File.ReadAllText(Program.SettingsJsonFile));
119+
120+
121+
DateTime now = DateTime.Now;
122+
var aa = Settingslist.LastTimeCheckedUpdate.Length == 0;
123+
if (Settingslist.LastTimeCheckedUpdate == null || Settingslist.LastTimeCheckedUpdate.Length == 0)
124+
{
125+
Settingslist.LastTimeCheckedUpdate = now.ToString();
126+
}
127+
128+
DateTime old = DateTime.Parse(Settingslist.LastTimeCheckedUpdate);
129+
if (Settingslist.LastTimeCheckedUpdate.Length > 0 && (now - old).TotalDays > 14) //check for update 14 days later
130+
{
131+
RafadexAutoUpdate600IQ();
132+
}
133+
File.WriteAllText(Program.SettingsJsonFile, JsonConvert.SerializeObject(Settingslist, Formatting.Indented));
134+
117135
System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();
118136
t.Tick += new EventHandler(Trolha_Tick);
119137
t.Interval = 2000;
120138
t.Start();
121-
122-
var Settingslist = JsonConvert.DeserializeObject<ChatLoggerSettings>(File.ReadAllText(Program.SettingsJsonFile));
123-
139+
124140
combox_Colors.SelectedIndex = Settingslist.startupColor;
125141
//
126142
if (Settingslist.Separator.Length > 0)
@@ -183,6 +199,7 @@ private void Main_Shown(object sender, EventArgs e)
183199

184200
public void RefreshAccountList()
185201
{
202+
int i = 0;
186203
AccountsList_Grid.Rows.Clear();
187204
var list = JsonConvert.DeserializeObject<RootObject>(File.ReadAllText(Program.AccountsJsonFile)).Accounts;
188205
foreach (var a in list.OrderByDescending(x => x.LastLoginTime))
@@ -196,6 +213,11 @@ public void RefreshAccountList()
196213
string[] row = { a.username, (a.SteamID).ToString(), (LoginK).ToString() };
197214
AccountsList_Grid.Rows.Add(row);
198215

216+
if (a.password.Length != 0)
217+
{
218+
AccountsList_Grid.Rows[i].Cells[0].Style.ForeColor = Color.White;
219+
}
220+
i++;
199221
}
200222
Acc_ScrollBar.Maximum = AccountsList_Grid.Rows.Count;
201223
AccountsList_Grid.ClearSelection();
@@ -244,7 +266,7 @@ public static void LoginusersVDF_ToFile()
244266

245267
dynamic volvo = VdfConvert.Deserialize(File.ReadAllText(SteamPath.SteamLocation + @"\config\loginusers.vdf"));
246268
VToken v2 = volvo.Value;
247-
return v2.Children().Select(child => new User2Json.SteamLoginUsers(child)).Where(user => user.RememberPassword).OrderByDescending(user => user.LastLoginTime).ToList();
269+
return v2.Children().Select(child => new SteamLoginUsers(child)).OrderByDescending(user => user.LastLoginTime).ToList();
248270
}
249271

250272

@@ -256,11 +278,11 @@ private void Form1_Load(object sender, EventArgs e)
256278
File.WriteAllText(Program.AccountsJsonFile, DefaultJson);
257279
}
258280

259-
try // Saved some gamers (900-10)iq
281+
try // Saved some gamers
260282
{
261283
LoginusersVDF_ToFile();
262284
}
263-
catch (DirectoryNotFoundException)
285+
catch (Exception x)
264286
{
265287
Console.WriteLine("Directory not found, but starting anyway...");
266288
}

ChatLogger/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ static class Program
99
public static readonly string BOTNAME = "ChatLogger";
1010

1111
public static readonly string spkDomain = "http://sp0ok3r.tk/ChatLogger/";
12-
public static readonly string Version = "1.0.2";
12+
public static readonly string Version = "1.0.3";
1313

1414

1515
public static readonly string ExecutablePath = Path.GetDirectoryName(Application.ExecutablePath);

0 commit comments

Comments
 (0)