예제 #1
0
 protected override void Disposing()
 {
     mappingNameToUUID?.Dispose();
     mappingUUIDToName?.Dispose();
     mappingDigitToUUID?.Dispose();
     mappingUUIDToDigit?.Dispose();
     this.mappingNameToUUID  = null;
     this.mappingUUIDToName  = null;
     this.mappingDigitToUUID = null;
     this.mappingUUIDToDigit = null;
 }
예제 #2
0
 public virtual void Init()
 {
     Task.Run(async() =>
     {
         using (var start = ORMFactory.Instance.DefaultAdapter.GetHash("SERVER_INIT", null))
         {
             var now = DateTime.UtcNow;
             if (await start.SetAsync(nameof(ServerInitTimeUTC), now, When.NotExists))
             {
                 ServerInitTimeUTC = now;
             }
             else
             {
                 ServerInitTimeUTC = await start.GetAsync <DateTime>(nameof(ServerInitTimeUTC));
             }
         }
         this.mappingNameToUUID  = DeepCrystal.ORM.ORMFactory.Instance.DefaultAdapter.GetHash("Mapping:NameToUUID", null);
         this.mappingUUIDToName  = DeepCrystal.ORM.ORMFactory.Instance.DefaultAdapter.GetHash("Mapping:UUIDToName", null);
         this.mappingDigitToUUID = DeepCrystal.ORM.ORMFactory.Instance.DefaultAdapter.GetHash("Mapping:DigitToUUID", null);
         this.mappingUUIDToDigit = DeepCrystal.ORM.ORMFactory.Instance.DefaultAdapter.GetHash("Mapping:UUIDToDigit", null);
     }).Wait();
 }