コード例 #1
0
        public override void PopulateData(RowParser parser, Lumina.GameData lumina, Language language)
        {
            base.PopulateData(parser, lumina, language);

            Entries = new Entry[60];

            for (var i = 0; i < Entries.Length; i++)
            {
                Entries[i] = new Entry {
                    Result = new[] {
                        new ResultEntry {
                            Item  = new LazyRow <Item>(lumina, parser.ReadColumn <int>(1 + i), language),
                            Count = parser.ReadColumn <uint>(61 + i),
                            SpecialShopItemCategory = new LazyRow <SpecialShopItemCategory>(lumina, parser.ReadColumn <int>(121 + i), language),
                            HQ = parser.ReadColumn <bool>(181 + i)
                        },
                        new ResultEntry {
                            Item  = new LazyRow <Item>(lumina, parser.ReadColumn <int>(241 + i), language),
                            Count = parser.ReadColumn <uint>(301 + i),
                            SpecialShopItemCategory = new LazyRow <SpecialShopItemCategory>(lumina, parser.ReadColumn <int>(361 + i), language),
                            HQ = parser.ReadColumn <bool>(421 + i)
                        }
                    },
                    Cost = new[] {
                        new CostEntry {
                            Item           = new LazyRow <Item>(lumina, parser.ReadColumn <int>(481 + i), language),
                            Count          = parser.ReadColumn <uint>(541 + i),
                            HQ             = parser.ReadColumn <bool>(601 + i),
                            Collectability = parser.ReadColumn <ushort>(661 + i)
                        },
                        new CostEntry {
                            Item           = new LazyRow <Item>(lumina, parser.ReadColumn <int>(721 + i), language),
                            Count          = parser.ReadColumn <uint>(781 + i),
                            HQ             = parser.ReadColumn <bool>(841 + i),
                            Collectability = parser.ReadColumn <ushort>(901 + i)
                        },
                        new CostEntry {
                            Item           = new LazyRow <Item>(lumina, parser.ReadColumn <int>(961 + i), language),
                            Count          = parser.ReadColumn <uint>(1021 + i),
                            HQ             = parser.ReadColumn <bool>(1081 + i),
                            Collectability = parser.ReadColumn <ushort>(1141 + i)
                        }
                    },
                    Quest             = new LazyRow <Quest>(lumina, parser.ReadColumn <int>(1201 + i), language),
                    Unknown6          = parser.ReadColumn <int>(1261 + i),
                    AchievementUnlock = new LazyRow <Achievement>(lumina, parser.ReadColumn <int>(1321 + i), language),
                    Unknown8          = parser.ReadColumn <byte>(1381 + i),
                    PatchNumber       = parser.ReadColumn <ushort>(1441 + i)
                };
            }
            UseCurrencyType = parser.ReadColumn <byte>(1501);
            QuestUnlock     = new LazyRow <Quest>(lumina, parser.ReadColumn <uint>(1502), language);
            CompleteText    = new LazyRow <DefaultTalk>(lumina, parser.ReadColumn <int>(1503), language);
            NotCompleteText = new LazyRow <DefaultTalk>(lumina, parser.ReadColumn <int>(1504), language);
            Unknown1505     = parser.ReadColumn <uint>(1505);
            Unknown1506     = parser.ReadColumn <bool>(1506);
        }
コード例 #2
0
        public override void PopulateData(RowParser parser, LuminaData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            this.Name            = parser.ReadColumn <SeString>(0);
            this.PlaceNameRegion = new LazyRow <PlaceName>(gameData, parser.ReadColumn <ushort>(3), language);
            this.PlaceNameZone   = new LazyRow <PlaceName>(gameData, parser.ReadColumn <ushort>(4), language);
            this.PlaceName       = new LazyRow <PlaceName>(gameData, parser.ReadColumn <ushort>(5), language);
            this.WeatherRate     = parser.ReadColumn <byte>(12);
        }
        public LuminaSheet(LuminaData lumina)
        {
            this.lumina = lumina;

            ExcelSheet <TConcreteType>?sheet = lumina.GetExcelSheet <TConcreteType>();

            if (sheet == null)
            {
                throw new Exception($"Failed to read lumina excel sheet: {typeof(TConcreteType)}");
            }

            this.excel = sheet;
        }
コード例 #4
0
        public override void PopulateData(RowParser parser, LuminaData lumina, Language language)
        {
            this.RowId    = parser.Row;
            this.SubRowId = parser.SubRow;

            this.Description       = parser.ReadColumn <SeString>(8);
            this.Name              = parser.ReadColumn <SeString>(9);
            this.Icon              = parser.ReadColumn <ushort>(10);
            this.ItemUICategory    = parser.ReadColumn <byte>(15);
            this.EquipSlotCategory = new LazyRow <Generated.EquipSlotCategory>(lumina, parser.ReadColumn <byte>(17), language);
            this.ClassJobCategory  = new LazyRow <ClassJobCategory>(lumina, parser.ReadColumn <byte>(44), language);
            this.ModelMain         = parser.ReadColumn <ulong>(48);
            this.ModelSub          = parser.ReadColumn <ulong>(49);
        }
コード例 #5
0
ファイル: CharaMakeType.cs プロジェクト: Caraxi/Anamnesis
        public override void PopulateData(RowParser parser, LuminaData lumina, Language language)
        {
            this.RowId    = parser.Row;
            this.SubRowId = parser.SubRow;

            this.Race   = new LazyRow <Race>(lumina, parser.ReadColumn <int>(0), language);
            this.Tribe  = new LazyRow <Tribe>(lumina, parser.ReadColumn <int>(1), language);
            this.Gender = parser.ReadColumn <sbyte>(2);

            this.FacialFeatureOptions = new int[7 * 8];
            for (int i = 0; i < 7 * 8; i++)
            {
                this.FacialFeatureOptions[i] = parser.ReadColumn <int>(3291 + i);
            }
        }
コード例 #6
0
        public override void PopulateData(RowParser parser, LuminaData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            this.Name = parser.ReadColumn <SeString>(0);
            this.ADV  = parser.ReadColumn <bool>(1);
            this.GLA  = parser.ReadColumn <bool>(2);
            this.PGL  = parser.ReadColumn <bool>(3);
            this.MRD  = parser.ReadColumn <bool>(4);
            this.LNC  = parser.ReadColumn <bool>(5);
            this.ARC  = parser.ReadColumn <bool>(6);
            this.CNJ  = parser.ReadColumn <bool>(7);
            this.THM  = parser.ReadColumn <bool>(8);
            this.CRP  = parser.ReadColumn <bool>(9);
            this.BSM  = parser.ReadColumn <bool>(10);
            this.ARM  = parser.ReadColumn <bool>(11);
            this.GSM  = parser.ReadColumn <bool>(12);
            this.LTW  = parser.ReadColumn <bool>(13);
            this.WVR  = parser.ReadColumn <bool>(14);
            this.ALC  = parser.ReadColumn <bool>(15);
            this.CUL  = parser.ReadColumn <bool>(16);
            this.MIN  = parser.ReadColumn <bool>(17);
            this.BTN  = parser.ReadColumn <bool>(18);
            this.FSH  = parser.ReadColumn <bool>(19);
            this.PLD  = parser.ReadColumn <bool>(20);
            this.MNK  = parser.ReadColumn <bool>(21);
            this.WAR  = parser.ReadColumn <bool>(22);
            this.DRG  = parser.ReadColumn <bool>(23);
            this.BRD  = parser.ReadColumn <bool>(24);
            this.WHM  = parser.ReadColumn <bool>(25);
            this.BLM  = parser.ReadColumn <bool>(26);
            this.ACN  = parser.ReadColumn <bool>(27);
            this.SMN  = parser.ReadColumn <bool>(28);
            this.SCH  = parser.ReadColumn <bool>(29);
            this.ROG  = parser.ReadColumn <bool>(30);
            this.NIN  = parser.ReadColumn <bool>(31);
            this.MCH  = parser.ReadColumn <bool>(32);
            this.DRK  = parser.ReadColumn <bool>(33);
            this.AST  = parser.ReadColumn <bool>(34);
            this.SAM  = parser.ReadColumn <bool>(35);
            this.RDM  = parser.ReadColumn <bool>(36);
            this.BLU  = parser.ReadColumn <bool>(37);
            this.GNB  = parser.ReadColumn <bool>(38);
            this.DNC  = parser.ReadColumn <bool>(39);
        }
コード例 #7
0
        public static void GenerateJSON(Cyalume luminaEn, Cyalume luminaDe, Cyalume luminaFr, Cyalume luminaJp, HttpClient http, string outputPath)
        {
            var towns   = luminaEn.GetExcelSheet <Town>();
            var townsDe = luminaDe.GetExcelSheet <Town>();
            var townsFr = luminaFr.GetExcelSheet <Town>();
            var townsJp = luminaJp.GetExcelSheet <Town>();

            var townsChs = JObject.Parse(http.GetStringAsync(new Uri("https://cafemaker.wakingsands.com/Town"))
                                         .GetAwaiter().GetResult())["Results"]
                           .Children()
                           .Select(town => town.ToObject <XIVAPITown>())
                           .ToList();

            townsChs.Add(new XIVAPITown
            {
                ID   = 0,
                Name = "不知何处",
            });

            var outputTowns = new List <JObject>();

            foreach (var town in towns)
            {
                dynamic outputTown = new JObject();

                outputTown.ID = town.RowId;

                var iconObj = town.Icon;
                outputTown.Icon = iconObj != 0 ? $"/i/{Util.GetIconFolder(iconObj)}/{iconObj:000000}.png" : $"/i/{Util.GetIconFolder(060880)}/060880.png";

                outputTown.Name_en = (string)town.Name;
                outputTown.Name_de = (string)townsDe.First(localItem => localItem.RowId == town.RowId).Name;
                outputTown.Name_fr = (string)townsFr.First(localItem => localItem.RowId == town.RowId).Name;
                outputTown.Name_jp = (string)townsJp.First(localItem => localItem.RowId == town.RowId).Name;

                // This may be null when Global has a new expansion that CN does not yet have
                outputTown.Name_chs = townsChs.FirstOrDefault(localItem => localItem.ID == town.RowId)?.Name;

                outputTowns.Add(outputTown);
            }

            File.WriteAllText(Path.Combine(outputPath, "Town.json"), JsonConvert.SerializeObject(outputTowns));
        }
コード例 #8
0
ファイル: Startup.cs プロジェクト: NotAdam/LuminaAPI-Demo
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services
            .AddControllers();

            var luminaInstance = new Lumina.GameData(Configuration.GetValue <string>("DataPath"));

            Service <Lumina.GameData> .Set(luminaInstance);

            Service <SheetTypeCache> .Set(new SheetTypeCache( luminaInstance ));

            services.AddSingleton(luminaInstance);

            services
            .AddGraphQLServer()
            .BindRuntimeType <UInt32, UnsignedIntType>()
            .BindRuntimeType <UInt64, UnsignedLongType>()
            .BindRuntimeType <UInt64, UnsignedLongType>()
            .BindRuntimeType <SeString, StringType>()
            .AddTypeConverter <SeString, string>(x =>
            {
                return(x.RawString);
            })
            // .AddTypeConverter< ILazyRow, object >( x =>
            // {
            //     return x.RawRow;
            // } )
            .SetPagingOptions(new PagingOptions
            {
                DefaultPageSize   = 100,
                MaxPageSize       = 250,
                IncludeTotalCount = true
            })
#if DEBUG
            .OnSchemaError((err, ex) => { Debugger.Break(); })
#endif
            // .AddDirectiveType< LanguageDirectiveType >()
            .BindRuntimeType <UInt16, UnsignedShortType>()
            // todo: fix this shit because it's not actually valid
            .BindRuntimeType <sbyte, IntType>()
            .AddType <SheetsQueryType>()
            .AddQueryType <QueryType>();
        }
コード例 #9
0
        public SheetsController(Lumina.GameData gameData)
        {
            _gameData = gameData;

            if (_sheetNameToTypes != null)
            {
                return;
            }

            _sheetNameToTypes = new();

            var assembly = typeof(Lumina.Excel.GeneratedSheets.Action).Assembly;

            foreach (var type in assembly.GetTypes().Where(x => x.Namespace == typeof(Lumina.Excel.GeneratedSheets.Action).Namespace))
            {
                _sheetNameToTypes[type.Name.ToLowerInvariant()] = type;
            }

            _getSheetT = typeof(Lumina.GameData)
                         .GetMethods(BindingFlags.Instance | BindingFlags.Public)
                         .FirstOrDefault(x => x.Name == "GetExcelSheet" && x.GetParameters().Any());
        }
コード例 #10
0
        public static void GenerateJSON(Cyalume lumina, string outputPath)
        {
            var worlds = lumina.GetExcelSheet <World>() !;

            var outputWorlds = new List <JObject>();

            var douDouChai = new[] { "ShuiJingTa", "YinLeiHu", "TaiYangHaiAn", "YiXiuJiaDe", "HongChaChuan", "XueSongYuan" };

            foreach (var world in worlds)
            {
                if (douDouChai.Contains(world.Name))
                {
                    continue;
                }

                dynamic outputWorld = new JObject();
                outputWorld.ID = world.RowId;

                outputWorld.Name = (string)world.Name;
                if (((string)world.Name).EndsWith("2"))
                {
                    outputWorld.Name = ((string)world.Name)[..^ 1];
コード例 #11
0
 public FFXIVWeatherLuminaService(Cyalume lumina)
 {
     this.cyalume = lumina;
 }
コード例 #12
0
 public LuminaSheet(LuminaData lumina)
 {
     this.lumina = lumina;
     this.excel  = lumina.GetExcelSheet <TConcreteType>();
 }
コード例 #13
0
        public override void PopulateData(RowParser parser, LuminaData lumina, Language language)
        {
            base.PopulateData(parser, lumina, language);

            this.Name = parser.ReadColumn <SeString>(0);
        }
コード例 #14
0
        public static void GenerateChinese(Cyalume lumina, IEnumerable <CsvItem> itemsChs, string outputPath)
        {
            var output = new Dictionary <string, List <string[]> >();

            var counter    = 0;
            var baseTop    = Console.CursorTop;
            var localItems = lumina.GetExcelSheet <Item>();
            var categories = lumina.GetExcelSheet <ItemSearchCategory>();

            Parallel.ForEach(categories, category =>
            {
                if (category.RowId < 9)
                {
                    goto console_update;
                }

                var categoryItems = new List <string[]>();
                var filteredItems = itemsChs.Where(item => item?.ItemSearchCategory.RowId == category.RowId).ToList();

                Parallel.ForEach(filteredItems, item =>
                {
                    var outputItem = new string[6];

                    var classJobAbbr = item.ItemSearchCategory.ClassJob.Value.Abbreviation ?? "";
                    if (item.ItemSearchCategory.ClassJob.Value.ClassJobParent.Value.Abbreviation != classJobAbbr)
                    {
                        classJobAbbr = item.ItemSearchCategory.ClassJob.Value.ClassJobParent.Value.Abbreviation + " " +
                                       classJobAbbr;
                    }
                    else if (Resources.ClassJobMap.TryGetValue(classJobAbbr, out var jobAbbr))
                    {
                        classJobAbbr += " " + jobAbbr;
                    }
                    else if (classJobAbbr == "ADV")
                    {
                        classJobAbbr = "";
                    }

                    var iconId = (ushort)localItems.First(itm => itm.RowId == item.Key).Icon;
                    var icon   = $"/i/{Util.GetIconFolder(iconId)}/{iconId:000000}.png";

                    outputItem[0] = item.Key.ToString();
                    outputItem[1] = item.Name;
                    outputItem[2] = icon;
                    outputItem[3] = item.LevelItem.ToString();
                    outputItem[4] = item.Rarity.ToString();
                    outputItem[5] = classJobAbbr;

                    lock (categoryItems)
                    {
                        categoryItems.Add(outputItem);
                    }
                });

                categoryItems.Sort((item1, item2) => int.Parse(item2[3]) - int.Parse(item1[3]));

                if (categoryItems.Count == 0)
                {
                    goto console_update;
                }

                output[category.RowId.ToString()] = categoryItems;

                console_update:
                Console.CursorLeft = 0;
                Console.CursorTop  = baseTop;
                Console.Write($"ch: [{counter}/{categories.Count() - 1}]");
                Console.CursorLeft = 10 + counter.ToString("000").Length;
                Console.Write("                                                                              ");

                counter++;
            });

            File.WriteAllText(Path.Combine(outputPath, "categories_chs.js"), JsonConvert.SerializeObject(output));

            Console.WriteLine();
        }
コード例 #15
0
        public static void Generate(Cyalume luminaEn, Cyalume luminaDe, Cyalume luminaFr, Cyalume luminaJp, string outputPath)
        {
            string[]             langs      = { "en", "de", "fr", "ja" };
            Cyalume[]            realms     = { luminaEn, luminaDe, luminaFr, luminaJp };
            IEnumerable <Item>[] itemSheets = { luminaEn.GetExcelSheet <Item>(), luminaDe.GetExcelSheet <Item>(), luminaFr.GetExcelSheet <Item>(), luminaJp.GetExcelSheet <Item>() };

            var baseTop = Console.CursorTop;

            Parallel.For(0, 4, i =>
            {
                dynamic output = new JObject();
                var categories = realms[i].GetExcelSheet <ItemSearchCategory>();
                foreach (var category in categories)
                {
                    if (category.RowId < 9)
                    {
                        goto console_update;
                    }

                    var categoryItems = new List <string[]>();
                    var sortedItems   = itemSheets[i].Where(item => item.ItemSearchCategory.Row == category.RowId).ToList();
                    sortedItems.Sort((item1, item2) => (int)(item2.LevelItem.Row - item1.LevelItem.Row));

                    foreach (var item in sortedItems)
                    {
                        var outputItem = new string[6];

                        string classJobAbbr = item.ItemSearchCategory.Value.ClassJob.Value.Abbreviation;
                        if (item.ItemSearchCategory.Value.ClassJob.Value.ClassJobParent.Value.Abbreviation != classJobAbbr)
                        {
                            classJobAbbr = item.ItemSearchCategory.Value.ClassJob.Value.ClassJobParent.Value.Abbreviation + " " + classJobAbbr;
                        }
                        else if (Resources.ClassJobMap.TryGetValue(classJobAbbr, out var jobAbbr))
                        {
                            classJobAbbr += " " + jobAbbr;
                        }
                        else if (classJobAbbr == "ADV" || classJobAbbr == "ABE" || classJobAbbr == "AVN")
                        {
                            classJobAbbr = "";
                        }

                        outputItem[0] = item.RowId.ToString();
                        outputItem[1] = (string)item.Name;
                        outputItem[2] = $"/i/{Util.GetIconFolder(item.Icon)}/{item.Icon:000000}.png";
                        outputItem[3] = item.LevelItem.Row.ToString();
                        outputItem[4] = item.Rarity.ToString();
                        outputItem[5] = classJobAbbr;

                        categoryItems.Add(outputItem);
                    }

                    if (categoryItems.Count == 0)
                    {
                        goto console_update;
                    }

                    output[category.RowId.ToString()] = JToken.FromObject(categoryItems);

                    console_update:
                    Console.CursorLeft = 0;
                    Console.CursorTop  = baseTop + i;
                    Console.Write($"{langs[i]}: [{category.RowId}/{categories.Count() - 1}]");
                    Console.CursorLeft = 10 + category.RowId.ToString("000").Length;
                    Console.Write("                                                                              ");
                }

                File.WriteAllText(Path.Combine(outputPath, $"categories_{langs[i]}.js"), JsonConvert.SerializeObject(output));
            });

            Console.CursorLeft = 0;
            Console.CursorTop  = baseTop + 4;
        }