diff --git a/.github/workflows/Wiki.yml b/.github/workflows/Wiki.yml deleted file mode 100644 index 188dfd3e1b..0000000000 --- a/.github/workflows/Wiki.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Update Wiki - -on: - workflow_dispatch: - push: - branches: [ master, jsondump ] - paths: - - '.github/workflows/Wiki.yml' - - 'Content.Shared/Chemistry/**.cs' - - 'Content.Server/Chemistry/**.cs' - - 'Content.Server/GuideGenerator/**.cs' - - 'Content.Server/Corvax/GuideGenerator/**.cs' - - 'Resources/Prototypes/Reagents/**.yml' - - 'Resources/Prototypes/Chemistry/**.yml' - - 'Resources/Prototypes/Recipes/Reactions/**.yml' - - 'RobustToolbox/' - -jobs: - update-wiki: - name: Build and Publish JSON blobs to wiki - runs-on: ubuntu-latest - - steps: - - name: Checkout Master - uses: actions/checkout@v3.6.0 - - - name: Setup Submodule - run: | - git submodule update --init --recursive - - - name: Pull Engine Updates - uses: space-wizards/submodule-dependency@v0.1.5 - - - name: Update Engine Submodules - run: | - cd RobustToolbox/ - git submodule update --init --recursive - - - name: Setup .NET Core - uses: actions/setup-dotnet@v3.2.0 - - - name: Install Dependencies - run: dotnet restore - - - name: Build Project - run: dotnet build --configuration Release --no-restore /p:WarningsAsErrors=nullable /m - - - name: Generate JSON blobs for prototypes - run: dotnet ./bin/Content.Server/Content.Server.dll --cvar autogen.destination_file=prototypes.json - continue-on-error: true - - - name: Upload chem_prototypes.json to wiki - uses: jtmullen/mediawiki-edit-action@v0.1.1 - with: - wiki_text_file: ./bin/Content.Server/data/chem_prototypes.json - edit_summary: Update chem_prototypes.json via GitHub Actions - page_name: "${{ secrets.WIKI_PAGE_ROOT }}/chem_prototypes.json" - api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php - username: ${{ secrets.WIKI_BOT_USER }} - password: ${{ secrets.WIKI_BOT_PASS }} - - - name: Upload react_prototypes.json to wiki - uses: jtmullen/mediawiki-edit-action@v0.1.1 - with: - wiki_text_file: ./bin/Content.Server/data/react_prototypes.json - edit_summary: Update react_prototypes.json via GitHub Actions - page_name: "${{ secrets.WIKI_PAGE_ROOT }}/react_prototypes.json" - api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php - username: ${{ secrets.WIKI_BOT_USER }} - password: ${{ secrets.WIKI_BOT_PASS }} - - - name: Upload entity_prototypes.json to wiki - uses: jtmullen/mediawiki-edit-action@v0.1.1 - with: - wiki_text_file: ./bin/Content.Server/data/entity_prototypes.json - edit_summary: Update entity_prototypes.json via GitHub Actions - page_name: "${{ secrets.WIKI_PAGE_ROOT }}/entity_prototypes.json" - api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php - username: ${{ secrets.WIKI_BOT_USER }} - password: ${{ secrets.WIKI_BOT_PASS }} - - - name: Upload mealrecipes_prototypes.json to wiki - uses: jtmullen/mediawiki-edit-action@v0.1.1 - with: - wiki_text_file: ./bin/Content.Server/data/mealrecipes_prototypes.json - edit_summary: Update mealrecipes_prototypes.json via GitHub Actions - page_name: "${{ secrets.WIKI_PAGE_ROOT }}/mealrecipes_prototypes.json" - api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php - username: ${{ secrets.WIKI_BOT_USER }} - password: ${{ secrets.WIKI_BOT_PASS }} diff --git a/Content.Server/GuideGenerator/ChemistryJsonGenerator.cs b/Content.Server/GuideGenerator/ChemistryJsonGenerator.cs index 7e107ce1a5..f57c63a1d0 100644 --- a/Content.Server/GuideGenerator/ChemistryJsonGenerator.cs +++ b/Content.Server/GuideGenerator/ChemistryJsonGenerator.cs @@ -38,6 +38,7 @@ public static void PublishJson(StreamWriter file) var serializeOptions = new JsonSerializerOptions { WriteIndented = true, + NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowNamedFloatingPointLiterals, // Corvax-Wiki Converters = { new UniversalJsonConverter(), diff --git a/Content.Server/GuideGenerator/ReactionJsonGenerator.cs b/Content.Server/GuideGenerator/ReactionJsonGenerator.cs index 123dd5f8eb..89e02c2fa5 100644 --- a/Content.Server/GuideGenerator/ReactionJsonGenerator.cs +++ b/Content.Server/GuideGenerator/ReactionJsonGenerator.cs @@ -22,6 +22,7 @@ public static void PublishJson(StreamWriter file) var serializeOptions = new JsonSerializerOptions { WriteIndented = true, + NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowNamedFloatingPointLiterals, // Corvax-Wiki Converters = { new UniversalJsonConverter(), diff --git a/Content.Server/GuideGenerator/UniversalJsonConverter.cs b/Content.Server/GuideGenerator/UniversalJsonConverter.cs index a17855c548..bcf9702c1c 100644 --- a/Content.Server/GuideGenerator/UniversalJsonConverter.cs +++ b/Content.Server/GuideGenerator/UniversalJsonConverter.cs @@ -73,11 +73,6 @@ public override void Write(Utf8JsonWriter writer, T obj, JsonSerializerOptions o // If the field has a [JsonIgnore] attribute, skip it if (Attribute.GetCustomAttribute(prop, typeof(JsonIgnoreAttribute), true) != null) continue; - // If GetIndexParameters().Length is not 0 then it means that property is indexed - // And since we cannot get its values without passing index (which type can LITERALLY BE ANYTHING) then let's just skip it - // Yeah, i know that this will lead to a potential data loss, but what i can do about it? - if (prop.GetIndexParameters().Length != 0) continue; // Corvax-Wiki - // If the property has a [JsonPropertyName] attribute, get the property name. Otherwise, use the property name. JsonPropertyNameAttribute? attr = (JsonPropertyNameAttribute?) Attribute.GetCustomAttribute(prop, typeof(JsonPropertyNameAttribute), true); string name = attr == null ? prop.Name : attr.Name;