• R/O
  • HTTP
  • SSH
  • HTTPS

automap: Commit

Automap (OSS) GIT software repository


Commit MetaInfo

Revision989738939a2e623b8bf6db337968e3114a9a99ee (tree)
Zeit2020-10-27 07:32:34
Autormelchior <melchior@user...>
Commitermelchior

Log Message

W.I.P. Fixes for several issues - plus better Shard processing

Ändern Zusammenfassung

Diff

--- a/Automap/Data/ColumnMeta.cs
+++ b/Automap/Data/ColumnMeta.cs
@@ -193,6 +193,12 @@ namespace Automap
193193
194194 }
195195
196+ internal void ClearMetadata( )
197+ {
198+ this.HeightMap = null;
199+ this.RockRatio = null;
200+ this._flattened_HeightMap = null;
201+ }
196202
197203 internal ColumnMeta Reload(ICoreClientAPI clientAPI)
198204 {
@@ -285,8 +291,7 @@ namespace Automap
285291 {
286292 for (int i = 0, maxItemsCount = this.Items.Count; i < maxItemsCount; i++) {
287293 ColumnMeta entry = this.Items[i];
288- entry.HeightMap = null;
289- entry.RockRatio = null;//Also regenerated when any chunk in a column is changed...
294+ entry.ClearMetadata( );
290295 }
291296 }
292297
--- a/Automap/Designators/DefaultDesignators.cs
+++ b/Automap/Designators/DefaultDesignators.cs
@@ -2,6 +2,8 @@
22 using System.Collections.Generic;
33 using System.Drawing;
44 using System.Text;
5+using System.Text.RegularExpressions;
6+
57 using Vintagestory.API.Client;
68 using Vintagestory.API.Common;
79 using Vintagestory.API.Common.Entities;
@@ -12,6 +14,8 @@ namespace Automap
1214 {
1315 public static class DefaultDesignators
1416 {
17+ private static Regex stripControlChars = new Regex(@"\s", RegexOptions.Multiline);
18+
1519 public static BlockDesignator Roads =
1620 new BlockDesignator(
1721 new AssetLocation("game", "stonepath"),
@@ -100,7 +104,7 @@ namespace Automap
100104 Name = "Sign",
101105 PrettyLocation = posn.PrettyCoords(clientAPI),
102106 Location = posn.Copy(),
103- Notes = signEntity.text.Replace("\n"," "),
107+ Notes = stripControlChars.Replace(signEntity.text, " "),
104108 Timestamp = DateTime.UtcNow,
105109 }
106110 );
@@ -127,7 +131,7 @@ namespace Automap
127131 Name = "Signpost",
128132 PrettyLocation = posn.PrettyCoords(clientAPI),
129133 Location = posn.Copy(),
130- Notes = string.Join(",", signEntity.textByCardinalDirection).Replace("\n", " "),
134+ Notes = stripControlChars.Replace(string.Join(",", signEntity.textByCardinalDirection), " "),
131135 Timestamp = DateTime.UtcNow,
132136 }
133137 );
--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -240,8 +240,6 @@ namespace Automap
240240 #endif
241241 }
242242 }
243- //Cleanup in-memory Metadata...
244- chunkTopMetadata.ClearMetadata();
245243 }
246244
247245 UpdateStatus(this.updatedChunksTotal, this.nullChunkCount, updatedChunks);
@@ -252,6 +250,9 @@ namespace Automap
252250 updatedChunksTotal += updatedChunks;
253251 JsonGenerator.GenerateJSONMetadata(chunkTopMetadata, startChunkColumn, POIs, EOIs, RockIdCodes);
254252 updatedChunks = 0;
253+
254+ //Cleanup in-memory Metadata...
255+ chunkTopMetadata.ClearMetadata( );
255256 }
256257
257258 //Then sleep until interupted again, and repeat
Show on old repository browser