using InABox.Configuration; using InABox.Core; using PRSServer; using PRSServices; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PRSLicensing; internal class PRSLicensingService : PRSService { public PRSLicensingService(string serviceName) : base(serviceName) { } protected override ServerSettings GetSettings(string serviceName) { var configuration = GetConfiguration().Load(); return new ServerSettings { Type = ServerType.Other, Properties = configuration.Properties }; } public static IConfiguration GetConfiguration() { return new LocalConfiguration(CoreUtils.GetCommonAppData(), ""); } protected override Server CreateServer(ServerSettings settings, string serviceName) { var result = new Server(); result.Key = serviceName; result.Type = ServerType.Other; //result.Sequence = Sequence == 0 ? DateTime.Now.Ticks : Sequence; var properties = Serialization.Deserialize(settings.Properties); if (properties != null) { result.Properties = properties; result.Name = result.Properties.Name; } result.CommitChanges(); return result; } protected override IEngine? CreateEngine(ServerSettings settings) { return new LicensingEngine(); } }