Skip to content

Commit

Permalink
readme: 添加“鸣谢”
Browse files Browse the repository at this point in the history
nuget: 删除无用的包
code: 移除无用的代码
  • Loading branch information
SALTWOOD committed May 26, 2024
1 parent 37b02ab commit 042fdf2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 43 deletions.
1 change: 0 additions & 1 deletion CSharp-OpenBMCLAPI/CSharp-OpenBMCLAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<PackageReference Include="SaltWood.TeraIO" Version="1.0.4" />
<PackageReference Include="SocketIOClient" Version="3.1.1" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0" />
<PackageReference Include="WindowsFirewallHelper" Version="2.2.0.86" />
<PackageReference Include="YamlDotNet" Version="15.1.4" />
<PackageReference Include="ZstdSharp.Port" Version="0.8.1" />
</ItemGroup>
Expand Down
40 changes: 0 additions & 40 deletions CSharp-OpenBMCLAPI/Modules/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Text.Json;
using System.Xml.Linq;
using TeraIO.Runnable;
using WindowsFirewallHelper;
using static System.Net.Mime.MediaTypeNames;

namespace CSharpOpenBMCLAPI.Modules
Expand Down Expand Up @@ -259,45 +258,6 @@ public static string ExceptionToDetail(this Exception ex)
""";
}

public static void CreatePortRule(string newPortRuleName, ushort portNumber, FirewallAction firewallAction, FirewallDirection firewallDirection)
{
//搜索规则
var rule = FirewallManager.Instance.Rules.Where(r =>
r.Direction == firewallDirection &&
r.Name.Equals(newPortRuleName)
).FirstOrDefault();

if (rule == null) // 指定的规则不存在
{
try
{
rule = FirewallManager.Instance.CreatePortRule(
FirewallProfiles.Domain | FirewallProfiles.Private | FirewallProfiles.Public, // 生效的配置文件
newPortRuleName,
firewallAction, // 运作:允许或阻止
portNumber,
FirewallProtocol.TCP //协议

);

rule.Direction = firewallDirection; //方向

FirewallManager.Instance.Rules.Add(rule);

Logger.Instance.LogInfo($"添加防火墙规则成功:<IFirewallRule {rule.Name} {string.Join(',', rule.LocalPorts)} => {string.Join(',', rule.RemotePorts)} {rule.Protocol} {rule.Action}>");
}
catch (Exception ex)
{
Logger.Instance.LogWarn($"添加防火墙规则失败:{ExceptionToDetail(ex)}");
}
}
else
{
// FirewallManager.Instance.Rules.Remove(rule);
Logger.Instance.LogInfo($"防火墙规则已存在:<IFirewallRule {rule.Name} {string.Join(',', rule.LocalPorts)} => {string.Join(',', rule.RemotePorts)} {rule.Protocol} {rule.Action}>");
}
}

public static IEnumerator<T> GetEnumerator<T>(this IEnumerator<T> enumerator) => enumerator;

public static byte[] BsonSerializeObject(object obj)
Expand Down
6 changes: 4 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

**(以下暂缓进行)**

- [ ] 原生多实例运行
- [ ] 继续优化插件功能
- [ ] *[优先级低]* 高级控制台,在控制台中调整设置、查看监控信息而不只是看日志
___
Expand Down Expand Up @@ -78,7 +77,7 @@ ___
- [SocketIOClient](https://github.com/doghappy/socket.io-client-csharp) - 使用 SocketIOClient 与主控通信

**Apache**
- [log4net](https://logging.apache.org/log4net/) - 使用 log4net 记录日志(虽然目前没用到)
- [log4net](https://logging.apache.org/log4net) - 使用 log4net 记录日志(虽然目前没用到)

**@oleg-st (Oleg Stepanischev)**
- [ZstdSharp.Port](https://github.com/oleg-st/ZstdSharp) - 使用 ZstdSharp.Port 解压主控下发的压缩过的文件列表
Expand All @@ -92,6 +91,9 @@ ___
**@2b2ttianxiu**
- 帮忙写了 **SimpleWebServer**,代替了 ASP.NET 提供文件分发

**@goblinfactory (Alan Hemmings)**
- [Goblinfactory.Konsole](https://github.com/goblinfactory/konsole) 使用 Goblinfactory.Konsole 显示进度条

# 友情链接

[OpenBMCLAPI](https://github.com/bangbang93/openbmclapi)
Expand Down

0 comments on commit 042fdf2

Please sign in to comment.