Пример #1
0
        private void CreateItemHandler(NameValueCollection req, kousyou_createitem api)
        {
            var dev = new DevelopmentInfo {
                IsSuccess = api.api_create_flag != 0
            };

            if (dev.IsSuccess)
            {
                Staff.Current.Homeport.Equipments.Add(new Equipment(api.api_slot_item));
                Staff.Current.Homeport.UpdateCounts();
                dev.Equip = Staff.Current.MasterData.EquipInfo[api.api_slot_item.api_slotitem_id];
            }
            else
            {
                dev.Equip = Staff.Current.MasterData.EquipInfo[int.Parse(api.api_fdata.Split(',')[1])];
            }
            Development.Insert(0, dev);
            Staff.Current.Homeport.Material.UpdateMaterial(api.api_material);
            Logger.Loggers.CreateItemLogger.Log(new Logger.CreateItemLog
            {
                DateTime       = DateTime.UtcNow,
                SecretaryId    = Staff.Current.Homeport.Secretary.ShipInfo.Id,
                SecretaryLevel = Staff.Current.Homeport.Secretary.Level,
                IsSuccess      = dev.IsSuccess,
                AdmiralLevel   = Staff.Current.Admiral.Level,
                EquipId        = dev.Equip.Id,
                Item1          = req.GetInt("api_item1"),
                Item2          = req.GetInt("api_item2"),
                Item3          = req.GetInt("api_item3"),
                Item4          = req.GetInt("api_item4")
            });
            Logger.Loggers.MaterialLogger.ForceLog = true;
            Reporter.PoiDBReporter.ReportAsync(new JObject
            {
                ["items"] = new JArray
                {
                    req.GetInt("api_item1"),
                    req.GetInt("api_item2"),
                    req.GetInt("api_item3"),
                    req.GetInt("api_item4")
                },
                ["teitokuLv"]  = Staff.Current.Admiral.Level,
                ["itemId"]     = dev.Equip.Id,
                ["secretary"]  = Staff.Current.Homeport.Secretary.ShipInfo.Id,
                ["successful"] = dev.IsSuccess
            }, "create_item");
        }
Пример #2
0
 private void CreateItemHandler(NameValueCollection req, kousyou_createitem api)
 {
     var dev = new DevelopmentInfo { IsSuccess = api.api_create_flag != 0 };
     if (dev.IsSuccess)
     {
         Staff.Current.Homeport.Equipments.Add(new Equipment(api.api_slot_item));
         Staff.Current.Homeport.UpdateCounts();
         dev.Equip = Staff.Current.MasterData.EquipInfo[api.api_slot_item.api_slotitem_id];
     }
     else
     {
         dev.Equip = Staff.Current.MasterData.EquipInfo[int.Parse(api.api_fdata.Split(',')[1])];
     }
     Development.Insert(0, dev);
     Staff.Current.Homeport.Material.UpdateMaterial(api.api_material);
     Logger.Loggers.CreateItemLogger.Log(new Logger.CreateItemLog
     {
         DateTime = DateTime.UtcNow,
         SecretaryId = Staff.Current.Homeport.Secretary.ShipInfo.Id,
         SecretaryLevel = Staff.Current.Homeport.Secretary.Level,
         IsSuccess = dev.IsSuccess,
         AdmiralLevel = Staff.Current.Admiral.Level,
         EquipId = dev.Equip.Id,
         Item1 = req.GetInt("api_item1"),
         Item2 = req.GetInt("api_item2"),
         Item3 = req.GetInt("api_item3"),
         Item4 = req.GetInt("api_item4")
     });
     Logger.Loggers.MaterialLogger.ForceLog = true;
     Reporter.PoiDBReporter.ReportAsync(new JObject
     {
         ["items"] = new JArray
         {
             req.GetInt("api_item1"),
             req.GetInt("api_item2"),
             req.GetInt("api_item3"),
             req.GetInt("api_item4")
         },
         ["teitokuLv"] = Staff.Current.Admiral.Level,
         ["itemId"] = dev.Equip.Id,
         ["secretary"] = Staff.Current.Homeport.Secretary.ShipInfo.Id,
         ["successful"] = dev.IsSuccess
     }, "create_item");
 }