Skip to content

Commit

Permalink
1.084 Updated new module for universal licenses.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoCiaccio committed Jan 6, 2023
1 parent 3ae0051 commit 5598000
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Binary file modified Extend cBot.algo
Binary file not shown.
4 changes: 2 additions & 2 deletions Extend cBot/Extend cBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ExtendcBot : Strategy

public const string NAME = "Extend cBot";

public const string VERSION = "1.083";
public const string VERSION = "1.084";

#endregion

Expand Down Expand Up @@ -355,7 +355,7 @@ protected override void OnStart()
protected override void OnTick()
{

// --> REQUIRE LICENSE GENERATOR 1.073 OR GREATER https://github.com/cTrader-Guru/License-Generator
// --> REQUIRE LICENSE GENERATOR 1.075 OR GREATER https://github.com/cTrader-Guru/License-Generator
// --> REQUIRED : AccessRights.FullAccess
// --> CheckLicense(NAME);

Expand Down
18 changes: 15 additions & 3 deletions Extend cBot/License.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ public void CheckLicense(string cBotName)
if (Info == null)
{

Print($"Loading license for {Account.UserId}...");
Print($"Loading license for {Account.UserId}");

string HashName = GetMD5(cBotName.ToUpper() + Account.UserId);
string HashNameUniversal = GetMD5(cBotName.ToUpper() + "0");

string LocalLicense;

Expand All @@ -78,7 +79,18 @@ public void CheckLicense(string cBotName)
catch
{

throw new Exception("Problems on load license");
try
{

LocalLicense = LoadSecureFile(string.Format(LocalFileName, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), HashNameUniversal));

}
catch
{

throw new Exception("Problems on load license");

}

}

Expand Down Expand Up @@ -116,7 +128,7 @@ public void CheckLicense(string cBotName)
else
{

if (Info.UserID != Account.UserId)
if (Info.UserID != Account.UserId && Info.UserID != 0)
{

Exit(string.Format("License not for this UserID ({0})", Account.UserId));
Expand Down

0 comments on commit 5598000

Please sign in to comment.