• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Automap (client) [VS plugin mod]


Commit MetaInfo

Revisão0dac6be4bc39d85b3c19c8fe644b62630dea452f (tree)
Hora2020-10-11 07:12:59
Autormelchior <melchior@user...>
Commitermelchior

Mensagem de Log

W.I.P. Inelegant fixes for a thorny problem...apparently working

Mudança Sumário

Diff

--- a/Automap/Renderers/AChunkRenderer.cs
+++ b/Automap/Renderers/AChunkRenderer.cs
@@ -41,10 +41,21 @@ namespace Automap
4141
4242 this.PngWriter = FileHelper.CreatePngWriter(filename, imageInf, true);
4343 PngMetadata meta = this.PngWriter.GetMetadata( );
44- meta.SetTimeNow( );
44+ meta.SetTimeYMDHMS(
45+ DateTime.UtcNow.Year,
46+ DateTime.UtcNow.Month,
47+ DateTime.UtcNow.Day,
48+ DateTime.UtcNow.Hour,
49+ DateTime.UtcNow.Minute,
50+ DateTime.UtcNow.Second);
4551 meta.SetText("Chunk_X", coord.X.ToString("D"));
4652 meta.SetText("Chunk_Y", coord.Y.ToString("D"));
4753 meta.SetText("PxSz", "1");
54+ var transparencyChunk = meta.CreateTRNSChunk( );
55+ transparencyChunk.SetRGB(0, 0, 0);//Same as Snapshots
56+ string gameDate = $"{ClientAPI.World.Calendar.DayOfYear:D3}-{ClientAPI.World.Calendar.Year}";
57+ meta.SetText("GameDY", gameDate);
58+
4859 //Setup specialized meta-data PNG chunks here...
4960 PngMetadataChunk pngChunkMeta = new PngMetadataChunk(this.PngWriter.ImgInfo) {
5061 ChunkMetadata = metadata
--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -1,4 +1,5 @@
11 using System;
2+using System.Collections;
23 using System.Collections.Concurrent;
34 using System.Collections.Generic;
45 using System.IO;
@@ -194,6 +195,7 @@ namespace Automap
194195
195196 if (mapChunk == null)
196197 {
198+ //TODO: REVISIT THIS CHUNK!
197199 Logger.Warning("SKIP CHUNK: ({0}) - Map Chunk NULL!", mostActiveCol.Key);
198200 nullMapCount++;
199201 columnCounter.TryRemove(mostActiveCol.Key, out ejectedItem);
@@ -204,16 +206,16 @@ namespace Automap
204206 if (chunkTopMetadata.Contains(mostActiveCol.Key))
205207 {
206208 chunkMeta = chunkTopMetadata[mostActiveCol.Key];
207-#if DEBUG
208- Logger.VerboseDebug("Loaded chunk {0}", mostActiveCol.Key);
209-#endif
209+ #if DEBUG
210+ Logger.VerboseDebug("Loaded meta-chunk {0}", mostActiveCol.Key);
211+ #endif
210212 }
211213 else
212214 {
213215 chunkMeta = CreateColumnMetadata(mostActiveCol, mapChunk);
214-#if DEBUG
215- Logger.VerboseDebug("Created chunk {0}", mostActiveCol.Key);
216-#endif
216+ #if DEBUG
217+ Logger.VerboseDebug("Created meta-chunk {0}", mostActiveCol.Key);
218+ #endif
217219 }
218220 ProcessChunkBlocks(mostActiveCol.Key, mapChunk, ref chunkMeta);
219221
@@ -222,9 +224,9 @@ namespace Automap
222224
223225 if (updatedPixels > 0)
224226 {
225-#if DEBUG
226- Logger.VerboseDebug("Wrote chunk shard: ({0}) - Edits#:{1}, Pixels#:{2}", mostActiveCol.Key, mostActiveCol.Value, updatedPixels);
227-#endif
227+ #if DEBUG
228+ Logger.VerboseDebug("Wrote top-chunk shard: ({0}) - Edits#:{1}, Pixels#:{2}", mostActiveCol.Key, mostActiveCol.Value, updatedPixels);
229+ #endif
228230 updatedChunks++;
229231 chunkTopMetadata.Update(chunkMeta);
230232 columnCounter.TryRemove(mostActiveCol.Key, out ejectedItem);
@@ -232,9 +234,9 @@ namespace Automap
232234 else
233235 {
234236 columnCounter.TryRemove(mostActiveCol.Key, out ejectedItem);
235-#if DEBUG
236- Logger.VerboseDebug("Un-painted chunk: ({0}) ", mostActiveCol.Key);
237-#endif
237+ #if DEBUG
238+ Logger.VerboseDebug("Un-painted chun shard: ({0}) ", mostActiveCol.Key);
239+ #endif
238240 }
239241 }
240242 //Cleanup persisted Metadata...
@@ -549,14 +551,18 @@ namespace Automap
549551 nullChunkCount++;
550552 continue;
551553 }
552- worldChunk.Unpack( );//RESEARCH: Thread Unsafe?
553554
555+ if (worldChunk.IsPacked())
556+ {
557+ Logger.VerboseDebug("WORLD chunk: Compressed: X{0} Y{1} Z{2}", key.X, targetChunkY, key.Y);
558+ worldChunk.Unpack( );//RESEARCH: Thread Unsafe?
559+ }
554560
555561 /*************** Chunk Entities Scanning *********************/
556562 if (worldChunk.BlockEntities != null && worldChunk.BlockEntities.Count > 0)
557563 {
558564 #if DEBUG
559- Logger.VerboseDebug("Surface@ {0} = BlockEntities: {1}", key, worldChunk.BlockEntities.Count);
565+ Logger.VerboseDebug("Scan pos.({0}) for BlockEntities# {1}", key, worldChunk.BlockEntities.Count);
560566 #endif
561567
562568 foreach (var blockEnt in worldChunk.BlockEntities)
@@ -569,6 +575,8 @@ namespace Automap
569575 }
570576 }
571577
578+ //NOTE: Temporary; remove - replace later
579+ if (chunkMeta.ColumnPresense == null) { chunkMeta.ColumnPresense = new BitArray((ClientAPI.World.BlockAccessor.MapSizeY / chunkSize), false); }
572580 chunkMeta.ColumnPresense[targetChunkY] = true;
573581
574582 /********************* Chunk/Column BLOCKs scanning ****************/
@@ -580,44 +588,56 @@ namespace Automap
580588 if (chunkMeta.HeightMap == null) { chunkMeta.HeightMap = new ushort[chunkSize, chunkSize]; }
581589 if (chunkMeta.RockRatio == null) { chunkMeta.RockRatio = new Dictionary<int, uint>(10); }
582590
591+ //First Chance fail-safe;
592+ if (worldChunk.Blocks == null || worldChunk.Blocks.Length <= 0) {
593+ Logger.VerboseDebug("WORLD chunk; Missing block DATA⁈ X{0} Y{1} Z{2} ⁈", key.X, targetChunkY, key.Y);
594+ continue;
595+ }
596+
583597 for (Y_index = 0; Y_index < chunkSize - 1; Y_index++)
584598 {
585599 for (Z_index = 0; Z_index < chunkSize - 1; Z_index++)
586600 {
587601 for (X_index = 0; X_index < chunkSize - 1; X_index++)
588602 {
589- /* Encode packed indicie
590- (y * chunksize + z) * chunksize + x
591- */
592- var indicie = Helpers.ChunkBlockIndicie16(X_index, Y_index, Z_index);
593- int aBlockId = worldChunk.Blocks[indicie];
594-
595- if (aBlockId == 0)
596- {//Air
597- chunkMeta.AirBlocks++;
598- continue;
599- }
600-
601- if (RockIdCodes.ContainsKey(aBlockId))
602- {
603- if (chunkMeta.RockRatio.ContainsKey(aBlockId))
604- chunkMeta.RockRatio[aBlockId]++;
605- else
606- chunkMeta.RockRatio.Add(aBlockId, 1);
607- }
608-
609- chunkMeta.NonAirBlocks++;
610-
611- //Heightmap
612- if (chunkMeta.HeightMap[X_index, Z_index] == 0)
613- {
614- chunkMeta.HeightMap[X_index, Z_index] = (ushort) (Y_index + (targetChunkY * chunkSize));
615- }
603+ /* Encode packed indicie
604+ (y * chunksize + z) * chunksize + x
605+ */
606+ var indicie = Helpers.ChunkBlockIndicie16(X_index, Y_index, Z_index);
607+
608+ //'Last' Chance fail-safe;
609+ if (worldChunk.Blocks == null || worldChunk.Blocks.Length <= 0) {
610+ Logger.VerboseDebug("Processing Block: Missing block DATA⁈ X{0} Y{1} Z{2} ⁈", X_index, Y_index, Z_index);
611+ goto loop_bustout;;
616612 }
617- }
613+
614+ int aBlockId = worldChunk.Blocks[indicie];
618615
619- }
616+ if (aBlockId == 0)
617+ {//Air
618+ chunkMeta.AirBlocks++;
619+ continue;
620+ }
621+
622+ if (RockIdCodes.ContainsKey(aBlockId))
623+ {
624+ if (chunkMeta.RockRatio.ContainsKey(aBlockId))
625+ chunkMeta.RockRatio[aBlockId]++;
626+ else
627+ chunkMeta.RockRatio.Add(aBlockId, 1);
628+ }
620629
630+ chunkMeta.NonAirBlocks++;
631+
632+ //Heightmap
633+ if (chunkMeta.HeightMap[X_index, Z_index] == 0)
634+ {
635+ chunkMeta.HeightMap[X_index, Z_index] = (ushort) (Y_index + (targetChunkY * chunkSize));
636+ }
637+ }
638+ }
639+ }
640+ loop_bustout:;
621641 }
622642 }
623643
--- /dev/null
+++ b/ShardProcessor/Program.cs
@@ -0,0 +1,12 @@
1+using System;
2+
3+namespace ShardProcessor
4+{
5+ class MainClass
6+ {
7+ public static void Main(string[ ] args)
8+ {
9+ Console.WriteLine("Hello World!");
10+ }
11+ }
12+}
--- /dev/null
+++ b/ShardProcessor/Properties/AssemblyInfo.cs
@@ -0,0 +1,27 @@
1+using System.Reflection;
2+using System.Runtime.CompilerServices;
3+
4+// Information about this assembly is defined by the following attributes.
5+// Change them to the values specific to your project.
6+
7+[assembly: AssemblyTitle("ShardProcessor")]
8+[assembly: AssemblyDescription("")]
9+[assembly: AssemblyConfiguration("")]
10+[assembly: AssemblyCompany("")]
11+[assembly: AssemblyProduct("")]
12+[assembly: AssemblyCopyright("librarian")]
13+[assembly: AssemblyTrademark("")]
14+[assembly: AssemblyCulture("")]
15+
16+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
18+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
19+
20+[assembly: AssemblyVersion("1.0.*")]
21+
22+// The following attributes are used to specify the signing key for the assembly,
23+// if desired. See the Mono documentation for more information about signing.
24+
25+//[assembly: AssemblyDelaySign(false)]
26+//[assembly: AssemblyKeyFile("")]
27+
--- /dev/null
+++ b/ShardProcessor/ShardProcessor.csproj
@@ -0,0 +1,37 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <PropertyGroup>
4+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+ <ProjectGuid>{837EE90B-7C03-413B-B54D-B50B2ED1EC00}</ProjectGuid>
7+ <OutputType>Exe</OutputType>
8+ <RootNamespace>ShardProcessor</RootNamespace>
9+ <AssemblyName>ShardProcessor</AssemblyName>
10+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
11+ </PropertyGroup>
12+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
13+ <DebugSymbols>true</DebugSymbols>
14+ <DebugType>full</DebugType>
15+ <Optimize>false</Optimize>
16+ <OutputPath>bin\Debug</OutputPath>
17+ <DefineConstants>DEBUG;</DefineConstants>
18+ <ErrorReport>prompt</ErrorReport>
19+ <WarningLevel>4</WarningLevel>
20+ <ExternalConsole>true</ExternalConsole>
21+ </PropertyGroup>
22+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
23+ <Optimize>true</Optimize>
24+ <OutputPath>bin\Release</OutputPath>
25+ <ErrorReport>prompt</ErrorReport>
26+ <WarningLevel>4</WarningLevel>
27+ <ExternalConsole>true</ExternalConsole>
28+ </PropertyGroup>
29+ <ItemGroup>
30+ <Reference Include="System" />
31+ </ItemGroup>
32+ <ItemGroup>
33+ <Compile Include="Program.cs" />
34+ <Compile Include="Properties\AssemblyInfo.cs" />
35+ </ItemGroup>
36+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
37+</Project>
\ No newline at end of file