Automap (client) [VS plugin mod]
Révision | 514075d66a5c63b22d252c6bb9f642d92d27d764 (tree) |
---|---|
l'heure | 2021-06-20 10:49:03 |
Auteur | melchior <melchior@user...> |
Commiter | melchior |
Added Protocol Buffer Header generation to shard-processor
@@ -39,7 +39,7 @@ namespace ShardProcessor | ||
39 | 39 | private static void ArgsDecoder(string[ ] args) |
40 | 40 | { |
41 | 41 | //#1 Path to maps '~/ApplicationData/vintagestory/Map/World_1234567890 |
42 | - mapPath = args[1]; | |
42 | + mapPath = args.Length > 1 ? args[1] : String.Empty; | |
43 | 43 | |
44 | 44 | //#0 Command: Heightmaps (Generation from existing shard data) |
45 | 45 | string command = args[0]; |
@@ -63,6 +63,10 @@ namespace ShardProcessor | ||
63 | 63 | Scan_OneShard( ); |
64 | 64 | break; |
65 | 65 | |
66 | + case @"--protoheader": | |
67 | + Emit_ProtoHeader(); | |
68 | + break; | |
69 | + | |
66 | 70 | default: |
67 | 71 | Console.WriteLine("Unrecognized Command: {0}", command); |
68 | 72 | break; |
@@ -298,5 +302,21 @@ namespace ShardProcessor | ||
298 | 302 | |
299 | 303 | } |
300 | 304 | } |
305 | + | |
306 | + private static void Emit_ProtoHeader( ) | |
307 | + { | |
308 | + Console.WriteLine("Created Protobuf Header files."); | |
309 | + using (var entitiesProto = File.CreateText("Entities.protoc")) | |
310 | + { | |
311 | + entitiesProto.Write(Serializer.GetProto<EntitiesOfInterest>( )); | |
312 | + entitiesProto.Flush( ); | |
313 | + } | |
314 | + | |
315 | + | |
316 | + using (var pointsProto = File.CreateText("Points.protoc")) { | |
317 | + pointsProto.Write(Serializer.GetProto<PointsOfInterest>( )); | |
318 | + pointsProto.Flush( ); | |
319 | + } | |
320 | + } | |
301 | 321 | } |
302 | 322 | } |