Esempio n. 1
0
        public static string GenerateLabrune(string text, string catalog)
        {
            string catalogName = "GM_CATALOG_" + catalog;
            string hash        = Hashing.HexHash(Hashing.BinHash(catalogName));

            return("0	"+ hash + "	" + catalogName + "	" + text);
        }
Esempio n. 2
0
        //this was used once to generate wheel labrune/vlt
        public static void GenerateWheelNames(string filesPath, WheelsArr allwheels)
        {
            int LowerRimSize = 17;
            int UpperRimSize = 21;

            string catalogHead = "GM_CATALOG_";

            for (int i = 0; i < allwheels.wheels.Length; i++)
            {
                for (int j = 0; j < allwheels.wheels[i].rims.Length; j++)
                {
                    string style = "STYLE0" + (j + 1).ToString();

                    for (int k = LowerRimSize; k < UpperRimSize + 1; k++)
                    {
                        string itemName    = allwheels.wheels[i].brand + "_" + style + "_" + k.ToString() + "_" + "25";
                        uint   itembinHash = Hashing.BinHash(itemName);
                        string nodeName    = VLTOps.GetVltNodeHash(itemName);
                        string catalogName = catalogHead + itemName;
                        string text        = allwheels.wheels[i].rims[j] + " " + k.ToString() + '"' + " WHEELS";

                        uint   catalogBinHash = Hashing.BinHash(catalogName);
                        string catalogbinHex  = Hashing.HexHash(catalogBinHash);

                        StreamWriter labrunew = new StreamWriter(filesPath + "labrune.txt", true);
                        labrunew.Write("0\t" + catalogbinHex + "\t" + catalogName + "\t" + text + "\n");
                        labrunew.Dispose();

                        StreamWriter vltedw = new StreamWriter(filesPath + "vlted.nfsms", true);
                        vltedw.Write(VLTOps.vltedCommands[0] + " virtualitem " + nodeName + " title " + catalogName + "\n");
                        vltedw.Dispose();
                    }
                }
            }
        }
Esempio n. 3
0
        //FindNodeByString
        public static string GetVltNodeHash(string name)
        {
            //get hex from BinHash
            //turn it to string
            string hash = "0x" + Hashing.HexHash(Hashing.BinHash(name));

            //turn it lowercase
            hash = hash.ToLower();
            //put that string to VLTHash
            string vlthash = "0x" + Hashing.HexHash(Hashing.VLTHash(hash));

            //get node name lowercase
            vlthash = vlthash.ToLower();
            return(vlthash);
        }