OSDN Git Service

1st attempt to fix Protocol buffer corruption issue
[automap/automap.git] / Automap / Subsystems / AutomapSystem.cs
index 4bab7de..0a85be3 100644 (file)
@@ -3,7 +3,6 @@ using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using System.Reflection;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading;
@@ -11,8 +10,6 @@ using System.Threading;
 using Hjg.Pngcs;
 using Hjg.Pngcs.Chunks;
 
-using Newtonsoft.Json;
-
 using ProtoBuf;
 
 using Vintagestory.API.Client;
@@ -496,6 +493,11 @@ namespace Automap
                                                Logger.Error("PNG Corruption file '{0}' - Reason: {1}", shardFile.Name, someEx);
                                                continue;
                                        }
+                                       catch (ProtoException protoEx) 
+                                       {
+                                               Logger.Error("ProtoBuf invalid! file:'{0}' - Reason: {1}", shardFile.Name, protoEx);
+                                               continue;
+                                       }
                                }
                        }