began Protobuf integration

This commit is contained in:
Timerix 2025-04-06 17:45:54 +05:00
parent 2c094bab3b
commit 890166ebce
3 changed files with 31 additions and 0 deletions

View File

@ -14,5 +14,14 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="DTLib.Web" Version="1.3.0"/> <PackageReference Include="DTLib.Web" Version="1.3.0"/>
<PackageReference Include="Google.Protobuf" Version="3.30.2" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Include="obj\Protobuf\*.g.cs" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="sh -c &quot;mkdir -p obj/Protobuf &amp;&amp; protoc Protobuf/*.proto --csharp_out=obj/Protobuf --csharp_opt=file_extension=.g.cs&quot;" />
</Target>
</Project> </Project>

View File

@ -0,0 +1,20 @@
syntax = "proto3";
option csharp_namespace = "ParadoxSaveParser.WebAPI.MyProtobuf";
message Item {
oneof value {
int64 i64 = 1;
double f64 = 2;
string str = 3;
ItemList list = 4;
ItemListMap map = 5;
}
}
message ItemList {
repeated Item items = 1;
}
message ItemListMap {
map<string, ItemList> items_map = 1;
}

View File

@ -14,3 +14,5 @@ Yet another save files parser.
- **[ParadoxSaveParser.WebAPI](./ParadoxSaveParser.WebAPI)** - - **[ParadoxSaveParser.WebAPI](./ParadoxSaveParser.WebAPI)** -
Backend for my save file analytics website (TODO: add repo link). Backend for my save file analytics website (TODO: add repo link).
## Building
1. Install protobuf compiler https://protobuf.dev/installation/