Skip to content

Commit

Permalink
Build n. 36
Browse files Browse the repository at this point in the history
  • Loading branch information
Plenyx committed May 18, 2019
1 parent 0f93f4b commit c942921
Show file tree
Hide file tree
Showing 41 changed files with 392 additions and 60 deletions.
File renamed without changes.
12 changes: 4 additions & 8 deletions FormArcVersions.cs → Forms/FormArcVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ private async void ProcessExited(object sender, EventArgs e)

public async Task CheckNewVersionAsync(bool manual = false)
{
string availableVersionResnponse = await mainLink.HttpClientController.DownloadFileToStringAsync("https://deltaconnected.com/arcdps/x64/d3d9.dll.md5sum");
string availableVersion = availableVersionResnponse.Split(' ')[0];
if (File.Exists($@"{GW2Location}\bin64\d3d9.dll"))
string availableVersionResponse = await mainLink.HttpClientController.DownloadFileToStringAsync("https://deltaconnected.com/arcdps/x64/d3d9.dll.md5sum");
string availableVersion = availableVersionResponse.Split(' ')[0];
if ((availableVersion != "") && (File.Exists($@"{GW2Location}\bin64\d3d9.dll")))
{
using (var md5 = System.Security.Cryptography.MD5.Create())
{
Expand All @@ -156,7 +156,7 @@ public async Task CheckNewVersionAsync(bool manual = false)
using (var stream = File.OpenRead($@"{GW2Location}\bin64\d3d9.dll"))
{
var hash = md5.ComputeHash(stream);
if (!BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant().Equals(availableVersion))
if (!BitConverter.ToString(hash).Replace("-", "").ToLower().Equals(availableVersion))
{
buttonCheckNow.Enabled = false;
groupBoxUpdating.Enabled = true;
Expand Down Expand Up @@ -221,10 +221,6 @@ public async Task CheckNewVersionAsync(bool manual = false)
await UpdateArcAsync();
}
}
else
{
mainLink.ShowBalloon("arcdps version checking", "New version of arcdps available", 6500);
}
}
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 31 additions & 8 deletions FormMain.Designer.cs → Forms/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 29 additions & 5 deletions FormMain.cs → Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public partial class FormMain : Form
private readonly FormBossData bossDataLink;
private readonly FormDiscordWebhooks discordWebhooksLink;
private readonly FormPings pingsLink;
private readonly FormTwitchCommands twitchCommandsLink;
private TwitchIrcClient chatConnect;
private FileSystemWatcher watcher = new FileSystemWatcher() { Filter = "*.*", IncludeSubdirectories = true, NotifyFilter = NotifyFilters.FileName };
private bool firstTimeMinimise = true;
Expand All @@ -51,7 +52,7 @@ public partial class FormMain : Form

// constants
private const int minFileSize = 12288;
private const int uploaderBuild = 35;
private const int uploaderBuild = 36;
#endregion

#region constructor
Expand All @@ -70,6 +71,7 @@ public FormMain()
arcVersionsLink = new FormArcVersions(this);
bossDataLink = new FormBossData(this);
discordWebhooksLink = new FormDiscordWebhooks(this);
twitchCommandsLink = new FormTwitchCommands(this);
try
{
LogsLocation = RegistryController.GetRegistryValue("logsLocation", "");
Expand Down Expand Up @@ -170,6 +172,10 @@ public FormMain()
RegistryController.SetRegistryValue("gw2Location", "");
}
}
twitchCommandsLink.checkBoxUploaderEnable.Checked = RegistryController.GetRegistryValue("twitchCommandUploaderEnabled", 1) == 1;
twitchCommandsLink.textBoxUploaderCommand.Text = RegistryController.GetRegistryValue("twitchCommandUploader", "!uploader");
twitchCommandsLink.checkBoxLastLogEnable.Checked = RegistryController.GetRegistryValue("twitchCommandLastLogEnabled", 0) == 1;
twitchCommandsLink.textBoxLastLogCommand.Text = RegistryController.GetRegistryValue("twitchCommandLastLog", "!lastlog");
if (RegistryController.GetRegistryValue("firstSetup", 0) == 0)
{
MessageBox.Show("It looks like this is the first time you are running this program.\nIf you have any issues feel free to contact me directly by Twitch, Discord (@Plenyx#1029) or on GitHub!\n\nPlenyx", "Thank you for using PlenBotLogUploader", MessageBoxButtons.OK, MessageBoxIcon.Information);
Expand All @@ -194,10 +200,12 @@ public FormMain()
{
buttonDisConnectTwitch.Text = "Connect to Twitch";
buttonChangeTwitchChannel.Enabled = false;
buttonCustomName.Enabled = false;
toolStripMenuItemOpenCustomName.Enabled = false;
toolStripMenuItemPostToTwitch.Enabled = false;
toolStripMenuItemOpenTwitchCommands.Enabled = false;
buttonCustomName.Enabled = false;
buttonReconnectBot.Enabled = false;
buttonTwitchCommands.Enabled = false;
checkBoxPostToTwitch.Enabled = false;
}
if (!File.Exists($"{LocalDir}logs.csv"))
Expand Down Expand Up @@ -701,8 +709,10 @@ public void ConnectTwitchBot()
buttonChangeTwitchChannel.Enabled = true;
toolStripMenuItemOpenCustomName.Enabled = true;
toolStripMenuItemPostToTwitch.Enabled = true;
toolStripMenuItemOpenTwitchCommands.Enabled = true;
buttonCustomName.Enabled = true;
buttonReconnectBot.Enabled = true;
buttonTwitchCommands.Enabled = true;
checkBoxPostToTwitch.Enabled = true;
if (CustomTwitchName != "")
{
Expand All @@ -727,10 +737,12 @@ public void DisconnectTwitchBot()
AddToText("<-?-> CONNECTION CLOSED");
buttonDisConnectTwitch.Text = "Connect to Twitch";
buttonChangeTwitchChannel.Enabled = false;
buttonCustomName.Enabled = false;
toolStripMenuItemOpenCustomName.Enabled = false;
toolStripMenuItemPostToTwitch.Enabled = false;
toolStripMenuItemOpenTwitchCommands.Enabled = false;
buttonCustomName.Enabled = false;
buttonReconnectBot.Enabled = false;
buttonTwitchCommands.Enabled = false;
checkBoxPostToTwitch.Enabled = false;
RegistryController.SetRegistryValue("connectToTwitch", 0);
}
Expand Down Expand Up @@ -817,12 +829,12 @@ protected async void ReadMessagesAsync(object sender, IrcMessageEventArgs e)
if (messageSplit.Length > 1)
{
string command = messageSplit[1].Split(' ')[0].ToLower();
if (command.Equals("!uploader"))
if (command.Equals(twitchCommandsLink.textBoxUploaderCommand.Text.ToLower()) && twitchCommandsLink.checkBoxUploaderEnable.Checked)
{
AddToText("> UPLOADER COMMAND USED");
await chatConnect.SendChatMessageAsync(ChannelName, $"PlenBot Log Uploader v1 build n.{uploaderBuild} | https://plenbot.net/uploader/");
}
else if (command.Equals("!lastlog") || command.Equals("!log"))
else if (command.Equals(twitchCommandsLink.textBoxLastLogCommand.Text.ToLower()) && twitchCommandsLink.checkBoxLastLogEnable.Checked)
{
if (LastLog != null)
{
Expand Down Expand Up @@ -986,6 +998,12 @@ private void buttonDiscordWebhooks_Click(object sender, EventArgs e)
discordWebhooksLink.BringToFront();
}

private void ButtonTwitchCommands_Click(object sender, EventArgs e)
{
twitchCommandsLink.Show();
twitchCommandsLink.BringToFront();
}

private void toolStripMenuItemOpenDPSReportServer_Click(object sender, EventArgs e)
{
dpsReportServerLink.Show();
Expand Down Expand Up @@ -1022,6 +1040,12 @@ private void toolStripMenuItemDiscordWebhooks_Click(object sender, EventArgs e)
discordWebhooksLink.BringToFront();
}

private void ToolStripMenuItemOpenTwitchCommands_Click(object sender, EventArgs e)
{
twitchCommandsLink.Show();
twitchCommandsLink.BringToFront();
}

private void buttonDisConnectTwitch_Click(object sender, EventArgs e)
{
reconnectedFailCounter = 0;
Expand Down
2 changes: 1 addition & 1 deletion FormMain.resx → Forms/FormMain.resx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@
<value>140, 20</value>
</metadata>
<metadata name="timerCheckUpdate.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>301, 23</value>
<value>300, 20</value>
</metadata>
</root>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c942921

Please sign in to comment.