StructNeedle review

StructNeedle review

--- Core/Theraot/Threading/Needles/StructNeedle.cs
+++ Core/Theraot/Threading/Needles/StructNeedle.cs
@@ -2,7 +2,6 @@

 using System;
 using System.Collections.Generic;
-using System.Threading;

 namespace Theraot.Threading.Needles
 {
@@ -10,33 +9,22 @@
     [System.Diagnostics.DebuggerNonUserCode]
     public struct StructNeedle<T> : IEquatable<StructNeedle<T>>, IRecyclableNeedle<T>
     {
-        private T _target;
-
         public StructNeedle(T target)
         {
-            _target = target;
+            Value = target;
         }

         public bool IsAlive
         {
             get
             {
-                return _target != null;
+                return !ReferenceEquals(Value, null);
             }
         }

         public T Value
         {
-            get
-            {
-                Thread.MemoryBarrier();
-                return _target;
-            }
-            set
-            {
-                _target = value;
-                Thread.MemoryBarrier();
-            }
+            get; set;
         }

         public static explicit operator T(StructNeedle<T> needle)
@@ -68,8 +56,8 @@
             // Keep the "is" operator
             if (obj is T)
             {
-                var target = _target;
-                return IsAlive && EqualityComparer<T>.Default.Equals(target, (T) obj);
+                var target = Value;
+                return IsAlive && EqualityComparer<T>.Default.Equals(target, (T)obj);
             }
             return false;
         }
@@ -79,14 +67,18 @@
             return EqualsExtracted(this, other);
         }

+#pragma warning disable RCS1132 // Remove redundant overriding member.
+
         public override int GetHashCode()
         {
             return base.GetHashCode();
         }

+#pragma warning restore RCS1132 // Remove redundant overriding member.
+
         void IRecyclableNeedle<T>.Free()
         {
-            _target = default(T);
+            Value = default(T);
         }

         public override string ToString()


Fixed pinned buffer on request sent

Fixed pinned buffer on request sent

Change-Id: Ifaf987d12a33975ccb1426de0bc5a9091a164880

--- Criteo.Memcache/Transport/MemcacheTransport.cs
+++ Criteo.Memcache/Transport/MemcacheTransport.cs
@@ -60,10 +60,11 @@
         private readonly ConcurrentQueue<IMemcacheRequest> _pendingRequests;
         private Socket _socket;

-        private readonly SocketAsyncEventArgs _sendAsynchEvtArgs;
+        private readonly SocketAsyncEventArgs _sendAsyncEvtArgs;
         private readonly SocketAsyncEventArgs _receiveHeaderAsynchEvtArgs;
         private readonly SocketAsyncEventArgs _receiveBodyAsynchEvtArgs;
         private readonly int _pinnedBufferSize;
+        private MemoryStream _sendStream;

         private MemcacheResponseHeader _currentResponse;

@@ -105,8 +106,9 @@

             _pendingRequests = new ConcurrentQueue<IMemcacheRequest>();

-            _sendAsynchEvtArgs = new SocketAsyncEventArgs();
-            _sendAsynchEvtArgs.Completed += OnSendRequestComplete;
+            _sendAsyncEvtArgs = new SocketAsyncEventArgs();
+            _sendAsyncEvtArgs.SetBuffer(new byte[_pinnedBufferSize], 0, _pinnedBufferSize);
+            _sendAsyncEvtArgs.Completed += OnSendRequestComplete;

             _receiveHeaderAsynchEvtArgs = new SocketAsyncEventArgs();
             _receiveHeaderAsynchEvtArgs.SetBuffer(new byte[MemcacheResponseHeader.Size], 0, MemcacheResponseHeader.Size);
@@ -183,8 +185,8 @@
                             if (socket != null)
                                 socket.Dispose();

-                            if (_sendAsynchEvtArgs != null)
-                                _sendAsynchEvtArgs.Dispose();
+                            if (_sendAsyncEvtArgs != null)
+                                _sendAsyncEvtArgs.Dispose();

                             if (_receiveHeaderAsynchEvtArgs != null)
                                 _receiveHeaderAsynchEvtArgs.Dispose();
@@ -564,14 +566,19 @@
             }
         }

-        private bool SendAsynch(byte[] buffer, int offset, int count, ManualResetEventSlim callAvailable)
-        {
-            _sendAsynchEvtArgs.UserToken = callAvailable;
-
-            _sendAsynchEvtArgs.SetBuffer(buffer, offset, count);
-            if (!_socket.SendAsync(_sendAsynchEvtArgs))
-            {
-                OnSendRequestComplete(_socket, _sendAsynchEvtArgs);
+        private bool SendAsync(byte[] buffer, ManualResetEventSlim callAvailable)
+        {
+            _sendAsyncEvtArgs.UserToken = callAvailable;
+
+            int sizeToSend = Math.Min(_pinnedBufferSize, buffer.Length);
+            _sendStream = new MemoryStream(buffer);
+            _sendStream.Read(_sendAsyncEvtArgs.Buffer, 0, sizeToSend);
+            // reset the position, since it will be used to track what's been actually read from the async call
+            _sendStream.Position = 0;
+            _sendAsyncEvtArgs.SetBuffer(0, sizeToSend);
+            if (!_socket.SendAsync(_sendAsyncEvtArgs))
+            {
+                OnSendRequestComplete(_socket, _sendAsyncEvtArgs);
                 return false;
             }

@@ -587,11 +594,32 @@
                 if (args.SocketError != SocketError.Success)
                     throw new SocketException((int)args.SocketError);

-                // check if we sent a full request, else continue
-                if (args.BytesTransferred + args.Offset < args.Buffer.Length)
-                {
-                    int offset = args.BytesTransferred + args.Offset;
-                    args.SetBuffer(offset, args.Buffer.Length - offset);
+                int byteSentToProcess = (int)_sendStream.Position + args.Count;
+                bool allReadFromStream = byteSentToProcess == _sendStream.Length;
+
+                // check if we sent a full buffer or the stream has not been entierly processed
+                if (!allReadFromStream || args.BytesTransferred < args.Count - args.Offset)
+                {
+                    // recompute the current position in the pinned buffer and the stream
+                    int newBufferOffset = args.Offset + args.BytesTransferred;
+                    // setup the stream position to what's been actually processed
+                    _sendStream.Position += args.BytesTransferred;
+
+                    if (allReadFromStream || newBufferOffset < _pinnedBufferSize / 2)
+                    {
+                        // if the buffer already contains all the data or there is still more than half to consume
+                        // just resend the current buffer
+                        args.SetBuffer(newBufferOffset, args.Count - args.BytesTransferred);
+                    }
+                    else
+                    {
+                        // rewrite all we can to the pinned buffer
+                        int sizeToSend = (int)Math.Min(_sendStream.Length - _sendStream.Position, _pinnedBufferSize);
+                        _sendStream.Read(args.Buffer, 0, sizeToSend);
+                        // rewind the stream to keep the position to what's been actually sent
+                        _sendStream.Position -= sizeToSend;
+                        args.SetBuffer(0, sizeToSend);
+                    }
                     if (!socket.SendAsync(args))
                         OnSendRequestComplete(socket, args);
                     return;
@@ -629,7 +657,7 @@
                 }

                 _pendingRequests.Enqueue(request);
-                SendAsynch(buffer, 0, buffer.Length, callAvailable);
+                SendAsync(buffer, callAvailable);
             }
             catch (Exception e)
             {
@@ -693,4 +721,4 @@
             return "MemcacheTransport " + _endPoint + " " + GetHashCode();
         }
     }
-}
+}


Remove mandatory = false from SuppressedOnly

--- Engine/Commands/InvokeScriptAnalyzerCommand.cs
+++ Engine/Commands/InvokeScriptAnalyzerCommand.cs
@@ -102,7 +102,6 @@
         /// <summary>
         /// ShowSuppressed: Show the suppressed message
         /// </summary>
-        [Parameter(Mandatory = false)]
         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
         public SwitchParameter SuppressedOnly
         {


Store the current time temporarily when pausing the VLC player, because it gets reseted

--- Espera/Espera.Core/Audio/YoutubeAudioPlayer.cs
+++ Espera/Espera.Core/Audio/YoutubeAudioPlayer.cs
@@ -13,6 +13,7 @@
     internal sealed class YoutubeAudioPlayer : AudioPlayer
     {
         private readonly VlcControl player;
+        private TimeSpan? currentTime;

         /// <summary>
         /// Initializes a new instance of the <see cref="YoutubeAudioPlayer"/> class.
@@ -48,7 +49,7 @@
         /// </value>
         public override TimeSpan CurrentTime
         {
-            get { return this.player.Time; }
+            get { return this.currentTime ?? this.player.Time; }
             set { this.player.Time = value; }
         }

@@ -124,6 +125,9 @@
         /// </summary>
         public override void Pause()
         {
+            // We need to temporarly store the current time, because when paused, the player sets it to 0
+            this.currentTime = this.CurrentTime;
+
             this.player.Pause();

             // Wait till the player has finally paused
@@ -140,6 +144,8 @@
         /// <exception cref="PlaybackException">The playback couldn't be started.</exception>
         public override void Play()
         {
+            this.currentTime = null;
+
             this.player.Play();

             // Wait till the player is playing


[Python] import restriction fix

[Python] import restriction fix

--- Extensions/Oxide.Ext.Python/PythonExtension.cs
+++ Extensions/Oxide.Ext.Python/PythonExtension.cs
@@ -168,7 +168,7 @@
         private bool CheckModule(string moduleName, PythonTuple fromlist)
         {
             if (WhitelistNamespaces?.Any(moduleName.StartsWith) ?? false) return true;
-            if (moduleName.Equals("System")) return true;
+            if (moduleName.Equals("System") && fromlist.All(@from => Type.GetType($"{moduleName}.{@from}") != null)) return true;
             if (_allowedTypes.Contains(moduleName)) return true;
             if (WhitelistModules.Contains(moduleName)) return true;
             string[] parts;


Regions in SteamNetworkingSockets

Regions in SteamNetworkingSockets

--- Facepunch.Steamworks/SteamNetworkingSockets.cs
+++ Facepunch.Steamworks/SteamNetworkingSockets.cs
@@ -28,6 +28,8 @@
 			}
 		}

+		#region SocketInterface
+
 		static Dictionary<uint, SocketInterface> SocketInterfaces;

 		internal static SocketInterface GetSocketInterface( uint id )
@@ -48,8 +50,9 @@
 			Console.WriteLine( $"Installing Socket For {id}" );
 			SocketInterfaces[id] = iface;
 		}
+		#endregion

-
+		#region ConnectionInterface
 		static Dictionary<uint, ConnectionInterface> ConnectionInterfaces;

@@ -69,6 +72,7 @@
 			if ( id == 0 ) throw new System.ArgumentException( "Invalid Connection" );
 			ConnectionInterfaces[id] = iface;
 		}
+		#endregion

 		internal static void Shutdown()
 		{


Exposed ConnectionInfo.EndReason

Exposed ConnectionInfo.EndReason

--- Facepunch.Steamworks/Structs/ConnectionInfo.cs
+++ Facepunch.Steamworks/Structs/ConnectionInfo.cs
@@ -21,5 +21,6 @@

 		public ConnectionState State => state;
 		public SteamId SteamId => identity.steamID;
+		public int EndReason => endReason;
 	}
 }


Fixed GetToken.

Fixed GetToken.

--- FlubuCore.WebApi/Controllers/AuthController.cs
+++ FlubuCore.WebApi/Controllers/AuthController.cs
@@ -108,8 +108,8 @@
                 ExpiresIn = (int) _jwtOptions.ValidFor.TotalSeconds
             };

-            var json = JsonConvert.SerializeObject(response2, _serializerSettings);
-            return new OkObjectResult(json);
+
+            return Ok(response2);
         }

         private static void ThrowIfInvalidOptions(JwtOptions options)


- Revised request url to get moves by name to be more standardized (/name/{name} instead of /byname)

--- FrannHammer.Api/Controllers/MovesController.cs
+++ FrannHammer.Api/Controllers/MovesController.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Linq;
 using System.Net;
 using System.Web.Http;
 using System.Web.Http.Description;
@@ -71,7 +70,7 @@
         /// <returns></returns>
         [ResponseType(typeof(MoveDto))]
         [ValidateModel]
-        [Route(MovesRouteKey + "/byname")]
+        [Route(MovesRouteKey + "/name/{name}")]
         public IHttpActionResult GetMovesByName([FromUri] string name, [FromUri] string fields = "")
         {
             var content = _metadataService.GetAll<Move, MoveDto>(m => m.Name.Equals(name, StringComparison.OrdinalIgnoreCase), fields, false);


Add: to Bundle ProcessingJS and AvatarGenerator scripts

--- GalleryMVC_With_Auth/App_Start/BundleConfig.cs
+++ GalleryMVC_With_Auth/App_Start/BundleConfig.cs
@@ -37,6 +37,11 @@
                 "~/Scripts/react/JSXTransformer-0.13.1",
                 "~/Scripts/react/react-with-addons-0.13.1"));

+            bundles.Add(new ScriptBundle("~/bundles/Avatar").Include(
+                "~/Scripts/processing.min.js",
+                "~/Scripts/AvatarGenerator.js"
+                ));
+
             bundles.Add(new StyleBundle("~/Content/styles").Include(
                 "~/Content/css/hover_effects/component.css",
                 "~/Content/css/hover_effects/normalize.css",


fixed matrix enumeration

fixed matrix enumeration

--- GeometryClassLibrary/Matrices/Matrix/Matrix.cs
+++ GeometryClassLibrary/Matrices/Matrix/Matrix.cs
@@ -249,7 +249,16 @@
         #region Methods
         public double[] As1DArray()
         {
-            return this._matrix.Enumerate().ToArray();
+            var N = this.NumberOfColumns * this.NumberOfRows;
+            var result = new List<double>();
+            for (int i = 0; i < NumberOfRows; i++)
+            {
+                for (int j = 0; j < NumberOfColumns; j++)
+                {
+                    result.Add(this.GetElement(i, j));
+                }
+            }
+            return result.ToArray();
         }
         public static Matrix ProjectiveMatrixToRotationMatrix(Matrix matrix)
         {


Code cleanup

Code cleanup

--- GitMind/RepositoryViews/RepositoryViewModel.cs
+++ GitMind/RepositoryViews/RepositoryViewModel.cs
@@ -11,7 +11,6 @@
 using GitMind.Common.MessageDialogs;
 using GitMind.Common.ProgressHandling;
 using GitMind.Features.Branches;
-using GitMind.Features.Branches.Private;
 using GitMind.Features.Commits;
 using GitMind.Features.Diffing;
 using GitMind.Features.Remote;
@@ -39,7 +38,6 @@
 		private readonly IViewModelService viewModelService;
 		private readonly IRepositoryService repositoryService;

-		private readonly IGitBranchService gitBranchService;
 		private readonly IGitInfoService gitInfoService;

 		private readonly IBrushService brushService;
@@ -97,7 +95,6 @@
 			IViewModelService viewModelService,
 			ICommitService commitService,
 			IRepositoryService repositoryService,
-			IGitBranchService gitBranchService,
 			IGitInfoService gitInfoService,
 			IBrushService brushService,
 			IRemoteService remoteService,
@@ -118,7 +115,6 @@
 			this.commitService = commitService;
 			this.repositoryService = repositoryService;

-			this.gitBranchService = gitBranchService;
 			this.gitInfoService = gitInfoService;

 			this.brushService = brushService;
@@ -246,7 +242,7 @@

 		public Command UndoCleanWorkingFolderCommand { get; }

-		public Command UndoUncommittedChangesCommand  => AsyncCommand(
+		public Command UndoUncommittedChangesCommand => AsyncCommand(
 			() => commitService.UndoUncommittedChangesAsync());

 		public Command<Commit> UncommitCommand => AsyncCommand<Commit>(
@@ -840,7 +836,7 @@

-
+

 		private void ShowDiff(Commit commit)


Simplified llGetAttachedList

Simplified llGetAttachedList

since in practice there is only the success case and a single failure
return case.

--- InWorldz/InWorldz.Phlox.Engine/LSLSystemAPI.cs
+++ InWorldz/InWorldz.Phlox.Engine/LSLSystemAPI.cs
@@ -18216,29 +18216,16 @@
         public LSL_List llGetAttachedList(string avatar)
         {
             UUID agentID;
-            List<object> res = new List<object>();
-            if (!UUID.TryParse(avatar, out agentID))
-            {
-                res.Add("NOT FOUND");
-                return new LSL_List(res);
-            }
-
-            ScenePresence sp = World.GetScenePresence(agentID);
-            if (sp == null)
-            {
-                res.Add("NOT FOUND");
-                return new LSL_List(res);
-            }
-
-            if (sp.IsChildAgent)
-            {
-                // res.Add("NOT ON REGION");
-                // This case is documented as "NOT ON REGION" but testing in SL shows it also returning "NOT FOUND".
-                res.Add("NOT FOUND");
-                return new LSL_List(res);
-            }
-
-            return new LSL_List(sp.CollectVisibleAttachmentItemIds());
+            if (UUID.TryParse(avatar, out agentID))
+            {
+                ScenePresence sp = World.GetScenePresence(agentID);
+                if ((sp != null) && (!sp.IsChildAgent))
+                    return new LSL_List(sp.CollectVisibleAttachmentItemIds());
+            }
+
+            LSL_List ret = new LSL_List();
+            ret.Append("NOT FOUND");
+            return ret;
         }

         public int llReturnObjectsByOwner(string owner, int scope)


Set current directory for initial script.

--- Infusion.EngineScripts/Scripts/ScriptEngine.cs
+++ Infusion.EngineScripts/Scripts/ScriptEngine.cs
@@ -1,4 +1,5 @@
 using System;
+using System.IO;
 using System.Threading;
 using System.Threading.Tasks;

@@ -24,8 +25,19 @@
             }
         }

+        public Task ExecuteInitialScript(string scriptPath, CancellationTokenSource cancellationTokenSource)
+        {
+            var currentRoot = Path.GetDirectoryName(scriptPath);
+            Directory.SetCurrentDirectory(currentRoot);
+            ScriptRootPath = currentRoot;
+
+            return ExecuteScript(scriptPath, cancellationTokenSource);
+        }
+
         public async Task ExecuteScript(string scriptPath, CancellationTokenSource cancellationTokenSource)
         {
+            if (!File.Exists(scriptPath))
+                throw new FileNotFoundException($"Script file not found: {scriptPath}", scriptPath);
             await ForeachEngineAsync(engine => engine.ExecuteScript(scriptPath, cancellationTokenSource));
         }


wait for more time

wait for more time

--- IntegrationTestDS3/IntegrationTestDS3Client.cs
+++ IntegrationTestDS3/IntegrationTestDS3Client.cs
@@ -1290,7 +1290,7 @@
                 _client.PutObject(new PutObjectRequest(bucketName, "object", contentBytes.Length + 1, stream));

                 //wait streams closing to be over
-                Thread.Sleep(100);
+                Thread.Sleep(1000);
             }
             finally
             {
@@ -1313,7 +1313,7 @@
                 _client.PutObject(new PutObjectRequest(bucketName, "object", contentBytes.Length - 1, stream));

                 //wait streams closing to be over
-                Thread.Sleep(100);
+                Thread.Sleep(1000);
             }
             finally
             {


make DbContextExtensions public

make DbContextExtensions public

--- JSONAPI.EntityFramework/DbContextExtensions.cs
+++ JSONAPI.EntityFramework/DbContextExtensions.cs
@@ -8,9 +8,18 @@

 namespace JSONAPI.EntityFramework
 {
-    internal static class DbContextExtensions
+    /// <summary>
+    /// Extensions on DbContext useful for JSONAPI.NET
+    /// </summary>
+    public static class DbContextExtensions
     {
-        internal static IEnumerable<string> GetKeyNames(this DbContext dbContext, Type type)
+        /// <summary>
+        /// Gets the ID key names for an entity type
+        /// </summary>
+        /// <param name="dbContext"></param>
+        /// <param name="type"></param>
+        /// <returns></returns>
+        public static IEnumerable<string> GetKeyNames(this DbContext dbContext, Type type)
         {
             var openMethod = typeof(DbContextExtensions).GetMethod("GetKeyNamesFromGeneric", BindingFlags.NonPublic | BindingFlags.Static);
             var method = openMethod.MakeGenericMethod(type);


Custom discord commands are now seperate from jefmajor's twitch channel, and vice versa

--- JefBot/Commands/CustomCommandsPluginCommand.cs
+++ JefBot/Commands/CustomCommandsPluginCommand.cs
@@ -29,7 +29,7 @@
             var args = arg.Message.Text.Split(' ').ToList().Skip(1).ToList();
             var command = arg.Message.Text.Split(' ').First();
             //arg.Channel.SendMessage("One day Mr Virite will implement this, i mean, have you looked at this code? holy shit, it's a mess, and it's not SQL");
-            var response = customCommand(command.Substring(1), args, arg.User.ServerPermissions.Administrator, "jefmajor", arg.User.Name);
+            var response = customCommand(command.Substring(1), args, arg.User.ServerPermissions.Administrator, Convert.ToString(arg.Server.Id) , arg.User.Name);
             if (response != "null")
             {
                 arg.Channel.SendMessage(response);


add ILoginService method

add ILoginService method

--- client/BlueMonkey/BlueMonkey.LoginService/ILoginService.cs
+++ client/BlueMonkey/BlueMonkey.LoginService/ILoginService.cs
@@ -1,11 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using BlueMonkey.Business;
+using System.Threading.Tasks;

 namespace BlueMonkey.LoginService
 {
-    public class Class1
+    public interface ILoginService
     {
+        Task<AuthUser> LoginAsync();
     }
 }


Adds check to data parser

Adds check to data parser

--- Keiser.MvxPlugins.Bluetooth.Droid/LE/Device.cs
+++ Keiser.MvxPlugins.Bluetooth.Droid/LE/Device.cs
@@ -22,11 +22,11 @@
             int startingIndex = 0;
             if (scanRecord.Length > 3)
             {
-                while (startingIndex < scanRecord.Length && scanRecord[startingIndex + 1] != 0xff)
+                while ((startingIndex + 1) < scanRecord.Length && scanRecord[startingIndex + 1] != 0xff)
                 {
                     startingIndex += scanRecord[startingIndex] + 1;
                 }
-                if (scanRecord[startingIndex + 1] == 0xff)
+                if ((startingIndex + 1) < scanRecord.Length && scanRecord[startingIndex + 1] == 0xff)
                 {
                     int length = scanRecord[startingIndex] - 1;
                     if (length > 0)


Comment change.

Comment change.

--- LNF.Web.Scheduler/Pages/ResourceMaintenance.cs
+++ LNF.Web.Scheduler/Pages/ResourceMaintenance.cs
@@ -251,9 +251,10 @@
                         }
                         else
                         {
-                            // We have to disable all those reservations that have been activated by setting isActive to 0.
-                            // The catch here is that we must compare the "Actual" usage time with the repair time because if the user ends the reservation before the repair starts, we still
-                            // have to charge the user for that reservation
+                            // We have to disable all those reservations that have been activated by setting IsActive to 0.
+                            // The catch here is that we must compare the "Actual" usage time with the repair time because
+                            // if the user ends the reservation before the repair starts, we still  have to charge the user
+                            // for that reservation
                         }
                     }


Check for objects existing using their equals operation rather than Ids

--- LazyLibrary/Storage/Memory/MemoryRepository.cs
+++ LazyLibrary/Storage/Memory/MemoryRepository.cs
@@ -10,7 +10,7 @@

         public T GetById(int id)
         {
-            return this.repository.Where(x => x.Id == id).SingleOrDefault();
+            return this.repository.SingleOrDefault(x => x.Id == id);
         }

         public IQueryable<T> Get(System.Func<T, bool> exp = null)
@@ -20,11 +20,10 @@

         public void Upsert(T item)
         {
-            var obj = GetById(item.Id);
-
-            if (obj != null)
+            if (repository.Contains(item))
             {
                 // Update
+                var obj = repository.Single(x => x.Equals(item));
                 this.repository.Remove(obj);
                 this.repository.Add(item);
             }


Avoid testing stuff to be in Release or to crash with some 2dd

--- OpenKh.Tools.LayoutEditor/AppSequenceEditor.cs
+++ OpenKh.Tools.LayoutEditor/AppSequenceEditor.cs
@@ -106,7 +106,9 @@
                 .ToList();

             _sequencer = new MySequencer(sequence, _debugSequenceRenderer);
-            SelectedAnimGroup = 6;
+#if DEBUG
+            SelectedAnimGroup = Math.Min(6, sequence.AnimationGroups.Count - 1);
+#endif
         }

         public void Menu()


Fix compilation errors

Fix compilation errors

--- Pathfinder/Internal/Replacements/SaveLoader.cs
+++ Pathfinder/Internal/Replacements/SaveLoader.cs
@@ -368,8 +368,8 @@
                     info.Attributes.GetInt("complexity"),
                     info.Attributes.GetValueOrDefault("solution", null),
                     info.Attributes.GetFloat("additionalDelay")
-                );
-            });
+                )
+            );

             executor.AddExecutor("portsOpen", (exec, info) =>
             {
@@ -412,14 +412,11 @@
                 var server = result.AddDaemon<MailServer>(info.Attributes.GetValue("name"), os);
                 if(info.Attributes.TryGetValue("color", out var colorStr))
                 {
-                    var server = result.AddDaemon<MailServer>(info.Attributes.GetValue("name"), os);
-                    if (info.Attributes.TryGetValue("color", out var colorStr))
-                    {
-                        var color = Utility.GetColorFromString(colorStr, true, null);
-                        if (color.HasValue)
-                            server.setThemeColor(color.Value);
-                    }
-                });
+                     var color = Utility.GetColorFromString(colorStr, true, null);
+                     if (color.HasValue)
+                        server.setThemeColor(color.Value);
+                }
+            });

                 executor.AddExecutor("daemons.MissionListingServer", (exec, info) =>
                 {