punish v6.8.18.0

This commit is contained in:
alydev 2025-10-09 07:47:19 +10:00
commit 060278c1b7
317 changed files with 554155 additions and 0 deletions

View file

@ -0,0 +1,448 @@
using System.Collections.Generic;
namespace Questionable.Model.Common.Converter;
public sealed class AetheryteConverter : EnumConverter<EAetheryteLocation>
{
private static readonly Dictionary<EAetheryteLocation, string> Values = new Dictionary<EAetheryteLocation, string>
{
{
EAetheryteLocation.Gridania,
"Gridania"
},
{
EAetheryteLocation.CentralShroudBentbranchMeadows,
"Central Shroud - Bentbranch Meadows"
},
{
EAetheryteLocation.EastShroudHawthorneHut,
"East Shroud - Hawthorne Hut"
},
{
EAetheryteLocation.SouthShroudQuarrymill,
"South Shroud - Quarrymill"
},
{
EAetheryteLocation.SouthShroudCampTranquil,
"South Shroud - Camp Tranquil"
},
{
EAetheryteLocation.NorthShroudFallgourdFloat,
"North Shroud - Fallgourd Float"
},
{
EAetheryteLocation.Uldah,
"Ul'dah"
},
{
EAetheryteLocation.WesternThanalanHorizon,
"Western Thanalan - Horizon"
},
{
EAetheryteLocation.CentralThanalanBlackBrushStation,
"Central Thanalan - Black Brush Station"
},
{
EAetheryteLocation.EasternThanalanCampDrybone,
"Eastern Thanalan - Camp Drybone"
},
{
EAetheryteLocation.SouthernThanalanLittleAlaMhigo,
"Southern Thanalan - Little Ala Mhigo"
},
{
EAetheryteLocation.SouthernThanalanForgottenSprings,
"Southern Thanalan - Forgotten Springs"
},
{
EAetheryteLocation.NorthernThanalanCampBluefog,
"Northern Thanalan - Camp Bluefog"
},
{
EAetheryteLocation.NorthernThanalanCeruleumProcessingPlant,
"Northern Thanalan - Ceruleum Processing Plant"
},
{
EAetheryteLocation.Limsa,
"Limsa Lominsa"
},
{
EAetheryteLocation.MiddleLaNosceaSummerfordFarms,
"Middle La Noscea - Summerford Farms"
},
{
EAetheryteLocation.LowerLaNosceaMorabyDrydocks,
"Lower La Noscea - Moraby Drydocks"
},
{
EAetheryteLocation.EasternLaNosceaCostaDelSol,
"Eastern La Noscea - Costa Del Sol"
},
{
EAetheryteLocation.EasternLaNosceaWineport,
"Eastern La Noscea - Wineport"
},
{
EAetheryteLocation.WesternLaNosceaSwiftperch,
"Western La Noscea - Swiftperch"
},
{
EAetheryteLocation.WesternLaNosceaAleport,
"Western La Noscea - Aleport"
},
{
EAetheryteLocation.UpperLaNosceaCampBronzeLake,
"Upper La Noscea - Camp Bronze Lake"
},
{
EAetheryteLocation.OuterLaNosceaCampOverlook,
"Outer La Noscea - Camp Overlook"
},
{
EAetheryteLocation.CoerthasCentralHighlandsCampDragonhead,
"Coerthas Central Highlands - Camp Dragonhead"
},
{
EAetheryteLocation.MorDhona,
"Mor Dhona"
},
{
EAetheryteLocation.WolvesDenPier,
"Wolves' Den Pier"
},
{
EAetheryteLocation.GoldSaucer,
"Gold Saucer"
},
{
EAetheryteLocation.Ishgard,
"Ishgard"
},
{
EAetheryteLocation.Idyllshire,
"Idyllshire"
},
{
EAetheryteLocation.CoerthasWesternHighlandsFalconsNest,
"Coerthas Western Highlands - Falcon's Nest"
},
{
EAetheryteLocation.SeaOfCloudsCampCloudtop,
"The Sea of Clouds - Camp Cloudtop"
},
{
EAetheryteLocation.SeaOfCloudsOkZundu,
"The Sea of Clouds - Ok' Zundu"
},
{
EAetheryteLocation.AzysLlaHelix,
"Azys Lla - Helix"
},
{
EAetheryteLocation.DravanianForelandsTailfeather,
"The Dravanian Forelands - Tailfeather"
},
{
EAetheryteLocation.DravanianForelandsAnyxTrine,
"The Dravanian Forelands - Anyx Trine"
},
{
EAetheryteLocation.ChurningMistsMoghome,
"The Churning Mists - Moghome"
},
{
EAetheryteLocation.ChurningMistsZenith,
"The Churning Mists - Zenith"
},
{
EAetheryteLocation.RhalgrsReach,
"Rhalgr's Reach"
},
{
EAetheryteLocation.FringesCastrumOriens,
"Fringes - Castrum Oriens"
},
{
EAetheryteLocation.FringesPeeringStones,
"Fringes - Peering Stones"
},
{
EAetheryteLocation.PeaksAlaGannha,
"Peaks - Ala Gannha"
},
{
EAetheryteLocation.PeaksAlaGhiri,
"Peaks - Ala Ghiri"
},
{
EAetheryteLocation.LochsPortaPraetoria,
"Lochs - Porta Praetoria"
},
{
EAetheryteLocation.LochsAlaMhiganQuarter,
"Lochs - Ala Mhigan Quarter"
},
{
EAetheryteLocation.Kugane,
"Kugane"
},
{
EAetheryteLocation.RubySeaTamamizu,
"Ruby Sea - Tamamizu"
},
{
EAetheryteLocation.RubySeaOnokoro,
"Ruby Sea - Onokoro"
},
{
EAetheryteLocation.YanxiaNamai,
"Yanxia - Namai"
},
{
EAetheryteLocation.YanxiaHouseOfTheFierce,
"Yanxia - House of the Fierce"
},
{
EAetheryteLocation.AzimSteppeReunion,
"Azim Steppe - Reunion"
},
{
EAetheryteLocation.AzimSteppeDawnThrone,
"Azim Steppe - Dawn Throne"
},
{
EAetheryteLocation.AzimSteppeDhoroIloh,
"Azim Steppe - Dhoro Iloh"
},
{
EAetheryteLocation.DomanEnclave,
"Doman Enclave"
},
{
EAetheryteLocation.Crystarium,
"Crystarium"
},
{
EAetheryteLocation.Eulmore,
"Eulmore"
},
{
EAetheryteLocation.LakelandFortJobb,
"Lakeland - Fort Jobb"
},
{
EAetheryteLocation.LakelandOstallImperative,
"Lakeland - Ostall Imperative"
},
{
EAetheryteLocation.KholusiaStilltide,
"Kholusia - Stilltide"
},
{
EAetheryteLocation.KholusiaWright,
"Kholusia - Wright"
},
{
EAetheryteLocation.KholusiaTomra,
"Kholusia - Tomra"
},
{
EAetheryteLocation.AmhAraengMordSouq,
"Amh Araeng - Mord Souq"
},
{
EAetheryteLocation.AmhAraengInnAtJourneysHead,
"Amh Araeng - Inn at Journey's Head"
},
{
EAetheryteLocation.AmhAraengTwine,
"Amh Araeng - Twine"
},
{
EAetheryteLocation.RaktikaSlitherbough,
"Rak'tika - Slitherbough"
},
{
EAetheryteLocation.RaktikaFanow,
"Rak'tika - Fanow"
},
{
EAetheryteLocation.IlMhegLydhaLran,
"Il Mheg - Lydha Lran"
},
{
EAetheryteLocation.IlMhegPlaEnni,
"Il Mheg - Pla Enni"
},
{
EAetheryteLocation.IlMhegWolekdorf,
"Il Mheg - Wolekdorf"
},
{
EAetheryteLocation.TempestOndoCups,
"Tempest - Ondo Cups"
},
{
EAetheryteLocation.TempestMacarensesAngle,
"Tempest - Macarenses Angle"
},
{
EAetheryteLocation.OldSharlayan,
"Old Sharlayan"
},
{
EAetheryteLocation.RadzAtHan,
"Radz-at-Han"
},
{
EAetheryteLocation.LabyrinthosArcheion,
"Labyrinthos - Archeion"
},
{
EAetheryteLocation.LabyrinthosSharlayanHamlet,
"Labyrinthos - Sharlayan Hamlet"
},
{
EAetheryteLocation.LabyrinthosAporia,
"Labyrinthos - Aporia"
},
{
EAetheryteLocation.ThavnairYedlihmad,
"Thavnair - Yedlihmad"
},
{
EAetheryteLocation.ThavnairGreatWork,
"Thavnair - Great Work"
},
{
EAetheryteLocation.ThavnairPalakasStand,
"Thavnair - Palaka's Stand"
},
{
EAetheryteLocation.GarlemaldCampBrokenGlass,
"Garlemald - Camp Broken Glass"
},
{
EAetheryteLocation.GarlemaldTertium,
"Garlemald - Tertium"
},
{
EAetheryteLocation.MareLamentorumSinusLacrimarum,
"Mare Lamentorum - Sinus Lacrimarum"
},
{
EAetheryteLocation.MareLamentorumBestwaysBurrow,
"Mare Lamentorum - Bestways Burrow"
},
{
EAetheryteLocation.ElpisAnagnorisis,
"Elpis - Anagnorisis"
},
{
EAetheryteLocation.ElpisTwelveWonders,
"Elpis - Twelve Wonders"
},
{
EAetheryteLocation.ElpisPoietenOikos,
"Elpis - Poieten Oikos"
},
{
EAetheryteLocation.UltimaThuleReahTahra,
"Ultima Thule - Reah Tahra"
},
{
EAetheryteLocation.UltimaThuleAbodeOfTheEa,
"Ultima Thule - Abode of the Ea"
},
{
EAetheryteLocation.UltimaThuleBaseOmicron,
"Ultima Thule - Base Omicron"
},
{
EAetheryteLocation.Tuliyollal,
"Tuliyollal"
},
{
EAetheryteLocation.SolutionNine,
"Solution Nine"
},
{
EAetheryteLocation.UrqopachaWachunpelo,
"Urqopacha - Wachunpelo"
},
{
EAetheryteLocation.UrqopachaWorlarsEcho,
"Urqopacha - Worlar's Echo"
},
{
EAetheryteLocation.KozamaukaOkHanu,
"Kozama'uka - Ok'hanu"
},
{
EAetheryteLocation.KozamaukaManyFires,
"Kozama'uka - Many Fires"
},
{
EAetheryteLocation.KozamaukaEarthenshire,
"Kozama'uka - Earthenshire"
},
{
EAetheryteLocation.KozamaukaDockPoga,
"Kozama'uka - Dock Poga"
},
{
EAetheryteLocation.YakTelIqBraax,
"Yak T'el - Iq Br'aax"
},
{
EAetheryteLocation.YakTelMamook,
"Yak T'el - Mamook"
},
{
EAetheryteLocation.ShaaloaniHhusatahwi,
"Shaaloani - Hhusatahwi"
},
{
EAetheryteLocation.ShaaloaniShesheneweziSprings,
"Shaaloani - Sheshenewezi Springs"
},
{
EAetheryteLocation.ShaaloaniMehwahhetsoan,
"Shaaloani - Mehwahhetsoan"
},
{
EAetheryteLocation.HeritageFoundYyasulaniStation,
"Heritage Found - Yyasulani Station"
},
{
EAetheryteLocation.HeritageFoundTheOutskirts,
"Heritage Found - The Outskirts"
},
{
EAetheryteLocation.HeritageFoundElectropeStrike,
"Heritage Found - Electrope Strike"
},
{
EAetheryteLocation.LivingMemoryLeynodeMnemo,
"Living Memory - Leynode Mnemo"
},
{
EAetheryteLocation.LivingMemoryLeynodePyro,
"Living Memory - Leynode Pyro"
},
{
EAetheryteLocation.LivingMemoryLeynodeAero,
"Living Memory - Leynode Aero"
}
};
public AetheryteConverter()
: base((IReadOnlyDictionary<EAetheryteLocation, string>)Values)
{
}
public static bool IsLargeAetheryte(EAetheryteLocation aetheryte)
{
return Values.ContainsKey(aetheryte);
}
}

View file

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Questionable.Model.Common.Converter;
public abstract class EnumConverter<T> : JsonConverter<T> where T : Enum
{
private readonly ReadOnlyDictionary<T, string> _enumToString;
private readonly ReadOnlyDictionary<string, T> _stringToEnum;
protected EnumConverter(IReadOnlyDictionary<T, string> values)
{
_enumToString = ((values is IDictionary<T, string> dictionary) ? new ReadOnlyDictionary<T, string>(dictionary) : new ReadOnlyDictionary<T, string>(values.ToDictionary<KeyValuePair<T, string>, T, string>((KeyValuePair<T, string> x) => x.Key, (KeyValuePair<T, string> x) => x.Value)));
_stringToEnum = new ReadOnlyDictionary<string, T>(_enumToString.ToDictionary<KeyValuePair<T, string>, string, T>((KeyValuePair<T, string> x) => x.Value, (KeyValuePair<T, string> x) => x.Key));
}
public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.String)
{
throw new JsonException();
}
string text = reader.GetString();
if (text == null)
{
throw new JsonException();
}
if (!_stringToEnum.TryGetValue(text, out var value))
{
throw new JsonException();
}
return value;
}
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
{
writer.WriteStringValue(_enumToString[value]);
}
}

View file

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Questionable.Model.Common.Converter;
public sealed class StringListOrValueConverter : JsonConverter<List<string>>
{
public override List<string> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.String)
{
return new List<string>(1) { reader.GetString() };
}
if (reader.TokenType != JsonTokenType.StartArray)
{
throw new JsonException();
}
reader.Read();
List<string> list = new List<string>();
while (reader.TokenType != JsonTokenType.EndArray)
{
list.Add(reader.GetString());
reader.Read();
}
return list;
}
public override void Write(Utf8JsonWriter writer, List<string>? value, JsonSerializerOptions options)
{
if (value == null)
{
writer.WriteNullValue();
return;
}
if (value.Count == 1)
{
writer.WriteStringValue(value[0]);
return;
}
writer.WriteStartArray();
foreach (string item in value)
{
writer.WriteStringValue(item);
}
writer.WriteEndArray();
}
}

View file

@ -0,0 +1,61 @@
using System;
using System.Numerics;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Questionable.Model.Common.Converter;
public sealed class VectorConverter : JsonConverter<Vector3>
{
public override Vector3 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.StartObject)
{
throw new JsonException();
}
Vector3 result = default(Vector3);
while (reader.Read())
{
switch (reader.TokenType)
{
case JsonTokenType.PropertyName:
{
string text = reader.GetString();
if (text == null || !reader.Read())
{
throw new JsonException();
}
switch (text)
{
case "X":
result.X = reader.GetSingle();
break;
case "Y":
result.Y = reader.GetSingle();
break;
case "Z":
result.Z = reader.GetSingle();
break;
default:
throw new JsonException();
}
break;
}
case JsonTokenType.EndObject:
return result;
default:
throw new JsonException();
}
}
throw new JsonException();
}
public override void Write(Utf8JsonWriter writer, Vector3 value, JsonSerializerOptions options)
{
writer.WriteStartObject();
writer.WriteNumber("X", value.X);
writer.WriteNumber("Y", value.Y);
writer.WriteNumber("Z", value.Z);
writer.WriteEndObject();
}
}