Exemple #1
0
 public SNOTable this[SNO.ClientSNOTable snoGroup]
 {
     get
     {
         if (!this.dictionary_1.ContainsKey(snoGroup))
         {
             throw new Exception(string.Format("Couldn't find SNOGroup {0} in SNOTableCache!", snoGroup));
         }
         return this.dictionary_1[snoGroup];
     }
 }
        /*
         *      private void ValidateHideFlag(ClothingHideFlags hideFlag, string name)
         *      {
         *              // Check if dictionary has entry about such clothing item name
         *              if (!clothes.ContainsKey(name))
         *              {
         *                      Logger.LogError($"Can't find {name} clothingItem linked to {hideFlag}", Category.PlayerInventory);
         *                      return;
         *              }
         *
         *              // Enable or disable based on hide flag
         *              var isVisible = !hideClothingFlags.HasFlag(hideFlag);
         *              clothes[name].gameObject.SetActive(isVisible);
         *      }
         */

        public void UpdateChildren(List <IntName> NewInternalNetIDs)
        {
            List <SpriteHandler> SHS = new List <SpriteHandler>();

            foreach (var ID in NewInternalNetIDs)
            {
                bool Contains = false;
                foreach (var InetID in InternalNetIDs)
                {
                    if (InetID.Name == ID.Name)
                    {
                        Contains = true;
                    }
                }

                if (Contains == false)
                {
                    if (CustomNetworkManager.Instance.allSpawnablePrefabs.Count > ID.Int)
                    {
                        var OB       = Instantiate(CustomNetworkManager.Instance.allSpawnablePrefabs[ID.Int], this.CustomisationSprites.transform).transform;
                        var Net      = SpriteHandlerManager.GetRecursivelyANetworkBehaviour(OB.gameObject);
                        var Handlers = OB.GetComponentsInChildren <SpriteHandler>();

                        foreach (var SH in Handlers)
                        {
                            SpriteHandlerManager.UnRegisterHandler(Net, SH);
                        }

                        OB.SetParent(this.CustomisationSprites.transform);
                        OB.name          = ID.Name;
                        OB.localScale    = Vector3.one;
                        OB.localPosition = Vector3.zero;
                        OB.localRotation = Quaternion.identity;



                        var SNO = OB.GetComponent <SpriteHandlerNorder>();
                        if (OpenSprites.Contains(SNO) == false)
                        {
                            OpenSprites.Add(SNO);
                        }

                        foreach (var SH in Handlers)
                        {
                            SHS.Add(SH);
                            SpriteHandlerManager.RegisterHandler(Net, SH);
                        }
                    }
                }
            }

            foreach (var ID in InternalNetIDs)
            {
                bool Contains = false;
                foreach (var InetID in NewInternalNetIDs)
                {
                    if (InetID.Name == ID.Name)
                    {
                        Contains = true;
                    }
                }

                if (Contains == false)
                {
                    foreach (var bodyPartSpritese in OpenSprites.ToArray())
                    {
                        if (bodyPartSpritese.name == ID.Name)
                        {
                            OpenSprites.Remove(bodyPartSpritese);
                            Destroy(bodyPartSpritese.gameObject);
                        }
                    }
                }
            }

            foreach (var SNO in OpenSprites)
            {
                foreach (var internalNetID in NewInternalNetIDs)
                {
                    if (internalNetID.Name == SNO.name)
                    {
                        SNO.UpdateData(internalNetID.Data);
                    }
                }
            }

            InternalNetIDs = NewInternalNetIDs;
        }
Exemple #3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (checkBox1.Checked)
                {
                    //Итоговый реестр

                    if (comboBox2.SelectedIndex == 0)
                    {
                        Refresh();

                        var Tbr = new TotalByStation();
                        Tbr.TBS(dateTimePicker1.Value.ToShortDateString(), dateTimePicker2.Value.ToShortDateString(), dt);

                        dt.Clear();
                    }
                    else
                    {
                        // Итоговый реестр по собственнику

                        var Tbr = new TotalByStation();
                        Tbr.TotalByCompany(dateTimePicker1.Value.Date.ToString(), dateTimePicker2.Value.Date.ToString(), comboBox2.SelectedValue, comboBox2.Text, dateTimePicker1.Value.ToShortDateString(), dateTimePicker2.Value.ToShortDateString());
                    }
                }
                else
                {
                    // АУТН

                    if (checkBox5.Checked)
                    {
                        Refresh();

                        var Autn = new AUTN();
                        Autn.AUTN_Report(dt);

                        dt.Clear();
                    }
                    //Общий реестр
                    if (checkBox2.Checked)
                    {
                        if (comboBox2.SelectedIndex == 0)
                        {
                            var GR = new General_Reestr();
                            GR.General_Reesters(dateTimePicker1.Value.Date.ToString(), dateTimePicker2.Value.Date.ToString());
                        }
                    }
                    // СНО Реализация
                    if (checkBox4.Checked)
                    {
                        Refresh();
                        var Sno = new SNO();
                        Sno.SNO_OUT(dateTimePicker1.Value.Date.ToShortDateString(), dateTimePicker2.Value.Date.ToShortDateString(), dt);
                        dt.Clear();
                    }
                    else
                    {
                        // СНО Приход
                        if (checkBox6.Checked)
                        {
                            Refresh();

                            var Sno = new SNO();
                            Sno.SNO_IN(dateTimePicker1.Value.Date.ToShortDateString(), dateTimePicker2.Value.Date.ToShortDateString(), dt);
                            dt.Clear();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #4
0
 public string LookupSNOName(SNO.SNOGroup snoGroup, int snoId)
 {
     string str;
     if (dictionary_0.TryGetValue(new Tuple<SNO.SNOGroup, int>(snoGroup, snoId), out str))
     {
         return str;
     }
     using (MemoryInjector class2 = new MemoryInjector(Globals.mem, 20))
     {
         Globals.mem.Injector.CallFunction(Offsets.gnGetDisplayedNameForSnoId, CallingConvention.Cdecl, new object[] { snoId, (uint)class2.Address, (uint)snoGroup });
         str = Globals.mem.ReadMemoryAsString((uint)Globals.mem.ReadMemory<IntPtr>(class2.Address + 4), 0x200, Encoding.UTF8);
         dictionary_0.Add(new Tuple<SNO.SNOGroup, int>(snoGroup, snoId), str);
         return str;
     }
 }
Exemple #5
0
 public static extern void SubscribeReport(ref f9rc.RcClientSession ses, ref ClientConfig cfg, SNO from, RptFilter filter);
Exemple #6
0
        public CacheACDItem(ACDItem item)
        {
            ACDItem          = item;
            SNO              = item.ActorSNO;
            ThisInternalName = item.InternalName;

            try
            {
                _thisLevel = item.Level;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item level for {0} \r\n {1}", SimpleDebugString, ex.Message);
            }


            ItemDataEntry itemEntry;

            if (TheCache.ObjectIDCache.ItemDataEntries.TryGetValue(SNO, out itemEntry))
            {
                ItemType          = itemEntry.ItemType;
                ThisDBItemType    = ItemFunc.PluginItemTypeToDBItemType(ItemType);
                ThisFollowerType  = ItemFunc.ReturnFollowerType(ItemType);
                LegendaryItemType = itemEntry.LegendaryType;
            }
            else
            {
                ThisFollowerType = item.FollowerSpecialType;
                ThisDBItemType   = item.ItemType;
                ItemType         = ItemFunc.DetermineItemType(ThisInternalName, ThisDBItemType, ThisFollowerType);
            }

            BaseItemType    = ItemFunc.DetermineBaseType(ItemType);
            IsStackableItem = ItemFunc.DetermineIsStackable(ItemType, SNO);
            IsTwoSlot       = !IsStackableItem && ItemFunc.DetermineIsTwoSlot(ItemType);

            //Armor / Jewelery / Weapons / Offhand / Follower Items
            if (BaseItemType == PluginBaseItemTypes.Armor || BaseItemType == PluginBaseItemTypes.Jewelry || BaseItemType == PluginBaseItemTypes.Offhand || BaseItemType == PluginBaseItemTypes.WeaponOneHand || BaseItemType == PluginBaseItemTypes.WeaponRange || BaseItemType == PluginBaseItemTypes.WeaponTwoHand || BaseItemType == PluginBaseItemTypes.FollowerItem)
            {
                if (BaseItemType == PluginBaseItemTypes.WeaponOneHand)
                {
                    ThisOneHanded = true;
                }
                else if (BaseItemType == PluginBaseItemTypes.WeaponTwoHand)
                {
                    TwoHanded = true;
                }


                try
                {
                    ItemStats thesestats = item.Stats;
                    ItemStatString     = thesestats.ToString();
                    ItemStatProperties = new ItemProperties(thesestats);

                    if (ItemStatProperties.Sockets > 0)
                    {
                        SocketsFilled = item.NumSocketsFilled;
                    }
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item stats {0} \r\n {1}", SimpleDebugString, ex.Message);
                }


                #region Durability
                try
                {
                    //Durability
                    DurabilityCurrent = item.CurrentDurability;
                    DurabilityMax     = item.MaxDurability;
                    DurabilityPercent = item.DurabilityPercent;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item durability {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion

                #region ItemQualityLevel
                try
                {
                    _thisQuality = item.ItemQualityLevel;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item quality {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion
            }
            else
            {            //Gem, Misc
                if (ItemType == PluginItemTypes.KeyStone)
                {
                    KeystoneRank = ItemFunc.GetGreaterRiftKeystoneRank(SNO);

                    if (KeystoneRank == -1)
                    {
                        try
                        {
                            KeystoneRank = item.TieredLootRunKeyLevel;
                        }
                        catch (Exception ex)
                        {
                            Logger.DBLog.DebugFormat("Failed to get TieredLootRunKeyLevel for Keystone!{0} \r\n {1}", SimpleDebugString, ex.Message);
                        }
                    }
                }
                else if (BaseItemType == PluginBaseItemTypes.Gem && ItemType == PluginItemTypes.LegendaryGem)
                {
                    try
                    {
                        LegendaryGemRank = item.JewelRank;
                    }
                    catch (Exception ex)
                    {
                        Logger.DBLog.DebugFormat("Failed to get Jewel Rank for Legendary Gem!{0} \r\n {1}", SimpleDebugString, ex.Message);
                    }

                    try
                    {
                        LegendaryGemType = (LegendaryGemTypes)Enum.Parse(typeof(LegendaryGemTypes), SNO.ToString());
                    }
                    catch (Exception)
                    {
                        LegendaryGemType = LegendaryGemTypes.None;
                    }
                }
                else
                {
                    IsPotion = ItemType == PluginItemTypes.HealthPotion || ItemType == PluginItemTypes.LegendaryHealthPotion;
                    if (IsPotion)
                    {
                        PotionType = ItemFunc.ReturnPotionType(SNO);
                    }
                }

                #region DyeType
                try
                {
                    _thisDyeType = item.DyeType;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item dye type {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion

                if (IsStackableItem)
                {
                    #region ItemStackQuantity
                    try
                    {
                        _thisItemStackQuantity = item.ItemStackQuantity;
                    }
                    catch (Exception ex)
                    {
                        Logger.Write(LogLevel.Items, "Failed to retrieve item stack quanity {0} \r\n {1}", SimpleDebugString, ex.Message);
                    }
                    #endregion

                    #region ItemStackMaxQuantity
                    try
                    {
                        _maxstackquanity = item.MaxStackCount;
                    }
                    catch (Exception ex)
                    {
                        Logger.Write(LogLevel.Items, "Failed to retrieve item max stack quanity {0} \r\n {1}", SimpleDebugString, ex.Message);
                    }
                    #endregion
                }
            }


            #region GameBalanceId
            try
            {
                ThisBalanceID = item.GameBalanceId;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item GameBalanceId {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region ACDGuid
            try
            {
                ACDGUID = item.ACDGuid;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item ACDGUID {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region DynamicId
            try
            {
                ThisDynamicID = item.DynamicId;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item DynamicId {0} \r\n {1}", SimpleDebugString, ex.Message);
            }

            #endregion

            #region Name
            try
            {
                _thisRealName = item.Name;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item name {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region Gold
            try
            {
                _thisGoldAmount = item.Gold;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item gold amount {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion


            if (!IsStackableItem)
            {
                #region IsUnidentified
                try
                {
                    _isUnidentified = item.IsUnidentified;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item is identified {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion
            }

            #region IsVendorBought
            try
            {
                _isVendorBought = item.IsVendorBought;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item is vendor bought {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region InventoryRow/Column
            try
            {
                invRow = item.InventoryRow;
                invCol = item.InventoryColumn;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item inventory row/column {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion


            if (itemEntry == null && !_isUnidentified && ItemType != PluginItemTypes.Unknown && _thisRealName != String.Empty)
            {
                if (FunkyBaseExtension.Settings.Debugging.DebuggingData && FunkyBaseExtension.Settings.Debugging.DebuggingDataTypes.HasFlag(DebugDataTypes.Items))
                {
                    ObjectCache.DebuggingData.CheckEntry(this);
                }
            }
        }
Exemple #7
0
 // ------------------------------------------------------------------
 /// 訂閱回報, ses 與 cfg 必須是 FnOnConfig_ 事件通知時提供的 ref.
 public static unsafe void SubscribeReport(f9rc.ClientSession ses, ref ClientConfig cfg, SNO from, RptFilter filter)
 => SubscribeReport(ref *ses.RcSes_, ref cfg, from, filter);
Exemple #8
0
 public override string ToString()
 {
     return(SNO.ToString());
 }
Exemple #9
0
 public static string GetSlug(SNOType type, SNO sno)
 => _snoSlugs[type][sno];
Exemple #10
0
 public static SNOType GetSNOType(SNO sno)
 {
     return(_snoSlugs.FirstOrDefault(x => x.Value.ContainsKey(sno)).Key);
 }
Exemple #11
0
 public static void PowerUseGUID(uint guid, SNO.SNOPowerId snoPower)
 {
     PowerUseGUID(guid, (uint)snoPower);
 }