Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
leftspace89 committed May 14, 2021
1 parent 347466d commit 324cf53
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
6 changes: 3 additions & 3 deletions FWManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void blockLOL()

var str = RunAction("advfirewall firewall show rule name=all");

if (str.Contains("LeftSpace_LolOfflineMode"))
if (str.Contains("LeftSpace_LolOfflineMode"+ chat_dom))
{

LDebug.WriteLine("Chat endpoint already blocked");
Expand All @@ -69,12 +69,12 @@ public void blockLOL()
}


string strCmdText = $"advfirewall firewall add rule name=\"LeftSpace_LolOfflineMode\" dir=out remoteip={chat_ip} protocol=any action=block";
string strCmdText = $"advfirewall firewall add rule name=\"LeftSpace_LolOfflineMode{chat_dom}\" dir=out remoteip={chat_ip} protocol=any action=block";
RunAction(strCmdText);
}
public void unblockLOL()
{
string strCmdText = $"advfirewall firewall delete rule name=\"LeftSpace_LolOfflineMode\"";
string strCmdText = $"advfirewall firewall delete rule name=\"LeftSpace_LolOfflineMode{chat_dom}\"";
RunAction(strCmdText);
}

Expand Down
15 changes: 14 additions & 1 deletion LSLolOffline.Designer.cs

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

13 changes: 8 additions & 5 deletions LSLolOffline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ private void switchButton_Click(object sender, EventArgs e)
{
try
{

Globals.fw.chat_dom = srvbox.Items[srvbox.SelectedIndex].ToString();
Globals.fw.chat_ip = Globals.lc.GetIPFromDomain();
var isBlocked = Globals.fw.isBlocked();
if (isBlocked)
{
Expand Down Expand Up @@ -85,14 +86,16 @@ private void UpdateState(bool isBlocked)
private void srvbox_SelectedIndexChanged(object sender, EventArgs e)
{

Globals.fw.chat_dom = srvbox.Items[srvbox.SelectedIndex].ToString();

}

private void button1_Click(object sender, EventArgs e)
{
Globals.fw.chat_dom = srvbox.Items[srvbox.SelectedIndex].ToString();
Globals.fw.chat_ip = Globals.lc.GetIPFromDomain();
var isBlocked = Globals.fw.isBlocked();
srvLabel.Focus();
UpdateState(isBlocked);



}
}
}

0 comments on commit 324cf53

Please sign in to comment.