From 142753ae13ec9a88ae8d5ef62634906827184475 Mon Sep 17 00:00:00 2001 From: Quintin Date: Mon, 4 Oct 2021 22:17:58 -0400 Subject: [PATCH] Fix format error on build --- .../Voxelfield/Interface/LoadingInterface.cs | 1 + .../Voxelfield/Session/SessionManager.cs | 22 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Assets/Scripts/Voxelfield/Interface/LoadingInterface.cs b/Assets/Scripts/Voxelfield/Interface/LoadingInterface.cs index f1683ad5..0e6c633c 100644 --- a/Assets/Scripts/Voxelfield/Interface/LoadingInterface.cs +++ b/Assets/Scripts/Voxelfield/Interface/LoadingInterface.cs @@ -27,6 +27,7 @@ private void Update() MapProgressInfo progressInfo = session.GetChunkManager().ProgressInfo; m_Text.SetText(progressInfo.stage switch { + MapLoadingStage.Waiting => "Waiting...", MapLoadingStage.CleaningUp => "Cleaning up...", MapLoadingStage.SettingUp => "Setting up...", MapLoadingStage.Generating => "Generating terrain from save...", diff --git a/Assets/Scripts/Voxelfield/Session/SessionManager.cs b/Assets/Scripts/Voxelfield/Session/SessionManager.cs index 8df49bea..2bfed0b4 100644 --- a/Assets/Scripts/Voxelfield/Session/SessionManager.cs +++ b/Assets/Scripts/Voxelfield/Session/SessionManager.cs @@ -38,7 +38,7 @@ public class SessionManager : SingletonBehavior private static IPAddress DefaultAddress => IPAddress.Loopback; public static int DefaultPort => 27015; private static readonly IPEndPoint DefaultEndPoint = new(DefaultAddress, DefaultPort); - private static readonly string[] IpSeparator = {":"}; + private static readonly string[] IpSeparator = { ":" }; public static bool WantsApplicationQuit { get; set; } @@ -73,7 +73,7 @@ private void Start() { // OrderedVoxelChangesProperty c = MapManager.Singleton.Map.voxelChanges, clone = c.Clone(); // c.Clear(); - + // foreach (VoxelChange change in clone.List) // { // VoxelChange v = change; @@ -93,11 +93,11 @@ private void Start() OrderedVoxelChangesProperty c = mapManager.Map.voxelChanges, clone = c.Clone(); c.Clear(); - foreach (VoxelChange voxel in clone.List) + foreach (VoxelChange voxel in clone.List) if (voxel.form != VoxelVolumeForm.Single) c.Append(voxel); }); - + SetCommand("serve", arguments => { Server server = StartServer(GetEndPoint(arguments)); @@ -368,7 +368,7 @@ public static void SaveCustomMap() { name = new StringProperty("Fort"), terrainHeight = new IntProperty(9), - dimension = new DimensionComponent {lowerBound = new Position3IntProperty(-2, 0, -2), upperBound = new Position3IntProperty(2, 1, 2)}, + dimension = new DimensionComponent { lowerBound = new Position3IntProperty(-2, 0, -2), upperBound = new Position3IntProperty(2, 1, 2) }, terrainGeneration = new TerrainGenerationComponent { seed = new IntProperty(1337), @@ -377,8 +377,8 @@ public static void SaveCustomMap() verticalScale = new FloatProperty(1.5f), persistence = new FloatProperty(0.5f), lacunarity = new FloatProperty(0.5f), - grassVoxel = new VoxelChangeProperty(new VoxelChange {texture = VoxelTexture.Solid, color = new Color32(255, 172, 7, 255)}), - stoneVoxel = new VoxelChangeProperty(new VoxelChange {texture = VoxelTexture.Checkered, color = new Color32(28, 28, 28, 255)}), + grassVoxel = new VoxelChangeProperty(new VoxelChange { texture = VoxelTexture.Solid, color = new Color32(255, 172, 7, 255) }), + stoneVoxel = new VoxelChangeProperty(new VoxelChange { texture = VoxelTexture.Checkered, color = new Color32(28, 28, 28, 255) }), }, models = models, breakableEdges = new BoolProperty(false) @@ -449,18 +449,18 @@ private static void Build(ScriptingImplementation scripting, BuildTarget target, scripting == ScriptingImplementation.Mono2x ? ManagedStrippingLevel.Disabled : ManagedStrippingLevel.Low); var buildPlayerOptions = new BuildPlayerOptions { - scenes = new[] {"Assets/Scenes/Base.unity"}, + scenes = new[] { "Assets/Scenes/Base.unity" }, locationPathName = executablePath, - target = target, - options = isServer ? BuildOptions.EnableHeadlessMode : BuildOptions.AutoRunPlayer + target = target }; + EditorUserBuildSettings.standaloneBuildSubtarget = isServer ? StandaloneBuildSubtarget.Server : StandaloneBuildSubtarget.Player; if (defines != null) buildPlayerOptions.extraScriptingDefines = defines; BuildReport report = BuildPipeline.BuildPlayer(buildPlayerOptions); BuildSummary summary = report.summary; switch (summary.result) { case BuildResult.Succeeded: - Debug.Log($"{name} build succeeded: {summary.totalSize / 1_000_000:F1} mb in {summary.totalTime:mm:ss}"); + Debug.Log($"{name} build succeeded: {summary.totalSize / 1_000_000} mb in {summary.totalTime:mm\\:ss}"); break; case BuildResult.Unknown: case BuildResult.Failed: