X-Git-Url: http://git.osdn.net/view?p=automap%2Fautomap.git;a=blobdiff_plain;f=ShardProcessor%2FProgram.cs;h=e1c004b9e5b949cf581cb9d59625a63cbcab6fa9;hp=800712ddeeb7b170f5d593072ecb209e0f6af4ee;hb=514075d66a5c63b22d252c6bb9f642d92d27d764;hpb=209d0405a1e6410a9383efc47af2ee30abf0cced diff --git a/ShardProcessor/Program.cs b/ShardProcessor/Program.cs index 800712d..e1c004b 100644 --- a/ShardProcessor/Program.cs +++ b/ShardProcessor/Program.cs @@ -39,7 +39,7 @@ namespace ShardProcessor private static void ArgsDecoder(string[ ] args) { //#1 Path to maps '~/ApplicationData/vintagestory/Map/World_1234567890 - mapPath = args[1]; + mapPath = args.Length > 1 ? args[1] : String.Empty; //#0 Command: Heightmaps (Generation from existing shard data) string command = args[0]; @@ -63,6 +63,10 @@ namespace ShardProcessor Scan_OneShard( ); break; + case @"--protoheader": + Emit_ProtoHeader(); + break; + default: Console.WriteLine("Unrecognized Command: {0}", command); break; @@ -298,5 +302,21 @@ namespace ShardProcessor } } + + private static void Emit_ProtoHeader( ) + { + Console.WriteLine("Created Protobuf Header files."); + using (var entitiesProto = File.CreateText("Entities.protoc")) + { + entitiesProto.Write(Serializer.GetProto( )); + entitiesProto.Flush( ); + } + + + using (var pointsProto = File.CreateText("Points.protoc")) { + pointsProto.Write(Serializer.GetProto( )); + pointsProto.Flush( ); + } + } } }