Fixed player stuff.

Fixed player stuff.

--- UnityProject/Assets/Scripts/Player/ZMPlayerController.cs
+++ UnityProject/Assets/Scripts/Player/ZMPlayerController.cs
@@ -12,9 +12,9 @@
 	private float ACCELERATION = 30.0f;
 	private float FRICTION = 25.0f;
 	private float JUMP_HEIGHT = 800.0f;
-	private float PLUNGE_SPEED = 2200.0f;
-	private float LUNGE_SPEED = 1800.0f;
-	private float LUNGE_TIME = 0.14f;
+	private float PLUNGE_SPEED = 3000.0f;
+	private float LUNGE_SPEED = 2400.0f;
+	private float LUNGE_TIME = 0.1f;
 	private float WALL_SLIDE_SPEED = 80.0f;
 	private float WALL_JUMP_KICK_SPEED = 500.0f;
 	private float EDGE_OFFSET = 16.0f;
@@ -29,7 +29,7 @@

 	// Additional constants.
 	public float RESPAWN_TIME = 5.0f;
-	private float TILE_SIZE = 28.0f;
+	private float TILE_SIZE = 2.0f;
 	private int FRAMES_PER_STEP = 30;

 	private ZMPlayerInfo _playerInfo; public ZMPlayerInfo PlayerInfo { get { return _playerInfo; } }
@@ -213,6 +213,7 @@

 		// Horizontal movement.
 		if (_controlMoveState == ControlMoveState.MOVING && !IsPerformingPlunge() && !IsRecoiling()) {
+
 			if (_movementDirection == MovementDirectionState.FACING_RIGHT) {
 				if (runSpeed < RUN_SPEED_MAX) {
 					runSpeed += ACCELERATION;
@@ -222,6 +223,13 @@
 					runSpeed -= ACCELERATION;
 				}
 			}
+
+			/*
+			if (Mathf.Abs(runSpeed) < Mathf.Abs (RUN_SPEED_MAX)) {
+				runSpeed = (_movementDirection == MovementDirectionState.FACING_LEFT ? Mathf.Abs(runSpeed) * -1 : Mathf.Abs(runSpeed));
+				runSpeed += ACCELERATION * (_movementDirection == MovementDirectionState.FACING_LEFT ? -1 : 1);
+			}
+			*/

 			if (_controller.isGrounded && Mathf.Abs(_velocity.x) > ACCELERATION) {
 				_framesUntilStep++;
@@ -389,6 +397,9 @@
 			// Wall slide.
 			if (_velocity.y < 1.0f &&  _controlMoveState == ControlMoveState.MOVING) {
 				_velocity.y = -WALL_SLIDE_SPEED;
+				if (IsTouchingRightAndMovingRight() || IsTouchingLeftAndMovingLeft()) {
+					runSpeed = 0;
+				}
 			}
 			if (_controller.isGrounded || !IsTouchingEitherSide()) {
 				_moveModState = MoveModState.NEUTRAL;
@@ -688,9 +699,9 @@
 			Vector3 shiftedPos = transform.position;

 			if (CheckRight(2.0f, _controller.platformMask)) {
-				shiftedPos.x -= 8.0f;
+				shiftedPos.x -= 4.0f;
 			} else if (CheckLeft(2.0f, _controller.platformMask)) {
-				shiftedPos.x += 8.0f;
+				shiftedPos.x += 4.0f;
 			}

 			transform.position = shiftedPos;


Fix dead agent removal

Fix dead agent removal

--- Core/Simulation/Physics/Core/PhysicsManager.cs
+++ Core/Simulation/Physics/Core/PhysicsManager.cs
@@ -170,7 +170,7 @@
 						{

 						}
-						else
+						else if (pair._ranIndex >= 0)
 						{
 							#if false
 							if (!RanCollisionPairs.SafeRemoveAt(pair._ranIndex, instancePair))
@@ -180,6 +180,7 @@
 							#else
 							RanCollisionPairs.RemoveAt(pair._ranIndex);
 							#endif
+
 							pair._ranIndex = -1;

 							InactiveCollisionPairs.Add(instancePair);


ConfigProvider - ConfigProviderException: small cosmetic text reformat

--- CustomBlocks/Config/ConfigProviderException.cs
+++ CustomBlocks/Config/ConfigProviderException.cs
@@ -39,7 +39,8 @@
 		public readonly ConfigProviderState state;
 		public readonly bool isWriteEnabled;

-		protected ConfigProviderException( string domain, string id, ConfigProviderState state, bool isWriteEnabled, string message, Exception inner ) : base (message, inner)
+		protected ConfigProviderException(string domain, string id, ConfigProviderState state, bool isWriteEnabled, string message, Exception inner)
+			: base (message, inner)
 		{
 			this.domain = domain;
 			this.id = id;


Expose http websockets endpoint and metadata.  Https commented out for now.

--- Src/Core/Core.Components/HostManagerComponent.cs
+++ Src/Core/Core.Components/HostManagerComponent.cs
@@ -1,17 +1,17 @@
 using Core.Comm;
 using Core.Interfaces.Base;
+using Core.Interfaces.Components;
 using Core.Interfaces.Components.Logging;
-using Core.Interfaces.Components;
+using Core.Util;
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
 using System.ServiceModel;
 using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
 using System.ServiceModel.Dispatcher;
-using Core.Util;

 namespace Core.Components
 {
@@ -136,29 +136,63 @@
         {
             var hosts = new Dictionary<Type, ServiceHostInfo>();

-            foreach (Type type in TypeLocator.FindTypes(_dllSearchPattern,typeof(IServiceHost)))
+            foreach (Type type in TypeLocator.FindTypes(_dllSearchPattern, typeof(IServiceHost)))
             {
                 ServiceHostInfo info = new ServiceHostInfo();
-
-                info.Logger = _logger;

                 _logger.Log(string.Format("HostManager creating host of type \"{0}\".", type));

                 Type interfaceType = (Type)type.GetMethod("GetInterfaceType", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy).Invoke(null, null);
                 info.InterfaceType = interfaceType;
+                info.Logger = _logger;

                 info.Host = new ServiceHost(type);

-                EndpointAddress endpoint = new EndpointAddress("net.tcp://localhost:9595/tcp/" + interfaceType.Name + "/");
-
-                Binding binding = new NetTcpBinding(SecurityMode.None, false);
-
-                ServiceEndpoint service = new ServiceEndpoint(ContractDescription.GetContract(interfaceType), binding, endpoint);
-
                 info.Host.Description.Behaviors.Add(new HostErrorHandlerBehavior(info));
-
-                info.Host.AddServiceEndpoint(service);
-
+                ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
+                //smb.HttpsGetEnabled = true;
+                //smb.HttpsGetUrl = new Uri("https://localhost:9596/mex/");
+                smb.HttpGetEnabled = true;
+                smb.HttpGetUrl = new Uri("http://localhost:9596/mex/");
+                info.Host.Description.Behaviors.Add(smb);
+
+                ContractDescription contract = ContractDescription.GetContract(interfaceType);
+
+                {
+                    EndpointAddress endpoint = new EndpointAddress("net.tcp://localhost:9595/" + interfaceType.Name + "/");
+                    Binding binding = new NetTcpBinding(SecurityMode.None, false);
+                    ServiceEndpoint service = new ServiceEndpoint(contract, binding, endpoint);
+                    info.Host.AddServiceEndpoint(service);
+                }
+
+                {
+                    //var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
+                    //store.Open(OpenFlags.ReadOnly);
+                    //var cert = store.Certificates.Find(X509FindType.FindBySubjectName, "localhost", false)[0];
+                    //store.Close();
+                    //var endpointIdentity = EndpointIdentity.CreateX509CertificateIdentity(cert);
+                    //EndpointAddress endpoint = new EndpointAddress(new Uri("https://localhost:9596/" + interfaceType.Name + "/"), endpointIdentity);
+                    //Binding binding = new NetHttpsBinding(BasicHttpsSecurityMode.Transport, false);
+                    EndpointAddress endpoint = new EndpointAddress("http://localhost:9596/" + interfaceType.Name + "/");
+                    Binding binding = new NetHttpBinding(BasicHttpSecurityMode.None, false);
+                    ServiceEndpoint service = new ServiceEndpoint(contract, binding, endpoint);
+                    info.Host.AddServiceEndpoint(service);
+                }
+
+                {
+                    ContractDescription mexContract = ContractDescription.GetContract(typeof(IMetadataExchange));
+                    //var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
+                    //store.Open(OpenFlags.ReadOnly);
+                    //var cert = store.Certificates.Find(X509FindType.FindBySubjectName, "localhost", false)[0];
+                    //store.Close();
+                    //var endpointIdentity = EndpointIdentity.CreateX509CertificateIdentity(cert);
+                    //EndpointAddress endpoint = new EndpointAddress(new Uri("https://localhost:9596/mex/"), endpointIdentity);
+                    //Binding binding = new NetHttpsBinding(BasicHttpsSecurityMode.Transport, false);
+                    EndpointAddress endpoint = new EndpointAddress("http://localhost:9596/mex/");
+                    Binding binding = new NetHttpBinding(BasicHttpSecurityMode.None, false);
+                    ServiceEndpoint service = new ServiceEndpoint(mexContract, binding, endpoint);
+                    info.Host.AddServiceEndpoint(service);
+                }
                 hosts.Add(interfaceType, info);
             }


Explicitly mention that "because" formatting can throw FormatException (#717)

--- Src/FluentAssertions/Execution/AssertionScope.cs
+++ Src/FluentAssertions/Execution/AssertionScope.cs
@@ -103,12 +103,17 @@
         /// Specify the reason why you expect the condition to be <c>true</c>.
         ///
         /// <param name="because">
-        /// A formatted phrase explaining why the condition should be satisfied. If the phrase does not
-        /// start with the word because, it is prepended to the message.
+        /// A formatted phrase compatible with <see cref="string.Format(string,object[])"/> explaining why
+        /// the condition should be satisfied. If the phrase does not start with the word because,
+        /// it is prepended to the message.
         /// </param>
         /// <param name="becauseArgs">
         /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
         /// </param>
+        /// <exception cref="System.FormatException">
+        /// Thrown if the format of <paramref name="because"/> or <paramref name="becauseArgs"/> is not
+        /// compatible with <see cref="string.Format(string,object[])"/>.
+        /// </exception>
         public AssertionScope BecauseOf(string because, params object[] becauseArgs)
         {
             reason = string.Format(because ?? "", becauseArgs ?? new object[0]);
@@ -261,4 +266,4 @@
             }
         }
     }
-}+}


Added a default Description to a Test Double to make it a bit more robust.

--- Src/IdiomsUnitTest/DelegatingBoundaryBehavior.cs
+++ Src/IdiomsUnitTest/DelegatingBoundaryBehavior.cs
@@ -12,6 +12,7 @@
         {
             this.OnExercise = a => a(new object());
             this.OnIsSatisfiedBy = e => false;
+            this.Description = string.Empty;
         }

         public Action<Action<object>> OnExercise { get; set; }


[add]任意の序列の多角数取得メソッドの追加

[add]任意の序列の多角数取得メソッドの追加

--- Src/LoveWholeNumber/LoveWholeNumber/Polygonal.cs
+++ Src/LoveWholeNumber/LoveWholeNumber/Polygonal.cs
@@ -235,5 +235,19 @@

             return false;
         }
+
+        /// <summary>
+        /// 任意の序列の多角数取得
+        /// </summary>
+        /// <param name="nth">任意の序列</param>
+        /// <param name="nSided">n角数のn</param>
+        /// <returns>指定した序列の多角数 失敗で-1</returns>
+        public static int GetNSidedNumber(int nth, int nSided)
+        {
+            if (nth < 1 || nSided < 3)
+                return -1;
+
+            return ((nSided - 2) * nth * nth - (4 - nSided) * nth) / 2;
+        }
     }
 }


ルートボーンは常にpositionチャンネル有効としました

ルートボーンは常にpositionチャンネル有効としました

無いとhip計算がずれる。

--- Models/BVH.cs
+++ Models/BVH.cs
@@ -36,6 +36,8 @@
             }

             var rootBone = model.Skinning.Bone.First((b) => b.Parent == null);
+            movedBones.Add(rootBone.BoneName);
+
             m_root = new RootElement(this, rootBone, movedBones);
             m_frame_time = new FrameTimeElement(1.0 / 30.0);
             m_frames = new FramesElement(motion.FinalFrame + 1);


Revert "Fix issue with API header binding when running under a subdirectory"

This reverts commit d9e86ff97a08467c721955ca71a8ee2fda5ca9cd.

--- Website/Infrastructure/HttpHeaderValueProviderFactory.cs
+++ Website/Infrastructure/HttpHeaderValueProviderFactory.cs
@@ -10,7 +10,7 @@
             var request = controllerContext.RequestContext.HttpContext.Request;

             // Use this value provider only if a route is located under "API"
-            if (request.Path.Contains("/api/"))
+            if (request.Path.TrimStart('/').StartsWith("api", StringComparison.OrdinalIgnoreCase))
                 return new HttpHeaderValueProvider(request, "ApiKey");
             return null;
         }


Optimizing the Bakwards iterator.

Optimizing the Bakwards iterator.

--- WmcSoft.Core/Collections/Generic/EnumerableExtensions.cs
+++ WmcSoft.Core/Collections/Generic/EnumerableExtensions.cs
@@ -68,14 +68,9 @@
             #region IEnumerable<T> Membres

             public IEnumerator<T> GetEnumerator() {
-                var stack = new Stack<T>();
-                using (var enumerator = _enumerable.GetEnumerator()) {
-                    while (enumerator.MoveNext()) {
-                        stack.Push(enumerator.Current);
-                    }
-                    while (stack.Count > 0) {
-                        yield return stack.Pop();
-                    }
+                var stack = new Stack<T>(_enumerable);
+                while (stack.Count > 0) {
+                    yield return stack.Pop();
                 }
             }

@@ -98,16 +93,24 @@
             }
         }

-        public static IEnumerable<T> Backwards<T>(this IEnumerable<T> source) {
-            var readOnlyList = source as IReadOnlyList<T>;
+        /// <summary>
+        /// Inverts the order of the elements in a sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements of <see cref="source"/>.</typeparam>
+        /// <param name="source">A sequence of values to reverse.</param>
+        /// <returns>A sequence whose elements correspond to those of the input sequence in reverse order.</returns>
+        /// <remarks>Similar to <see cref="Enumerable.Reverse{TSource}(IEnumerable{TSource})"/> except that a copy
+        /// is avoided for classes implementing <see cref="IList{TSource}"/>.</remarks>
+        public static IEnumerable<TSource> Backwards<TSource>(this IEnumerable<TSource> source) {
+            var readOnlyList = source as IReadOnlyList<TSource>;
             if (readOnlyList != null)
                 return Backwards(readOnlyList);

-            var list = source as IList<T>;
+            var list = source as IList<TSource>;
             if (list != null)
                 return Backwards(list.AsReadOnly());

-            return new BackwardsEnumerableAdapter<T>(source);
+            return new BackwardsEnumerableAdapter<TSource>(source);
         }

         #endregion


implicit tokens : first passing unit test !

--- ParserTests/ImplicitTokensTests.cs
+++ ParserTests/ImplicitTokensTests.cs
@@ -49,9 +49,22 @@
         {
             return doubleToken.DoubleValue;
         }
+
+        [Production("primary : 'bozzo'[d]")]
+        public double Bozzo()
+        {
+            return 42.0;
+        }
+
+        [Production("primary : TEST[d]")]
+        public double Test()
+        {
+            return 0.0;
+        }

-        [Production("expression : term ['+' | '-'] expression")]
+        [Production("expression : primary ['+' | '-'] expression")]
+

         public double Expression(double left, Token<ImplicitTokensTokens> operatorToken, double right)
         {
@@ -75,64 +88,16 @@
             return result;
         }

-        [Production("expression : term")]
-        public double Expression_Term(double termValue)
+
+        [Production("expression : primary ")]
+        public double Simple(double value)
         {
-            return termValue;
+            return value;
         }

-        [Production("term : factor ['*' | '/'] term")]
-        public double Term(double left, Token<ImplicitTokensTokens> operatorToken, double right)
-        {
-            var result = 0d;

-            switch (operatorToken.StringWithoutQuotes)
-            {
-                case "*":
-                {
-                    result = left * right;
-                    break;
-                }
-                case "/":
-                {
-                    result = left / right;
-                    break;
-                }
-            }

-            return result;
-        }
-
-        [Production("term : factor")]
-        public double Term_Factor(double factorValue)
-        {
-            return factorValue;
-        }
-
-        [Production("factor : primary")]
-        public double primaryFactor(double primValue)
-        {
-            return primValue;
-        }
-
-        [Production("factor : '-'[d] factor")]
-        public double Factor(double factorValue)
-        {
-            return -factorValue;
-        }
-
-        [Production("primary : 'bozzo'[d]")]
-        public double Bozzo()
-        {
-            return 42.0;
-        }
-
-        [Production("primary : TEST[d]")]
-        public double Test()
-        {
-            return 0.0;
-        }
     }


Added XML documentation

Added XML documentation

--- Easy.Logger/LogLevel.cs
+++ Easy.Logger/LogLevel.cs
@@ -5,10 +5,29 @@
     /// </summary>
     public enum LogLevel
     {
+        /// <summary>
+        /// The debug level.
+        /// </summary>
         Debug = 0,
+
+        /// <summary>
+        /// The information level.
+        /// </summary>
         Info,
+
+        /// <summary>
+        /// The warning level.
+        /// </summary>
         Warn,
+
+        /// <summary>
+        /// The error level.
+        /// </summary>
         Error,
+
+        /// <summary>
+        /// The fatal level.
+        /// </summary>
         Fatal
     }
 }


Add addition block actions and layout changes

--- Editor/MapEditWindow.cs
+++ Editor/MapEditWindow.cs
@@ -19,6 +19,8 @@
             PlaceBlocks,
             RotateBlocks,
             PaintBlocks,
+            FillTexture,
+            ReplaceTexture,
             RotateTexture,
             DeleteBlocks,
             ColourPick,
@@ -45,6 +47,7 @@
         private string selectedMaterialId;

         public EditMode editMode = EditMode.PlaceBlocks;
+        public EditMode lastPaintMode;
         private string selectedBlockType = "CubeBlock";

         [SerializeField]
@@ -130,6 +133,10 @@
         {
             if (newMode == EditMode.Disabled) Tools.current = lastTool;
             else lastTool = Tools.current;
+            if (newMode == EditMode.PaintBlocks || newMode == EditMode.ReplaceTexture || newMode == EditMode.FillTexture)
+            {
+                lastPaintMode = newMode;
+            }
         }

         public void CheckMapSelection()
@@ -264,48 +271,54 @@

                 EditorGUILayout.EndToggleGroup();

-                // texture stuff
-                GUILayout.BeginHorizontal();
-                GUILayout.Label("Selected Texture");
-                GUILayout.Label(TextureManager.GetMaterialOrDefault(selectedMaterialId).mainTexture);
-                GUILayout.EndHorizontal();
-
-                scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
-
                 GUIStyle style = new GUIStyle(GUI.skin.button);
                 style.padding = new RectOffset(0, 0, 0, 0);

-                GUILayout.BeginHorizontal();
-                int index = 0;
-                foreach (string id in TextureManager.Materials.Keys)
-                {
-                    GUIContent c = new GUIContent();
-                    if (TextureManager.Previews.ContainsKey(id))
-                    {
-                        c.image = TextureManager.Previews[id];
-                    }
-                    if (GUILayout.Button(c, style, GUILayout.Width(25), GUILayout.Height(25))) { selectedMaterialId = id; editMode = EditMode.PaintBlocks; }
-                    index++;
-                    if (index % 11 == 0) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); }
-                }
-                GUILayout.EndHorizontal();
-
-                EditorGUILayout.EndScrollView();
+                // texture stuff
+                if (editMode == EditMode.PaintBlocks || editMode == EditMode.ReplaceTexture || editMode == EditMode.FillTexture)
+                {
+                    GUILayout.BeginHorizontal();
+                    GUILayout.Label("Selected Texture");
+                    GUILayout.Label(TextureManager.GetMaterialPreviewOrDefault(selectedMaterialId));
+                    GUILayout.EndHorizontal();
+
+                    scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
+
+                    GUILayout.BeginHorizontal();
+                    int index = 0;
+                    foreach (string id in TextureManager.Materials.Keys)
+                    {
+                        GUIContent c = new GUIContent();
+                        if (TextureManager.Previews.ContainsKey(id))
+                        {
+                            c.image = TextureManager.Previews[id];
+                        }
+                        if (GUILayout.Button(c, style, GUILayout.Width(25), GUILayout.Height(25))) { selectedMaterialId = id; editMode = EditMode.PaintBlocks; }
+                        index++;
+                        if (index % 11 == 0) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); }
+                    }
+                    GUILayout.EndHorizontal();
+
+                    EditorGUILayout.EndScrollView();
+                }

                 // block stuff
-                GUILayout.Label("Selected Block: " + selectedBlockType);
-                GUILayout.BeginHorizontal();
-                int i = 0;
-                foreach (GameObject g in PrefabManager.blockPrefabs)
-                {
-                    GUIContent c = new GUIContent();
-                    c.image = PrefabManager.blockPreviews[i];
-                    if (GUILayout.Button(c, style, GUILayout.Width(25), GUILayout.Height(25))) { selectedBlockType = g.name; editMode = EditMode.PlaceBlocks; }
-                    i++;
-                }
-                GUILayout.EndHorizontal();
-
-                if (GUILayout.Button("Refresh Materials")) { TextureManager.FindMaterials(); PrefabManager.RefreshPrefabs(); }
+                if (editMode == EditMode.PlaceBlocks)
+                {
+                    GUILayout.Label("Selected Block: " + selectedBlockType);
+                    GUILayout.BeginHorizontal();
+                    int i = 0;
+                    foreach (GameObject g in PrefabManager.blockPrefabs)
+                    {
+                        GUIContent c = new GUIContent();
+                        c.image = PrefabManager.blockPreviews[i];
+                        if (GUILayout.Button(c, style, GUILayout.Width(25), GUILayout.Height(25))) { selectedBlockType = g.name; editMode = EditMode.PlaceBlocks; }
+                        i++;
+                    }
+                    GUILayout.EndHorizontal();
+                }
+
+                if (GUILayout.Button("Refresh Resources")) { TextureManager.FindMaterials(); PrefabManager.RefreshPrefabs(); }

                 // saving/loading stuff

@@ -444,16 +457,18 @@
                                     switch (editMode)
                                     {
                                         case EditMode.PaintBlocks: block.SetMaterial(hit, selectedMaterialId); currentMapObj.UpdateBlock(block.gameObject); break;
+                                        case EditMode.FillTexture: block.SetAllMaterials(selectedMaterialId, false); currentMapObj.UpdateBlock(block.gameObject); break;
+                                        case EditMode.ReplaceTexture: block.ReplaceMaterial(hit, selectedMaterialId); currentMapObj.UpdateBlock(block.gameObject); break;
                                         case EditMode.RotateTexture: block.RotateTexture(hit); break;
                                         case EditMode.PlaceBlocks: PlaceBlock(hitDirection, mouseOverObj); break;
                                         case EditMode.DeleteBlocks: currentMapObj.DeleteBlock(mouseOverObj); break;
-                                        case EditMode.ColourPick: selectedMaterialId = GetMaterialId(hit, mouseOverObj); editMode = EditMode.PaintBlocks; break;
+                                        case EditMode.ColourPick: selectedMaterialId = GetMaterialId(hit, mouseOverObj); editMode = lastPaintMode; break;
                                         case EditMode.SelectBlock: SelectBlock(block); break;
                                     }
                                 }
                             }

-                            else if (mouseOverObj == currentMapObj.GridRenderer.gameObject && currentMapObj.GridEnabled)
+                            else if (editMode == EditMode.PlaceBlocks && mouseOverObj == currentMapObj.GridRenderer.gameObject && currentMapObj.GridEnabled)
                             {
                                 if (Event.current.type == EventType.MouseDown)
                                 {


弾クラスの追加

弾クラスの追加

--- DiceStg-Online/Bullet.cs
+++ DiceStg-Online/Bullet.cs
@@ -25,6 +25,9 @@

         public void Update()
         {
+            if (!IsEnable)
+                return;
+
             switch(Direction)
             {
                 case Direction.Left:
@@ -42,6 +45,11 @@
             }
         }

+        public void Disabling()
+        {
+            IsEnable = false;
+        }
+
         private Direction Direction { get; }
     }


Update ERLB units tests to comply with changes to testing framework bugid: 54

--- cslalighttest/UnitTest/CslaLight.Testing/EditableRootListTests/EditableRootListTests.cs
+++ cslalighttest/UnitTest/CslaLight.Testing/EditableRootListTests/EditableRootListTests.cs
@@ -66,8 +66,8 @@

         list.RemoveAt(2);
         context.Assert.AreEqual(2, list.Count, "Incorrect count after remove");
-        context.Assert.IsNull(ApplicationContext.GlobalContext["ERLBDeleteSelf"], "Object should not have done a delete");
-        Assert.IsTrue(item.IsNew, "Object should be new after delete");
+        context.Assert.IsNull(ApplicationContext.GlobalContext["ERLBDeleteSelf"]);
+        context.Assert.IsTrue(item.IsNew,"Object should be new after delete");

         context.Assert.Success();
       }


Correct IFD offset after writing strips.

--- ExifLibrary/TIFFFile.cs
+++ ExifLibrary/TIFFFile.cs
@@ -67,97 +67,98 @@
         /// <param name="stream">The data stream used to save the image.</param>
         public override void Save(Stream stream)
         {
-            using (MemoryStream mem = new MemoryStream())
+            BitConverterEx conv = BitConverterEx.SystemEndian;
+
+            // Write TIFF header
+            uint ifdoffset = 8;
+            // Byte order
+            stream.Write((BitConverterEx.SystemByteOrder == BitConverterEx.ByteOrder.LittleEndian ? new byte[] { 0x49, 0x49 } : new byte[] { 0x4D, 0x4D }), 0, 2);
+            // TIFF ID
+            stream.Write(conv.GetBytes((ushort)42), 0, 2);
+            // Offset to 0th IFD, will be corrected below
+            stream.Write(conv.GetBytes(ifdoffset), 0, 4);
+
+            // Write IFD sections
+            for (int i = 0; i < IFDs.Count; i++)
             {
-                BitConverterEx conv = BitConverterEx.SystemEndian;
+                ImageFileDirectory ifd = IFDs[i];

-                // Write TIFF header
-                uint ifdoffset = 8;
-                // Byte order
-                mem.Write((BitConverterEx.SystemByteOrder == BitConverterEx.ByteOrder.LittleEndian ? new byte[] { 0x49, 0x49 } : new byte[] { 0x4D, 0x4D }), 0, 2);
-                // TIFF ID
-                mem.Write(conv.GetBytes((ushort)42), 0, 2);
-                // Offset to 0th IFD
-                mem.Write(conv.GetBytes(ifdoffset), 0, 4);
+                // Save the location of IFD offset
+                long ifdLocation = stream.Position - 4;

-                // Write IFD sections
-                for (int i = 0; i < IFDs.Count; i++)
+                // Write strips first
+                byte[] stripOffsets = new byte[4 * ifd.Strips.Count];
+                byte[] stripLengths = new byte[4 * ifd.Strips.Count];
+                uint stripOffset = ifdoffset;
+                for (int j = 0; j < ifd.Strips.Count; j++)
                 {
-                    ImageFileDirectory ifd = IFDs[i];
-
-                    // Write strips first
-                    byte[] stripOffsets = new byte[4 * ifd.Strips.Count];
-                    byte[] stripLengths = new byte[4 * ifd.Strips.Count];
-                    uint stripOffset = ifdoffset;
-                    for (int j = 0; j < ifd.Strips.Count; j++)
-                    {
-                        byte[] stripData = ifd.Strips[j].Data;
-                        byte[] oBytes = BitConverter.GetBytes(stripOffset);
-                        byte[] lBytes = BitConverter.GetBytes((uint)stripData.Length);
-                        Array.Copy(oBytes, 0, stripOffsets, 4 * j, 4);
-                        Array.Copy(lBytes, 0, stripLengths, 4 * j, 4);
-                        mem.Write(stripData, 0, stripData.Length);
-                        stripOffset += (uint)stripData.Length;
-                    }
-
-                    // Remove old strip tags
-                    for (int j = ifd.Fields.Count - 1; j > 0; j--)
-                    {
-                        ushort tag = ifd.Fields[j].Tag;
-                        if (tag == 273 || tag == 279)
-                            ifd.Fields.RemoveAt(j);
-                    }
-                    // Write new strip tags
-                    ifd.Fields.Add(new ImageFileDirectoryEntry(273, 4, (uint)ifd.Strips.Count, stripOffsets));
-                    ifd.Fields.Add(new ImageFileDirectoryEntry(279, 4, (uint)ifd.Strips.Count, stripLengths));
-
-                    // Write fields after strips
-                    ifdoffset = stripOffset;
-
-                    // Offset to field data
-                    uint dataOffset = ifdoffset + 2 + (uint)ifd.Fields.Count * 12 + 4;
-
-                    // Field count
-                    mem.Write(conv.GetBytes((ushort)ifd.Fields.Count), 0, 2);
-
-                    // Fields
-                    foreach (ImageFileDirectoryEntry field in ifd.Fields)
-                    {
-                        // Tag
-                        mem.Write(conv.GetBytes(field.Tag), 0, 2);
-                        // Type
-                        mem.Write(conv.GetBytes(field.Type), 0, 2);
-                        // Count
-                        mem.Write(conv.GetBytes(field.Count), 0, 4);
-
-                        // Field data
-                        byte[] data = field.Data;
-                        if (data.Length <= 4)
-                        {
-                            mem.Write(data, 0, data.Length);
-                            for (int j = data.Length; j < 4; j++)
-                                mem.WriteByte(0);
-                        }
-                        else
-                        {
-                            mem.Write(conv.GetBytes(dataOffset), 0, 4);
-                            long currentOffset = mem.Position;
-                            mem.Seek(dataOffset, SeekOrigin.Begin);
-                            mem.Write(data, 0, data.Length);
-                            dataOffset += (uint)data.Length;
-                            mem.Seek(currentOffset, SeekOrigin.Begin);
-                        }
-                    }
-
-                    // Offset to next IFD
-                    ifdoffset = dataOffset;
-                    mem.Write(conv.GetBytes(i == IFDs.Count - 1 ? 0 : ifdoffset), 0, 4);
+                    byte[] stripData = ifd.Strips[j].Data;
+                    byte[] oBytes = BitConverter.GetBytes(stripOffset);
+                    byte[] lBytes = BitConverter.GetBytes((uint)stripData.Length);
+                    Array.Copy(oBytes, 0, stripOffsets, 4 * j, 4);
+                    Array.Copy(lBytes, 0, stripLengths, 4 * j, 4);
+                    stream.Write(stripData, 0, stripData.Length);
+                    stripOffset += (uint)stripData.Length;
                 }

-                // Save the memory stream to the output stream
-                stream.Seek(0, SeekOrigin.Begin);
-                byte[] b = Utility.GetStreamBytes(mem);
-                stream.Write(b, 0, b.Length);
+                // Remove old strip tags
+                for (int j = ifd.Fields.Count - 1; j > 0; j--)
+                {
+                    ushort tag = ifd.Fields[j].Tag;
+                    if (tag == 273 || tag == 279)
+                        ifd.Fields.RemoveAt(j);
+                }
+                // Write new strip tags
+                ifd.Fields.Add(new ImageFileDirectoryEntry(273, 4, (uint)ifd.Strips.Count, stripOffsets));
+                ifd.Fields.Add(new ImageFileDirectoryEntry(279, 4, (uint)ifd.Strips.Count, stripLengths));
+
+                // Write fields after strips
+                ifdoffset = stripOffset;
+
+                // Correct IFD offset
+                long currentLocation = stream.Position;
+                stream.Seek(ifdLocation, SeekOrigin.Begin);
+                stream.Write(conv.GetBytes(ifdoffset), 0, 4);
+                stream.Seek(currentLocation, SeekOrigin.Begin);
+
+                // Offset to field data
+                uint dataOffset = ifdoffset + 2 + (uint)ifd.Fields.Count * 12 + 4;
+
+                // Field count
+                stream.Write(conv.GetBytes((ushort)ifd.Fields.Count), 0, 2);
+
+                // Fields
+                foreach (ImageFileDirectoryEntry field in ifd.Fields)
+                {
+                    // Tag
+                    stream.Write(conv.GetBytes(field.Tag), 0, 2);
+                    // Type
+                    stream.Write(conv.GetBytes(field.Type), 0, 2);
+                    // Count
+                    stream.Write(conv.GetBytes(field.Count), 0, 4);
+
+                    // Field data
+                    byte[] data = field.Data;
+                    if (data.Length <= 4)
+                    {
+                        stream.Write(data, 0, data.Length);
+                        for (int j = data.Length; j < 4; j++)
+                            stream.WriteByte(0);
+                    }
+                    else
+                    {
+                        stream.Write(conv.GetBytes(dataOffset), 0, 4);
+                        long currentOffset = stream.Position;
+                        stream.Seek(dataOffset, SeekOrigin.Begin);
+                        stream.Write(data, 0, data.Length);
+                        dataOffset += (uint)data.Length;
+                        stream.Seek(currentOffset, SeekOrigin.Begin);
+                    }
+                }
+
+                // Offset to next IFD
+                ifdoffset = dataOffset;
+                stream.Write(conv.GetBytes(i == IFDs.Count - 1 ? 0 : ifdoffset), 0, 4);
             }
         }


Use single quotes when specifying the parameters in the App.config

--- Parameters.cs
+++ Parameters.cs
@@ -27,7 +27,7 @@
         /// <summary>
         /// Values Regex Statement
         /// </summary>
-        private static readonly string valuesRegexStatement = "[" + quote + "]*(?<value>.[^" + quote + "]*)[" + quote + " ]*";
+        private static readonly string valuesRegexStatement = "[" + quote + "']*(?<value>.[^" + quote + "']*)[" + quote + "' ]*";

         /// <summary>
         /// Quote


Property accessor is never used

Property accessor is never used

--- Player/Bot.cs
+++ Player/Bot.cs
@@ -80,7 +80,7 @@
         /// <summary>
         ///     The room the bot is joined to.
         /// </summary>
-        public bool Joined { get; internal set; }
+        public bool Joined { internal get; set; }

         /// <summary>
         ///     If the physics clock should tick or not.


Protect now public API against null

Protect now public API against null

--- Mono.Cecil/MetadataResolver.cs
+++ Mono.Cecil/MetadataResolver.cs
@@ -27,7 +27,6 @@
 //

 using System;
-using System.Collections.Generic;

 using Mono.Collections.Generic;

@@ -84,11 +83,17 @@

 		public MetadataResolver (IAssemblyResolver assemblyResolver)
 		{
+			if (assemblyResolver == null)
+				throw new ArgumentNullException ("assemblyResolver");
+
 			assembly_resolver = assemblyResolver;
 		}

 		public virtual TypeDefinition Resolve (TypeReference type)
 		{
+			if (type == null)
+				throw new ArgumentNullException ("type");
+
 			type = type.GetElementType ();

 			var scope = type.Scope;
@@ -154,6 +159,9 @@

 		public virtual FieldDefinition Resolve (FieldReference field)
 		{
+			if (field == null)
+				throw new ArgumentNullException ("field");
+
 			var type = Resolve (field.DeclaringType);
 			if (type == null)
 				return null;
@@ -199,6 +207,9 @@

 		public virtual MethodDefinition Resolve (MethodReference method)
 		{
+			if (method == null)
+				throw new ArgumentNullException ("method");
+
 			var type = Resolve (method.DeclaringType);
 			if (type == null)
 				return null;


Applied patch from issue 1.

Applied patch from issue 1.

--- MoreLinq/Pull/Concatenation.cs
+++ MoreLinq/Pull/Concatenation.cs
@@ -3,6 +3,8 @@

 namespace MoreLinq.Pull
 {
+    using System.Linq;
+
     public static class Concatenation
     {
         /// <summary>
@@ -15,16 +17,7 @@
         public static IEnumerable<T> Concat<T>(this T head, IEnumerable<T> tail)
         {
             tail.ThrowIfNull("tail");
-            return ConcatImpl(head, tail);
-        }
-
-        private static IEnumerable<T> ConcatImpl<T>(this T head, IEnumerable<T> tail)
-        {
-            yield return head;
-            foreach (T element in tail)
-            {
-                yield return element;
-            }
+            return Enumerable.Repeat(head, 1).Concat(tail);
         }

         /// <summary>
@@ -37,16 +30,7 @@
         public static IEnumerable<T> Concat<T>(this IEnumerable<T> head, T tail)
         {
             head.ThrowIfNull("head");
-            return ConcatImpl(head, tail);
-        }
-
-        private static IEnumerable<T> ConcatImpl<T>(this IEnumerable<T> head, T tail)
-        {
-            foreach (T element in head)
-            {
-                yield return element;
-            }
-            yield return tail;
+            return head.Concat(Enumerable.Repeat(tail, 1));
         }
     }
 }


Adds curved lasers and their processing to the bullet system.

--- ProjectHekate.Core/BulletSystem.cs
+++ ProjectHekate.Core/BulletSystem.cs
@@ -5,6 +5,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using ProjectHekate.Core.MathExtras;

 namespace ProjectHekate.Core
 {
@@ -12,32 +13,56 @@
     {
         IBullet FireBasicBullet(float x, float y, float angle, float speedPerFrame, int spriteIndex);
         IBullet FireScriptedBullet(float x, float y, float angle, float speedPerFrame, int spriteIndex, ProjectileUpdateDelegate<Bullet> bulletFunc);
+        ICurvedLaser FireCurvedLaser(float x, float y, float angle, float radius, uint lifetime, float speedPerFrame, int spriteIndex,
+            ProjectileUpdateDelegate<CurvedLaser> laserFunc);

         IReadOnlyCollection<IBullet> Bullets { get; }
+        IReadOnlyCollection<ICurvedLaser> CurvedLasers { get; }
     }

     public class BulletSystem : IBulletSystem
     {
         public const int MaxBullets = 2048;
-
-        // TODO: break bullets into arrays of components
+        public const int MaxCurvedLasers = 64;
+
+        // TODO: break projectiles into arrays of components
+
         private readonly Bullet[] _bullets = new Bullet[MaxBullets];
         private int _availableBulletIndex;
+
+        private readonly CurvedLaser[] _curvedLasers = new CurvedLaser[MaxCurvedLasers];
+        private int _availableCurvedLaserIndex;
+
         private readonly float[] _bulletWaitTimers = new float[MaxBullets];
         private readonly IEnumerator<WaitInFrames>[] _bulletEnumerators = new IEnumerator<WaitInFrames>[MaxBullets];

+        private readonly float[] _curvedLaserWaitTimers = new float[MaxCurvedLasers];
+        private readonly IEnumerator<WaitInFrames>[] _curvedLaserEnumerators = new IEnumerator<WaitInFrames>[MaxCurvedLasers];
+
         public IReadOnlyCollection<IBullet> Bullets { get; private set; }
+        public IReadOnlyCollection<ICurvedLaser> CurvedLasers { get; private set; }

         public BulletSystem()
         {
-            for (var i = 0; i < MaxBullets; i++) {
+            for (var i = 0; i < MaxBullets; i++)
+            {
                 _bullets[i] = new Bullet();
                 _bulletWaitTimers[i] = -1.0f;
                 _bulletEnumerators[i] = null;
             }

+            for (var i = 0; i < MaxCurvedLasers; i++)
+            {
+                _curvedLasers[i] = new CurvedLaser();
+                _curvedLaserWaitTimers[i] = -1.0f;
+                _curvedLaserEnumerators[i] = null;
+            }
+
             Bullets = Array.AsReadOnly(_bullets);
-        }
+            CurvedLasers = Array.AsReadOnly(_curvedLasers);
+        }
+
+        #region Firing functions

         public IBullet FireBasicBullet(float x, float y, float angle, float speedPerFrame, int spriteIndex)
         {
@@ -48,6 +73,15 @@
         {
             return InternalFireBullet(x, y, angle, speedPerFrame, spriteIndex, bulletFunc);
         }
+
+        public ICurvedLaser FireCurvedLaser(float x, float y, float angle, float radius, uint lifetime, float speedPerFrame, int spriteIndex, ProjectileUpdateDelegate<CurvedLaser> laserFunc)
+        {
+            return InternalFireCurvedLaser(x, y, angle, radius, lifetime, speedPerFrame, spriteIndex, laserFunc);
+        }
+
+        #endregion
+
+        #region Internal firing functions & utility functions

         private Bullet InternalFireBullet(float x, float y, float angle, float speed, int spriteIndex, ProjectileUpdateDelegate<Bullet> bulletFunc)
         {
@@ -63,10 +97,33 @@

             return bullet;
         }
-
+
+        private CurvedLaser InternalFireCurvedLaser(float x, float y, float angle, float radius, uint lifetime, float speed, int spriteIndex,
+            ProjectileUpdateDelegate<CurvedLaser> laserFunc)
+        {
+            var cv = FindNextAvailableCurvedLaser();
+
+            cv.X = x;
+            cv.Y = y;
+            cv.Angle = angle;
+            cv.Radius = radius;
+            cv.Lifetime = lifetime;
+            cv.Speed = speed;
+            cv.SpriteIndex = spriteIndex;
+            cv.UpdateFunc = laserFunc;
+            cv.FramesAlive = 0;
+
+            return cv;
+        }
+
         private Bullet FindNextAvailableBullet()
         {
             return FindNextAvailableProjectile(MaxBullets, ref _availableBulletIndex, _bullets);
+        }
+
+        private CurvedLaser FindNextAvailableCurvedLaser()
+        {
+            return FindNextAvailableProjectile(MaxCurvedLasers, ref _availableCurvedLaserIndex, _curvedLasers);
         }

         private TProjectileType FindNextAvailableProjectile<TProjectileType>(int maxProjectiles, ref int availableProjectileIndex, TProjectileType[] projectileArray) where TProjectileType : AbstractProjectile
@@ -88,10 +145,18 @@
             return projectileArray[availableProjectileIndex];
         }

+        #endregion

         internal void Update(float dt)
         {
-            for (var i = 0; i < MaxBullets; i++) {
+            UpdateBullets();
+            UpdateCurvedLasers();
+        }
+
+        private void UpdateBullets()
+        {
+            for (var i = 0; i < MaxBullets; i++)
+            {
                 var b = _bullets[i];

                 if (!b.IsActive)
@@ -149,5 +214,81 @@
                 b.FramesAlive++;
             }
         }
+
+        private void UpdateCurvedLasers()
+        {
+            for (var i = 0; i < MaxCurvedLasers; i++)
+            {
+                var cv = _curvedLasers[i];
+
+                if (!cv.IsActive) {
+                    continue;
+                }
+
+                cv.X += (float)Math.Cos(cv.Angle) * cv.Speed;
+                cv.Y += (float)Math.Sin(cv.Angle) * cv.Speed;
+
+                // if the curved laser does not have a special update function, skip the wait logic
+                if (cv.UpdateFunc == null)
+                {
+                    cv.FramesAlive++;
+                    continue;
+                }
+
+                var limit = Math.Min(cv.FramesAlive, cv.Lifetime-1);
+                // add the cv's new position to the internal list of points
+                // the "- 1" is so that a length of 1 means 1 point in the list of coordinates
+                if (cv.FramesAlive < cv.Lifetime) {
+                    // no need to do anything before appending
+                }
+                else {
+                    // move everything over to the left and then "append"
+                    Array.Copy(cv.InternalCoordinates, 1, cv.InternalCoordinates,0, cv.Lifetime-1);
+                }
+
+                //append
+                cv.InternalCoordinates[limit] = new Vector<float>(cv.X, cv.Y);
+
+
+                // if the curved laser's "update state" is ready
+                if (_curvedLaserWaitTimers[i] <= 0)
+                {
+                    var loopAgain = true;
+
+                    // this loopAgain variable basically means: start from the beginning of the Update function if the function reaches completion
+                    // this means that if there isn't a yield return, the function will loop infinitely
+                    // TODO: somehow prevent that
+                    while (loopAgain)
+                    {
+                        _curvedLaserEnumerators[i] = _curvedLaserEnumerators[i] ?? cv.Update();
+
+                        // this steps through the curved laser's update function until it hits a yield return
+                        if (_curvedLaserEnumerators[i].MoveNext())
+                        {
+                            // TODO: check the type of _curvedLaserEnumerators[i].Current to make sure it isn't null?
+                            // starting next frame, this curved laser is 'waiting'
+                            _curvedLaserWaitTimers[i] = _curvedLaserEnumerators[i].Current.Delay;
+
+                            loopAgain = false;
+                        }
+                        else
+                        {
+                            // if it returns false, then it has hit the end of the function -- so loop again, from the beginning
+                            _curvedLaserEnumerators[i] = cv.Update();
+
+                            loopAgain = true;
+                        }
+                    }
+                }
+                else
+                {
+                    // the curved laser is "waiting"
+                    _curvedLaserWaitTimers[i]--;
+                }
+
+                cv.FramesAlive++;
+            }
+        }
+
     }
 }


The lil arrow follows the camera's joystick

--- Proto/Assets/Scripts/UI/ClockUI.cs
+++ Proto/Assets/Scripts/UI/ClockUI.cs
@@ -22,13 +22,20 @@
             else if (child.name.IndexOf("pivotMinutes", StringComparison.InvariantCultureIgnoreCase) > -1) _minutes = child;
             else if (child.name.IndexOf("pivotArrow", StringComparison.InvariantCultureIgnoreCase) > -1) _arrow = child;
         }
-        _timeController.Tick.Suscribe(UpdateClock);
-        UpdateClock(0);
+        UpdateClock(_timeController.time);
+    }
+
+    private void OnDisable()
+    {
+        Debug.Log(_arrow.rotation);
     }

     private void Update()
     {
-        _arrow.Rotate(0f, 0f, Input.GetAxis("Horizontal") * Input.GetAxis("Vertical") % 360);
+        var horizontal = Input.GetAxis("CameraHorizontal") * Time.deltaTime * _speed;
+        var vertical = Input.GetAxis("CameraVertical") * Time.deltaTime * _speed;
+        var angle = -Mathf.Atan2(horizontal, vertical) * Mathf.Rad2Deg;
+        _arrow.rotation = Quaternion.Euler(new Vector3(0, 0, angle));
     }

     private int UpdateClock(int time)


Increase timeouts to make sure the tests pass on low CPU box.

--- source/Zyan.Tests/DebouncerTests.cs
+++ source/Zyan.Tests/DebouncerTests.cs
@@ -45,7 +45,7 @@
 			Debouncer.SetTimeout(inc, 10);
 			Assert.AreEqual(0, counter);

-			Thread.Sleep(50);
+			Thread.Sleep(100);
 			Assert.AreEqual(1, counter);
 		}

@@ -60,7 +60,7 @@
 			Assert.AreEqual(0, counter);
 			timer.Dispose();

-			Thread.Sleep(50);
+			Thread.Sleep(100);
 			Assert.AreEqual(0, counter);
 		}

@@ -83,7 +83,7 @@
 			Debouncer.SetInterval(inc, 10);
 			Assert.AreEqual(0, counter);

-			Thread.Sleep(50);
+			Thread.Sleep(100);
 			Assert.IsTrue(counter > 1);
 		}

@@ -97,12 +97,12 @@
 			var timer = Debouncer.SetInterval(inc, 10);
 			Assert.AreEqual(0, counter);

-			Thread.Sleep(50);
+			Thread.Sleep(100);
 			Assert.IsTrue(counter > 1);
 			timer.Dispose();

 			var lastCounter = counter;
-			Thread.Sleep(50);
+			Thread.Sleep(100);
 			Assert.AreEqual(lastCounter, counter);
 		}

@@ -133,7 +133,7 @@
 			debounced();
 			Assert.AreEqual(0, counter);

-			Thread.Sleep(50);
+			Thread.Sleep(100);
 			Assert.AreEqual(1, counter);
 		}

@@ -183,7 +183,7 @@
 			debounced();
 			Assert.AreEqual(0, counter);

-			Thread.Sleep(50);
+			Thread.Sleep(100);
 			Assert.AreEqual(1, counter);
 		}

@@ -226,7 +226,7 @@

 			// now cancel pending execution
 			debounced(false);
-			Thread.Sleep(50);
+			Thread.Sleep(100);

 			// the code wasn't executed
 			Assert.AreEqual(0, counter);
@@ -261,7 +261,7 @@
 			var counter = 0;
 			var action = new Action(() =>
 			{
-				Thread.Sleep(100);
+				Thread.Sleep(50);
 				Interlocked.Increment(ref counter);
 			});

@@ -271,7 +271,7 @@
 				ThreadPool.QueueUserWorkItem(x => action());
 			}

-			Thread.Sleep(200);
+			Thread.Sleep(300);
 			Assert.AreEqual(5, counter);

 			// convert it into an exclusive action
@@ -282,12 +282,12 @@
 			for (var i = 0; i < 4; i++)
 			{
 				// assume that all worker threads are started within
-				// the 100ms time span while the first action is still running
+				// the 50ms time span while the first action is still running
 				ThreadPool.QueueUserWorkItem(x => action());
 			}

 			// assume that all user work items are processed now
-			Thread.Sleep(200);
+			Thread.Sleep(300);
 			Assert.AreEqual(1, counter);

 			// the modified action is still executed by only one thread
@@ -296,7 +296,7 @@
 				ThreadPool.QueueUserWorkItem(x => action());
 			}

-			Thread.Sleep(100);
+			Thread.Sleep(300);
 			Assert.AreEqual(2, counter);
 		}
 	}


fixed infinite loop

fixed infinite loop

--- Zirpl.FluentReflection/Accessors/InstanceTypeAccessor.cs
+++ Zirpl.FluentReflection/Accessors/InstanceTypeAccessor.cs
@@ -75,11 +75,12 @@
                         var type = _type.BaseType;
                         while (type != null && propertyInfo == null)
                         {
-                            propertyInfo = _type.QueryProperties()
+                            propertyInfo = type.QueryProperties()
                                .OfAccessibility()
                                .Private().And()
                                .Named().ExactlyIgnoreCase(name)
-                               .ResultSingleOrDefault();
+                               .ResultSingleOrDefault();
+                            type = type.BaseType;
                         }
                     }
                     _propertyMap.Add(name.ToLower(), propertyInfo);
@@ -107,11 +108,12 @@
                         var type = _type.BaseType;
                         while (type != null && fieldInfo == null)
                         {
-                            fieldInfo = _type.QueryFields()
+                            fieldInfo = type.QueryFields()
                                .OfAccessibility()
                                .Private().And()
                                .Named().ExactlyIgnoreCase(name)
                                .ResultSingleOrDefault();
+                            type = type.BaseType;
                         }
                     }
                     _fieldMap.Add(name.ToLower(), fieldInfo);
@@ -139,11 +141,12 @@
                         var type = _type.BaseType;
                         while (type != null && eventInfo == null)
                         {
-                            eventInfo = _type.QueryEvents()
+                            eventInfo = type.QueryEvents()
                                .OfAccessibility()
                                .Private().And()
                                .Named().ExactlyIgnoreCase(name)
                                .ResultSingleOrDefault();
+                            type = type.BaseType;
                         }
                     }
                     _eventMap.Add(name.ToLower(), eventInfo);


Improve debugger view of Rect

Improve debugger view of Rect

Show width and height of `Rect`.

--- src/ImGui/Common/Primitive/Rect.cs
+++ src/ImGui/Common/Primitive/Rect.cs
@@ -7,7 +7,7 @@
     /// X, Y (Location) and Width and Height (Size).  As a result, Rects cannot have negative
     /// Width or Height.
     /// </summary>
-    [System.Diagnostics.DebuggerDisplay("({Min.X}, {Min.Y}, {Max.X}, {Max.Y})")]
+    [System.Diagnostics.DebuggerDisplay("({Min.X},{Min.Y})~({Max.X},{Max.Y}) W={Width} H={Height}")]
     [System.Diagnostics.DebuggerStepThrough]
     [Serializable]
     public struct Rect : IFormattable


Fixed a minor bug in saving the result image.

--- Source/Twipe.UI/Common/SaveFileService.cs
+++ Source/Twipe.UI/Common/SaveFileService.cs
@@ -37,7 +37,7 @@
         {
             // copy source file to a temp file to avoid conflict
             string tempFile = Path.GetTempPath() + "saveTempFile";
-            File.Copy(source, tempFile);
+            File.Copy(source, tempFile, true);
             OnProgressChanged(20);

             Bitmap tempBitmap = new Bitmap(tempFile);


Allow the vibration only on Mobile

Allow the vibration only on Mobile

--- src/KodiRemote.Uwp/Core/Helpers.cs
+++ src/KodiRemote.Uwp/Core/Helpers.cs
@@ -4,6 +4,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using Windows.Phone.Devices.Notification;
+using Windows.System.Profile;
 using Windows.UI.Xaml.Media;

 namespace KodiRemote.Uwp.Core
@@ -51,9 +52,12 @@
         public static void Vibrate()
         {
             if (!App.Context.AllowVibrate) return;
-
-            VibrationDevice v = VibrationDevice.GetDefault();
-            v.Vibrate(TimeSpan.FromMilliseconds(50));
+
+            if ("Windows.Mobile".Equals(AnalyticsInfo.VersionInfo.DeviceFamily, StringComparison.OrdinalIgnoreCase))
+            {
+                VibrationDevice v = VibrationDevice.GetDefault();
+                v.Vibrate(TimeSpan.FromMilliseconds(50));
+            }
         }
     }
 }


fixed broken XSP build

fixed broken XSP build

Making all in Mono.WebServer.FastCgi
  GMCS  /out:fastcgi-mono-server2.exe
././main.cs(141,72): error CS0177: The out parameter `socket' must be assigned to before control leaves the current method

--- src/Mono.WebServer.FastCgi/main.cs
+++ src/Mono.WebServer.FastCgi/main.cs
@@ -140,6 +140,7 @@

 		static bool TryCreateOnDemandSocket (string onDemandSock, out Socket socket, out Uri uri)
 		{
+			socket = null;
 			return (Uri.TryCreate (onDemandSock, UriKind.Absolute, out uri) && TryCreateSocketFromUri (uri, out socket))
 				|| TryCreateUnixSocket (onDemandSock, out socket);
 		}


#54 Simplified error handling logic of failed update tasks

--- src/NAppUpdate.Updater/AppStart.cs
+++ src/NAppUpdate.Updater/AppStart.cs
@@ -158,6 +158,8 @@
 					continue;
 				}

+				Exception exception = null;
+
 				try
 				{
 					Log("\tExecuting...");
@@ -166,19 +168,14 @@
 				catch (Exception ex)
 				{
 					t.ExecutionStatus = TaskExecutionStatus.Failed;
-					string exceptionMessage = string.Format("Update failed, task execution threw an exception, description: {0}, execution status: {1}", t.Description, t.ExecutionStatus);
-					throw new Exception(exceptionMessage, ex);
-				}
-
-				if (t.ExecutionStatus == TaskExecutionStatus.Successful)
-				{
-					continue;
-				}
-
-				string taskFailedMessage = string.Format("Update failed, task execution failed, description: {0}, execution status: {1}", t.Description, t.ExecutionStatus);
-
-				Log(Logger.SeverityLevel.Error, taskFailedMessage);
-				throw new Exception(taskFailedMessage);
+					exception = ex;
+				}
+
+				if (t.ExecutionStatus != TaskExecutionStatus.Successful)
+				{
+					string taskFailedMessage = string.Format("Update failed, task execution failed, description: {0}, execution status: {1}", t.Description, t.ExecutionStatus);
+					throw new Exception(taskFailedMessage, exception);
+				}
 			}

 			Log("Finished successfully");


Fixed AssignableTo documentation

Fixed AssignableTo documentation

--- src/NUnitFramework/framework/Is.cs
+++ src/NUnitFramework/framework/Is.cs
@@ -349,7 +349,7 @@

         /// <summary>
         /// Returns a constraint that tests whether the actual value
-        /// is assignable from the type supplied as an argument.
+        /// is assignable to the type supplied as an argument.
         /// </summary>
         public static AssignableToConstraint AssignableTo(Type expectedType)
         {
@@ -358,7 +358,7 @@

         /// <summary>
         /// Returns a constraint that tests whether the actual value
-        /// is assignable from the type supplied as an argument.
+        /// is assignable to the type supplied as an argument.
         /// </summary>
         public static AssignableToConstraint AssignableTo<TExpected>()
         {


Fixing IContentManagerSession usage

Fixing IContentManagerSession usage

--- src/Orchard/Data/SessionLocator.cs
+++ src/Orchard/Data/SessionLocator.cs
@@ -15,17 +15,18 @@
     public class SessionLocator : ISessionLocator, ITransactionManager, IDisposable {
         private readonly ISessionFactoryHolder _sessionFactoryHolder;
         private readonly IEnumerable<ISessionInterceptor> _interceptors;
-        private Func<IContentManagerSession> _contentManagerSession;
+        private Func<IContentManagerSession> _contentManagerSessionFactory;

         private ISession _session;
+        private IContentManagerSession _contentManagerSession;

         public SessionLocator(
-            ISessionFactoryHolder sessionFactoryHolder,
-            Func<IContentManagerSession> contentManagerSession,
+            ISessionFactoryHolder sessionFactoryHolder,
+            Func<IContentManagerSession> contentManagerSessionFactory,
             IEnumerable<ISessionInterceptor> interceptors) {
             _sessionFactoryHolder = sessionFactoryHolder;
             _interceptors = interceptors;
-            _contentManagerSession = contentManagerSession;
+            _contentManagerSessionFactory = contentManagerSessionFactory;

             Logger = NullLogger.Instance;
             IsolationLevel = IsolationLevel.ReadCommitted;
@@ -75,12 +76,12 @@
                     }
                 }
                 finally {
+                    _contentManagerSession.Clear();
+
                     Logger.Debug("Disposing session");
                     _session.Close();
                     _session.Dispose();
                     _session = null;
-
-                    _contentManagerSession().Clear();
                 }
             }
         }
@@ -94,6 +95,7 @@
             Logger.Debug("Opening NHibernate session");
             _session = sessionFactory.OpenSession(new OrchardSessionInterceptor(_interceptors.ToArray(), Logger));
             _session.BeginTransaction(level);
+            _contentManagerSession = _contentManagerSessionFactory();
         }

         class OrchardSessionInterceptor : IInterceptor {


* Repository.cs: Made GitInternalSlash internal instead of private

--- Repository.cs
+++ Repository.cs
@@ -865,7 +865,7 @@
             _refDb.ClearCache();
         }

-        static byte[] GitInternalSlash(byte[] bytes)
+        internal static byte[] GitInternalSlash(byte[] bytes)
         {
             if (Path.PathSeparator == '/')
                 return bytes;


Fixed texture sample.

Fixed texture sample.

--- samples/HelloTextures/HelloTexturesSample.cs
+++ samples/HelloTextures/HelloTexturesSample.cs
@@ -41,7 +41,9 @@

         private uint vertexArray;
         private uint texture;
-        private uint shaderProgram;
+        private uint program;
+
+        private int fragTextureLocation;

         public HelloTriangleSample()
         {
@@ -91,7 +93,9 @@

             uint vs = GLUtility.CreateAndCompileShader(GL_VERTEX_SHADER, VertexShader);
             uint fs = GLUtility.CreateAndCompileShader(GL_FRAGMENT_SHADER, FragmentShader);
-            this.shaderProgram = GLUtility.CreateAndLinkProgram(vs, fs);
+            this.program = GLUtility.CreateAndLinkProgram(vs, fs);
+
+            this.fragTextureLocation = glGetUniformLocation(this.program, "fragTexture");

             glEnable(GL_DEPTH_TEST);
             glDepthFunc(GL_LESS);
@@ -108,9 +112,13 @@

             glViewport(0, 0, this.Width, this.Height);

-            glUseProgram(this.shaderProgram);
+            glUseProgram(this.program);
             glBindVertexArray(this.vertexArray);
-            glUniform1ui(0, this.texture);
+
+            glActiveTexture(GL_TEXTURE0);
+            glBindTexture(GL_TEXTURE_2D, this.texture);
+            glUniform1ui(this.fragTextureLocation, 0); // 0 indicates Texture Unit 0
+
             glDrawArrays(GL_TRIANGLES, 0, 3);
         }


update properties with event handler

update properties with event handler

--- test/QbXml.Tests/Messages/Responses/EmployeeQueryResponseTests.cs
+++ test/QbXml.Tests/Messages/Responses/EmployeeQueryResponseTests.cs
@@ -114,11 +114,17 @@
     </EmployeePayrollInfo>
 </EmployeeRet>";
             var response = new QbXmlResponse();
-            var unknownElements = 0;
+            var onUnknownElementCalled = 0;
             XmlDeserializationEvents events = new XmlDeserializationEvents();
             events.OnUnknownElement += (object sender, XmlElementEventArgs e) =>
             {
-                unknownElements++;
+                onUnknownElementCalled++;
+                if (e.Element.Name == nameof(EmployeePayrollInfo.UseTimeDataToCreatePaychecks) && Enum.TryParse(typeof(UseTimeDataToCreatePaychecks), e.Element.InnerText, out object useTimeData))
+                {
+                    var employeePayrollInfo = (EmployeePayrollInfo)e.ObjectBeingDeserialized;
+                    employeePayrollInfo.UseTimeDataToCreatePaychecksSpecified = true;
+                    employeePayrollInfo.UseTimeDataToCreatePaychecks = (UseTimeDataToCreatePaychecks)useTimeData;
+                }
             };
             var rs = response.GetSingleItemFromResponse<EmployeeQueryRsType>(QuickBooksTestHelper.CreateQbXmlWithEnvelope(employeeRet, "EmployeeQueryRs"), events);

@@ -127,7 +133,11 @@

             Assert.AreEqual(1, employees.Length);
             Assert.AreEqual("1111111-111111111", employee.ListID);
-            Assert.GreaterOrEqual(unknownElements, 1);
+            // Custom event handler was called at least once
+            Assert.GreaterOrEqual(onUnknownElementCalled, 1);
+            // Custom event handler updated a known property captured by the OnUnknownElement event
+            Assert.IsTrue(employee.EmployeePayrollInfo.UseTimeDataToCreatePaychecksSpecified);
+            Assert.AreEqual(UseTimeDataToCreatePaychecks.UseTimeData, employee.EmployeePayrollInfo.UseTimeDataToCreatePaychecks);
         }
     }
 }


Version 0.0.2

Version 0.0.2

--- Pvc.CLI/Properties/AssemblyInfo.cs
+++ Pvc.CLI/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.0.1.5")]
-[assembly: AssemblyFileVersion("0.0.1.5")]
+[assembly: AssemblyVersion("0.0.2.0")]
+[assembly: AssemblyFileVersion("0.0.2.0")]


procted

procted

--- Unity/NGUIUtil/NGUIMessageQueueControllerBase.cs
+++ Unity/NGUIUtil/NGUIMessageQueueControllerBase.cs
@@ -105,7 +105,7 @@

 	}

-	bool m_InAnimation = false ;
-	LinkedList<string> m_MessageQueue = new LinkedList<string>() ;
+	protected bool m_InAnimation = false ;
+	protected LinkedList<string> m_MessageQueue = new LinkedList<string>() ;

 }


Always send grouptype when creating group

--- src/Q42.HueApi/HueClient-Groups.cs
+++ src/Q42.HueApi/HueClient-Groups.cs
@@ -18,31 +18,31 @@
   /// </summary>
   public partial class HueClient
   {
-	/// <summary>
-	/// Create a group for a list of lights
-	/// </summary>
-	/// <param name="lights">List of lights in the group</param>
-	/// <param name="name">Optional name</param>
-	/// <param name="roomClass">for room creation the room class has to be passed, without class it will get the default: "Other" class.</param>
-	/// <returns></returns>
-	public async Task<string> CreateGroupAsync(IEnumerable<string> lights, string name = null, RoomClass? roomClass = null, GroupType groupType = GroupType.Room)
+    /// <summary>
+    /// Create a group for a list of lights
+    /// </summary>
+    /// <param name="lights">List of lights in the group</param>
+    /// <param name="name">Optional name</param>
+    /// <param name="roomClass">for room creation the room class has to be passed, without class it will get the default: "Other" class.</param>
+    /// <returns></returns>
+    public async Task<string> CreateGroupAsync(IEnumerable<string> lights, string name = null, RoomClass? roomClass = null, GroupType groupType = GroupType.Room)
     {
       CheckInitialized();

       if (lights == null)
         throw new ArgumentNullException(nameof(lights));

-			CreateGroupRequest jsonObj = new CreateGroupRequest();
+      CreateGroupRequest jsonObj = new CreateGroupRequest();
       jsonObj.Lights = lights;

       if (!string.IsNullOrEmpty(name))
         jsonObj.Name = name;

-	  if(roomClass.HasValue)
-	  {
-		jsonObj.Class = roomClass.Value;
-		jsonObj.Type = groupType;
-	  }
+      if (!roomClass.HasValue)
+        roomClass = RoomClass.Other;
+
+      jsonObj.Class = roomClass.Value;
+      jsonObj.Type = groupType;

       string jsonString = JsonConvert.SerializeObject(jsonObj, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });


Add additional HLVR known types (#241)

Add additional HLVR known types (#241)

--- ValveResourceFormat/Utils/EntityLumpKnownKeys.cs
+++ ValveResourceFormat/Utils/EntityLumpKnownKeys.cs
@@ -853,6 +853,7 @@
                 "fmodulationtype",
                 "fog_color_day",
                 "fog_color_night",
+                "fogcontributionstrength",
                 "fog_end_day",
                 "fog_end_night",
                 "fog_flow_map_texture",
@@ -860,6 +861,7 @@
                 "fog_height_night",
                 "fog_hight_color_day",
                 "fog_hight_color_night",
+                "fog_lighting",
                 "fog_start_day",
                 "fog_start_night",
                 "fog_type",


リファクタリング

リファクタリング

--- VendingMachine/VendingMachineTests/Step3Tests.cs
+++ VendingMachine/VendingMachineTests/Step3Tests.cs
@@ -1,4 +1,5 @@
 using System;
+using Item.Items;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using Money;
 using VendingMachine;
@@ -8,22 +9,48 @@
     [TestClass]
     public class Step3Tests
     {
+
+        private Itemラック _itemラック;
+        private 投入金額 _投入金額;
+        private 投入口 _投入口;
+
+        private Item.Item _coke;
+
+        [TestInitialize]
+        public void TestInitialize()
+        {
+            _coke= MakeCokeDrink();
+
+            _itemラック = Itemラック.ItemラックFactory();
+            _itemラック.格納アイテム初期化();
+
+            _投入金額= 投入金額.投入金額Factory();
+            _投入金額.投入金額歴初期化();
+
+            _投入口= 投入口.投入口Factory(_投入金額);
+        }
+
+
+        public static Item.Item MakeCokeDrink()
+        {
+            return Item.Items.Drink.Factory("コーラ", 100);
+        }
+
+
+
         [TestMethod]
         public void コーラの在庫がある状態で100円投入して購入可能状態となるか()
         {
-            var coke= Item.Items.Drink.Factory("コーラ", 100);
-            var itemラック = Itemラック.ItemラックFactory();
-            itemラック.格納アイテム初期化();
+
             //ラックにcoke格納
-            itemラック.SetItem(coke);
+            _itemラック.SetItem(_coke);

-
-            var factory = 投入金額.投入金額Factory();
-            factory.投入金額歴初期化();
-            var _投入口 = 投入口.投入口Factory(factory);
+            //お金投入
             _投入口.投入(MoneyKind.Yen100);

-            VendingMachine.Rules.アイテム購入.Is購入可(coke.Name).IsTrue();
+            VendingMachine.Rules.アイテム購入
+                                .Is購入可(_coke.Name)
+                                .IsTrue();
         }

@@ -31,19 +58,16 @@
         [TestMethod]
         public void コーラの在庫がある状態で10円投入して購入不可状態となるか()
         {
-            var coke = Item.Items.Drink.Factory("コーラ", 100);
-            var itemラック = Itemラック.ItemラックFactory();
-            itemラック.格納アイテム初期化();
             //ラックにcoke格納
-            itemラック.SetItem(coke);
+            _itemラック.SetItem(_coke);

-
-            var factory = 投入金額.投入金額Factory();
-            factory.投入金額歴初期化();
-            var _投入口 = 投入口.投入口Factory(factory);
+            //お金投入
             _投入口.投入(MoneyKind.Yen10);

-            VendingMachine.Rules.アイテム購入.Is購入可(coke.Name).IsFalse();
+            VendingMachine.Rules.アイテム購入
+                .Is購入可(_coke.Name)
+                .IsFalse();
+
         }


add hash256 to output of whatisitscript

add hash256 to output of whatisitscript

--- QBitNinja/Models/WhatIsItModels.cs
+++ QBitNinja/Models/WhatIsItModels.cs
@@ -20,17 +20,24 @@
         {
             Raw = script;
             Asm = script.ToString();
-            Hash = new uint160(script.Hash.ToBytes(false), false);
+            Hash160 = new uint160(script.Hash.ToBytes(false), false);
+			Hash256 = new uint256(script.WitHash.ToBytes(false), false);
             var address = script.GetDestinationAddress(network);
             if(address != null)
                 Address =  address.ToString();
         }

-        public uint160 Hash
-        {
-            get;
-            set;
-        }
+        public uint160 Hash160
+        {
+            get;
+            set;
+        }
+
+		public uint256 Hash256
+		{
+			get;
+			set;
+		}

         public string Address
         {
@@ -48,8 +55,8 @@
         {
             get;
             set;
-        }
-    }
+        }
+	}

     public class WhatIsPublicKey
     {


1. update version number

1. update version number

--- QRUtils/Properties/AssemblyInfo.cs
+++ QRUtils/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // 可以指定所有这些值，也可以使用“内部版本号”和“修订号”的默认值，
 // 方法是按如下所示使用“*”:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.5.105")]
-[assembly: AssemblyFileVersion("1.0.5.105")]
+[assembly: AssemblyVersion("1.0.5.112")]
+[assembly: AssemblyFileVersion("1.0.5.112")]


Add argument validation to RTF exporter

Add argument validation to RTF exporter

--- Reporting/Exporters/RtfExporter.cs
+++ Reporting/Exporters/RtfExporter.cs
@@ -8,6 +8,7 @@
     using Antlr4.StringTemplate;

     using MatchMaker.Reporting.Models;
+    using MatchMaker.Utilities;

     /// <summary>
     /// Exports the <see cref="Summary"/> results as an RTF file.
@@ -32,6 +33,9 @@
         /// <param name="folder">The output folder</param>
         public void Export(Summary summary, string folder)
         {
+            Arg.NotNull(summary, nameof(summary));
+            Arg.NotNullOrWhiteSpace(folder, nameof(folder));
+
             var template = LoadTemplate();
             template.Add("summary", summary);
             template.Add("teams", GetTeams(summary));


found an extra slash in the code that was removed

--- RingCentral.Test/MessagingTests.cs
+++ RingCentral.Test/MessagingTests.cs
@@ -23,7 +23,7 @@
         private readonly string[] _messageSentValues = {"Sent", "Queued"};

-      \
+
         [Test]
         public void DeleteConversationById()
         {


Fixed version

Fixed version

--- System.Contrib/Properties/AssemblyInfo.cs
+++ System.Contrib/Properties/AssemblyInfo.cs
@@ -37,6 +37,6 @@

 internal static class AssemblyMeta
 {
-	public const string Version = "1.1.0";
+	public const string Version = "1.12.0";
 }


switch auth port to 8580 (#10)

switch auth port to 8580 (#10)

--- SpotifyApi.cs
+++ SpotifyApi.cs
@@ -92,7 +92,7 @@

         public async Task ConnectWebApi()
         {
-            var webApiFactory = new WebAPIFactory("http://localhost", 8000, "3e271cd3f0634b92a991f60601f9db44", Scope.None, TimeSpan.FromSeconds(40));
+            var webApiFactory = new WebAPIFactory("http://localhost", 8580, "3e271cd3f0634b92a991f60601f9db44", Scope.None, TimeSpan.FromSeconds(40));
             _spotifyApi = await webApiFactory.GetWebApi();
         }


Store the WcfOperationContext as an ObjectHandle in the call context to try to avoid serialization issues.

--- WCF/Shared/Implementation/WcfOperationContext.cs
+++ WCF/Shared/Implementation/WcfOperationContext.cs
@@ -1,5 +1,6 @@
 using Microsoft.ApplicationInsights.DataContracts;
 using System;
+using System.Runtime.Remoting;
 using System.Runtime.Remoting.Messaging;
 using System.ServiceModel;
 using System.ServiceModel.Dispatcher;
@@ -155,6 +156,16 @@
             return default(T);
         }

+        //
+        // In the normal case, we'll use the OperationContext
+        // found in the local thread. However, there are cases this won't work:
+        // - When async calls have been done and .NET < 4.6
+        // - Within a *client* side OperationContextScope
+        // To work around this, we store a copy of our context on the
+        // thread's LogicalCallContext, so that it gets moved from thread to thread
+        // Because this field is not serializable, we store an
+        // ObjectHandle instead.
+        //
         public static WcfOperationContext FindContext(OperationContext owner)
         {
             // don't retrieve a context for a client-side OperationContext
@@ -170,7 +181,11 @@
             }
             if ( context == null )
             {
-                context = CallContext.LogicalGetData(CallContextProperty) as WcfOperationContext;
+                var handle = CallContext.LogicalGetData(CallContextProperty) as ObjectHandle;
+                if ( handle != null )
+                {
+                    context = handle.Unwrap() as WcfOperationContext;
+                }
             }
             return context;
         }
@@ -204,7 +219,7 @@
                     context = new WcfOperationContext(owner, PlatformContext.RequestFromHttpContext());
                     owner.Extensions.Add(context);
                     // backup in case we can't get to the server-side OperationContext later
-                    CallContext.LogicalSetData(CallContextProperty, context);
+                    CallContext.LogicalSetData(CallContextProperty, new ObjectHandle(context));
                 }
                 // no server-side OperationContext to attach to
             }


Fix whitespace

Fix whitespace

--- WalletWasabi.Fluent/ViewModels/AboutViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/AboutViewModel.cs
@@ -19,7 +19,7 @@
 		IconName = "info_regular",
 		Order = 4,
 		Category = "General",
-		Keywords = new [] { "About", "Software","Version", "Source", "Code", "Github", "Status", "Stats", "Tor", "Onion", "Bug", "Report", "FAQ","Questions,", "Docs","Documentation", "Link", "Links"," Help" },
+		Keywords = new [] { "About", "Software","Version", "Source", "Code", "Github", "Status", "Stats", "Tor", "Onion", "Bug", "Report", "FAQ", "Questions,", "Docs", "Documentation", "Link", "Links", "Help" },
 		NavBarPosition = NavBarPosition.None)]
 	public partial class AboutViewModel : RoutableViewModel
 	{


Add brackets and .ConfigureAwait(false)

Add brackets and .ConfigureAwait(false)

--- WalletWasabi/WebClients/PayJoin/PayjoinClient.cs
+++ WalletWasabi/WebClients/PayJoin/PayjoinClient.cs
@@ -16,7 +16,7 @@
 {
 	public class PayjoinClient : IPayjoinClient
 	{
-		public PayjoinClient(Uri paymentUrl, EndPoint torSocks5EndPoint)
+		public PayjoinClient(Uri paymentUrl, EndPoint torSocks5EndPoint)
 		{
 			TorSocks5EndPoint = Guard.NotNull(nameof(torSocks5EndPoint), torSocks5EndPoint);
 			PaymentUrl = Guard.NotNull(nameof(paymentUrl), paymentUrl);
@@ -37,13 +37,18 @@
 		{
 			Guard.NotNull(nameof(originalTx), originalTx);
 			if (originalTx.IsAllFinalized())
+			{
 				throw new InvalidOperationException("The original PSBT should not be finalized.");
+			}

 			var sentBefore = -originalTx.GetBalance(ScriptPubKeyType.Segwit, accountKey, rootedKeyPath);
 			var oldGlobalTx = originalTx.GetGlobalTransaction();

 			if (!originalTx.TryGetEstimatedFeeRate(out var originalFeeRate) || !originalTx.TryGetVirtualSize(out var oldVirtualSize))
+			{
 				throw new ArgumentException("originalTx should have utxo information", nameof(originalTx));
+			}
+
 			var originalFee = originalTx.GetFee();
 			var cloned = originalTx.Clone();
 			if (!cloned.TryFinalize(out var _))
@@ -63,16 +68,16 @@
 			}

 			cloned.GlobalXPubs.Clear();
-
+
 			var bpuResponse = await HttpClient.SendAsync(HttpMethod.Post, "",
 				new StringContent(cloned.ToHex(), Encoding.UTF8, "text/plain"), cancellationToken).ConfigureAwait(false);
 			if (!bpuResponse.IsSuccessStatusCode)
 			{
-				var errorStr = await bpuResponse.Content.ReadAsStringAsync();
+				var errorStr = await bpuResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 				try
 				{
 					var error = JObject.Parse(errorStr);
-					throw new PayjoinReceiverException((int)bpuResponse.StatusCode,
+					throw new PayjoinReceiverException((int)bpuResponse.StatusCode,
 						error["errorCode"].Value<string>(),
 						error["message"].Value<string>());
 				}
@@ -84,7 +89,7 @@
 				}
 			}

-			var hexOrBase64 = await bpuResponse.Content.ReadAsStringAsync();
+			var hexOrBase64 = await bpuResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 			var newPSBT = PSBT.Parse(hexOrBase64, originalTx.Network);

 			// Checking that the PSBT of the receiver is clean
@@ -113,7 +118,7 @@
 					newInput.PartialSigs.Clear();
 				}
 			}
-
+
 			// We make sure we don't sign things that should not be signed.
 			foreach (var finalized in newPSBT.Inputs.Where(i => i.IsFinalized()))
 			{
@@ -127,15 +132,22 @@
 				foreach (var originalOutput in originalTx.Outputs)
 				{
 					if (output.ScriptPubKey == originalOutput.ScriptPubKey)
+					{
 						output.UpdateFrom(originalOutput);
+					}
 				}
 			}

 			var newGlobalTx = newPSBT.GetGlobalTransaction();
 			if (newGlobalTx.Version != oldGlobalTx.Version)
+			{
 				throw new PayjoinSenderException("The version field of the transaction has been modified");
+			}
+
 			if (newGlobalTx.LockTime != oldGlobalTx.LockTime)
+			{
 				throw new PayjoinSenderException("The LockTime field of the transaction has been modified");
+			}

 			// Making sure that our inputs are finalized, and that some of our inputs have not been added.
 			int ourInputCount = 0;
@@ -146,9 +158,14 @@
 				{
 					ourInputCount++;
 					if (input.IsFinalized())
+					{
 						throw new PayjoinSenderException("A PSBT input from us should not be finalized");
+					}
+
 					if (newGlobalTx.Inputs[input.Index].Sequence != ourInput.TxIn.Sequence)
+					{
 						throw new PayjoinSenderException("The sequence of one of our input has been modified");
+					}
 				}
 				else
 				{
@@ -162,7 +179,9 @@
 				if (originalTx.Inputs.FindIndexedInput(input.PrevOut) is null)
 				{
 					if (!input.IsFinalized())
+					{
 						throw new PayjoinSenderException("The payjoin receiver included a non finalized input");
+					}
 					// Making sure that the receiver's inputs are finalized and match format
 					var payjoinInputType = input.GetInputScriptPubKeyType();
 					if (payjoinInputType is null || payjoinInputType.Value != ScriptPubKeyType.Segwit)
@@ -176,29 +195,43 @@
 			foreach (var input in newPSBT.Inputs)
 			{
 				if (originalTx.Inputs.FindIndexedInput(input.PrevOut) is null && !input.IsFinalized())
+				{
 					throw new PayjoinSenderException("The payjoin receiver included a non finalized input");
+				}
 			}

 			if (ourInputCount < originalTx.Inputs.Count)
+			{
 				throw new PayjoinSenderException("The payjoin receiver removed some of our inputs");
+			}

 			// We limit the number of inputs the receiver can add
 			var addedInputs = newPSBT.Inputs.Count - originalTx.Inputs.Count;
 			if (originalTx.Inputs.Count < addedInputs)
+			{
 				throw new PayjoinSenderException("The payjoin receiver added too much inputs");
+			}

 			var sentAfter = -newPSBT.GetBalance(ScriptPubKeyType.Segwit, accountKey, rootedKeyPath);
-
+
 			if (sentAfter > sentBefore)
 			{
 				var overPaying = sentAfter - sentBefore;
 				if (!newPSBT.TryGetEstimatedFeeRate(out var newFeeRate) || !newPSBT.TryGetVirtualSize(out var newVirtualSize))
+				{
 					throw new PayjoinSenderException("The payjoin receiver did not included UTXO information to calculate fee correctly");
+				}
+
 				var additionalFee = newPSBT.GetFee() - originalFee;
 				if (overPaying > additionalFee)
+				{
 					throw new PayjoinSenderException("The payjoin receiver is sending more money to himself");
+				}
+
 				if (overPaying > originalFee)
+				{
 					throw new PayjoinSenderException("The payjoin receiver is making us pay more than twice the original fee");
+				}

 				// Let's check the difference is only for the fee and that feerate
 				// did not changed that much
@@ -206,7 +239,9 @@
 				// Signing precisely is hard science, give some breathing room for error.
 				expectedFee += originalFeeRate.GetFee(newPSBT.Inputs.Count * 2);
 				if (overPaying > (expectedFee - originalFee))
+				{
 					throw new PayjoinSenderException("The payjoin receiver increased the fee rate we are paying too much");
+				}
 			}

 			return newPSBT;


update resources

update resources

--- TCC.Core/R.cs
+++ TCC.Core/R.cs
@@ -372,6 +372,7 @@
 		public static SkewTransform Skew45 => ((SkewTransform)App.Current.FindResource("Skew45"));
 		public static SkewTransform Skew45Inv => ((SkewTransform)App.Current.FindResource("Skew45Inv"));
 		public static Storyboard Pulse => ((Storyboard)App.Current.FindResource("Pulse"));
+		public static Storyboard Warn => ((Storyboard)App.Current.FindResource("Warn"));
 		public static FontFamily DroidSans => ((FontFamily)App.Current.FindResource("DroidSans"));
 		public static FontFamily DroidSansMono => ((FontFamily)App.Current.FindResource("DroidSansMono"));
 		public static FontFamily OpenSans => ((FontFamily)App.Current.FindResource("OpenSans"));
@@ -453,6 +454,7 @@
 		public static BooleanInverter BoolInverter => ((BooleanInverter)App.Current.FindResource("BoolInverter"));
 		public static EnumDescriptionConverter EnumDescriptionConverter => ((EnumDescriptionConverter)App.Current.FindResource("EnumDescriptionConverter"));
 		public static NotificationTypeToBrush NotificationTypeToBrush => ((NotificationTypeToBrush)App.Current.FindResource("NotificationTypeToBrush"));
+		public static WarriorStanceToColorConverter StanceToColorConverter => ((WarriorStanceToColorConverter)App.Current.FindResource("StanceToColorConverter"));
 	}
 	public static class DragablzMaterialDesign
 	{


[food.wp] Attempt to fix a bug with the price filter, related to the language-dependent decimal separator and numeric keyboard.

--- Windows/Source/Common.WindowsPhone/Converters.cs
+++ Windows/Source/Common.WindowsPhone/Converters.cs
@@ -66,10 +66,6 @@
     /// <summary>
     /// Converts doubles to strings and vice-versa.
     /// </summary>
-    /// <remarks>
-    /// Needed because WP apparently can't do it; it probably attempts to use the
-    /// current culture even though the keyboard uses a '.' as its decimal separator.
-    /// </remarks>
     public sealed class DoubleToStringConverter : ValueConverter<double, string>
     {
         public override string Convert( double value )
@@ -79,7 +75,15 @@

         public override double ConvertBack( string value )
         {
-            return double.Parse( value, NumberFormatInfo.InvariantInfo );
+            try
+            {
+                return double.Parse( value, NumberFormatInfo.InvariantInfo );
+            }
+            catch
+            {
+                // in case some keyboards use a local separator
+                return double.Parse( value, NumberFormatInfo.CurrentInfo );
+            }
         }
     }


Update version.

Update version.

--- DanTup.DartAnalysis/Properties/AssemblyInfo.cs
+++ DanTup.DartAnalysis/Properties/AssemblyInfo.cs
@@ -8,5 +8,5 @@
 [assembly: AssemblyCopyright("Copyright Danny Tuppeny © 2014")]
 [assembly: ComVisible(false)]
 [assembly: AssemblyVersion("0.1.*")]
-[assembly: AssemblyInformationalVersion("0.1.6-alpha")]
+[assembly: AssemblyInformationalVersion("0.1.7-alpha")]
 [assembly: InternalsVisibleTo("DanTup.DartAnalysis.Tests")]


cleanup

cleanup

--- Harmony/HookInjector.cs
+++ Harmony/HookInjector.cs
@@ -95,7 +95,7 @@
 			else
 				memory = Platform.WriteInt(memory, payloadPtr.ToInt32());
 			memory = Platform.WriteInt(memory, payload.Length);
-			// keep in sync
+			// end keep in sync

 			return memory;
 		}
@@ -111,23 +111,10 @@
 			var source = sourcePtr.ToInt64();
 			var target = targetPtr.ToInt64();

-			Debug.Log("");
-			Debug.Log("Detouring source 0x" + source.ToString("x16") + " to target 0x" + target.ToString("x16") + (isNew ? " (new)" : ""));
-
-			Debug.Log("# Source");
-			Debug.LogBytes(source, 32);
-
-			Debug.Log("# Target");
-			Debug.LogBytes(target, 32);
-
 			long memory;
 			if (isNew)
 			{
 				memory = Platform.GetMemory(totalMemorySize);
-
-				Debug.Log("Memory - created at 0x" + memory.ToString("x16") + " (len " + totalMemorySize + ")");
-				Debug.Log("# Contents");
-				Debug.LogBytes(memory, totalMemorySize);
 			}
 			else
 			{
@@ -137,27 +124,13 @@

 				memory = jmpLoc - prefixBytes; // back up to prefix our extra information

-				Debug.Log("Memory - existing memory found at 0x" + memory.ToString("x16"));
-				Debug.Log("# Contents");
-				Debug.LogBytes(memory, totalMemorySize);
-
 				if (Platform.PeekSequence(memory, magicSignature) == false)
 					throw new FormatException("Expected magic signature '" + Encoding.ASCII.GetString(magicSignature) + "' but did not find it");
 			}

-#if DEBUG
-			var memoryStart = memory;
-#endif
-
 			var jumpLocation = WriteInfoBlock(memory, payload);
-			Debug.Log("Writing intermediate jump to target at 0x" + jumpLocation.ToString("x16"));
 			memory = Platform.WriteJump(jumpLocation, target);
 			Platform.WriteLong(memory, 0);
-
-#if DEBUG
-			Debug.Log("# Contents after detour");
-			Debug.LogBytes(memoryStart, totalMemorySize);
-#endif

 			Platform.WriteJump(source, jumpLocation);
 		}


Run C# part of ComparisonTest using InvariantCulture.

--- Tests/Util.cs
+++ Tests/Util.cs
@@ -11,6 +11,7 @@
 using System.Runtime.Serialization.Json;
 using System.Threading;
 using NUnit.Framework;
+using System.Globalization;

 namespace JSIL.Tests {
     public class JavaScriptException : Exception {
@@ -262,6 +263,7 @@
             var elapsed = new long[3];

             ThreadPool.QueueUserWorkItem((_) => {
+                Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
                 try {
                     outputs[0] = RunCSharp(args, out elapsed[0]).Replace("\r", "").Trim();
                 } catch (Exception ex) {


Flush stdout when swapping streams for test runs.

--- Tests/Util.cs
+++ Tests/Util.cs
@@ -298,9 +298,12 @@
         }

         public string RunCSharp (string[] args, out long elapsed) {
-            var oldStdout = Console.Out;
-            using (var sw = new StringWriter())
-                try {
+            TextWriter oldStdout = null;
+
+            using (var sw = new StringWriter()) {
+                oldStdout = Console.Out;
+                try {
+                    oldStdout.Flush();
                     Console.SetOut(sw);

                     var testMethod = GetTestMethod();
@@ -309,10 +312,12 @@
                     long endedCs = DateTime.UtcNow.Ticks;

                     elapsed = endedCs - startedCs;
+                    sw.Flush();
                     return sw.ToString();
                 } finally {
                     Console.SetOut(oldStdout);
                 }
+            }
         }

         public static Configuration MakeDefaultConfiguration () {


Fixed trombone

Fixed trombone

--- Instruments/Trombone.cs
+++ Instruments/Trombone.cs
@@ -52,6 +52,12 @@
 				if (base.isServerForObject)
 				{
 					this.handPitch = 1f - Mouse.x / Layer.HUD.camera.width * 2f;
+					if (this.handPitch < 0f)
+					{
+						float currentpitch = this.handPitch;
+						float neededpitch = 0f - this.handPitch;
+						this.handPitch = currentpitch + neededpitch;
+					}
 					if (duck.inputProfile.Down("SHOOT"))
 					{
 						this.notePitch = this.handPitch + 0.01f;


ListItem no longers copies the list; changed Dynamic to Object type

--- Items/UIMenuListItem.cs
+++ Items/UIMenuListItem.cs
@@ -9,11 +9,10 @@
     public class UIMenuListItem : UIMenuItem
     {
         protected UIResText _itemText;
-
         protected Sprite _arrowLeft;
         protected Sprite _arrowRight;

-        protected List<dynamic> _items;
+        protected List<object> _items;

         /// <summary>
@@ -39,7 +38,7 @@
         /// <param name="text">Item label.</param>
         /// <param name="items">List that contains your items.</param>
         /// <param name="index">Index in the list. If unsure user 0.</param>
-        public UIMenuListItem(string text, List<dynamic> items, int index)
+        public UIMenuListItem(string text, List<object> items, int index)
             : this(text, items, index, "")
         {
         }
@@ -51,11 +50,11 @@
         /// <param name="items">List that contains your items.</param>
         /// <param name="index">Index in the list. If unsure user 0.</param>
         /// <param name="description">Description for this item.</param>
-        public UIMenuListItem(string text, List<dynamic> items, int index, string description)
+        public UIMenuListItem(string text, List<object> items, int index, string description)
             : base(text, description)
         {
             const int y = 0;
-            _items = new List<dynamic>(items);
+            _items = items;
             _arrowLeft = new Sprite("commonmenu", "arrowleft", new Point(110, 105 + y), new Size(30, 30));
             _arrowRight = new Sprite("commonmenu", "arrowright", new Point(280, 105 + y), new Size(30, 30));
             _itemText = new UIResText("", new Point(290, y + 104), 0.35f, Color.White, Font.ChaletLondon,
@@ -82,9 +81,9 @@
         /// </summary>
         /// <param name="item">Item to search for.</param>
         /// <returns>Item index.</returns>
-        public virtual int ItemToIndex(dynamic item)
+        public virtual int ItemToIndex(object item)
         {
-            return _items.FindIndex(item);
+            return _items.FindIndex(p => ReferenceEquals(p, item));
         }

@@ -93,7 +92,7 @@
         /// </summary>
         /// <param name="index">Item's index.</param>
         /// <returns>Item</returns>
-        public virtual dynamic IndexToItem(int index)
+        public virtual object IndexToItem(int index)
         {
             return _items[index];
         }


Parse throttle speeds in backend tester as sizes.

--- Duplicati/CommandLine/BackendTester/Program.cs
+++ Duplicati/CommandLine/BackendTester/Program.cs
@@ -233,7 +233,7 @@
                         Console.WriteLine("Warning: Throttling is only supported in this tool on streaming backends");
                     }

-                    throttleUpload = long.Parse(throttleUploadString);
+                    throttleUpload = Duplicati.Library.Utility.Sizeparser.ParseSize(throttleUploadString, "kb");
                 }

                 long throttleDownload = 0;
@@ -244,7 +244,7 @@
                         Console.WriteLine("Warning: Throttling is only supported in this tool on streaming backends");
                     }

-                    throttleDownload = long.Parse(throttleDownloadString);
+                    throttleDownload = Duplicati.Library.Utility.Sizeparser.ParseSize(throttleDownloadString, "kb");
                 }

                 if (options.ContainsKey("number-of-files"))


Fix crash in ChatModeCalculatorService and refactor

--- EOLib/Domain/Chat/ChatModeCalculatorService.cs
+++ EOLib/Domain/Chat/ChatModeCalculatorService.cs
@@ -10,19 +10,19 @@
     {
         public ChatMode CalculateChatType(string fullTextString, bool playerIsAdmin, bool playerIsInGuild)
         {
-            if(string.IsNullOrEmpty(fullTextString))
-                throw new ArgumentException("Input string is null or empty!", "fullTextString");
-
-            if ((fullTextString[0] == '@' || fullTextString[0] == '+') && !playerIsAdmin)
-                return ChatMode.Public;
-
-            if (fullTextString[0] == '&' && !playerIsInGuild)
+            if(fullTextString == null)
+                throw new ArgumentException("Input string is null!", "fullTextString");
+
+            if (fullTextString.Length == 0)
+                return ChatMode.NoText;
+            if (((fullTextString[0] == '@' || fullTextString[0] == '+') && !playerIsAdmin) ||
+                (fullTextString[0] == '&' && !playerIsInGuild))
                 return ChatMode.Public;

             switch (fullTextString[0])
             {
                 case '!': return ChatMode.Private;
-                case '@': return ChatMode.Global;
+                case '@':
                 case '~': return  ChatMode.Global;
                 case '+': return ChatMode.Admin;
                 case '\'': return ChatMode.Group;


Fix display while loading for the first time

--- GitDiffMargin/ViewModel/DiffMarginViewModel.cs
+++ GitDiffMargin/ViewModel/DiffMarginViewModel.cs
@@ -90,7 +90,7 @@
         {
             _textView.GotAggregateFocus -= GotAggregateFocus;

-            RefreshDiffViewModelPositions();
+            CreateDiffViewModels();
         }

         private void TextBufferChanged(object sender, TextContentChangedEventArgs e)


add func createUUID()

add func createUUID()

--- ncmb_unity/Assets/NCMB/Script/NCMBUser.cs
+++ ncmb_unity/Assets/NCMB/Script/NCMBUser.cs
@@ -689,9 +689,13 @@
 			this.LogInWithAuthDataAsync (null);
 		}

+		///
+		/// 非同期処理で匿名認証を用いて、ユーザを登録します。

+		///
+		/// <param name="callback">コールバック</param>
 		public void LoginWithAnonymousAsync(NCMBCallback callback)
-        {
-			string randomUUID = System.Guid.NewGuid().ToString();
+		{
+			string randomUUID = createUUID();
 			Dictionary<string, object> param = new Dictionary<string, object>();
 			Dictionary<string, object> anonymousParam = new Dictionary<string, object>() {
 				{ "id",  randomUUID}
@@ -699,24 +703,29 @@
 			param.Add("anonymous", anonymousParam);

 			this.AuthData = param;
-            SignUpAsync((NCMBException error) => {
-                if (error != null)
-                {
-                    // authDataの削除
-                    this.AuthData.Clear();
-                }
-
-                if (callback != null)
-                {
-                    // callbackを実施
-                    callback(error);
-                }
-            });
-        }
-        public void LoginWithAnonymousAsync()
-        {
-            this.LoginWithAnonymousAsync(null);
-        }
+			SignUpAsync((NCMBException error) => {
+				if (error != null)
+				{
+					// authDataの削除
+					this.AuthData.Clear();
+				}
+
+				if (callback != null)
+				{
+					// callbackを実施
+					callback(error);
+				}
+			});
+		}
+
+		///
+		/// 非同期処理で匿名認証を用いて、ユーザを登録します。

+		/// 通信結果が不要な場合はコールバックを指定しないこちらを使用します。
+		///
+		public void LoginWithAnonymousAsync()
+		{
+			this.LoginWithAnonymousAsync(null);
+		}

 		///
 		/// 非同期処理で現在ログインしているユーザに、authDataの追加を行います。

@@ -883,5 +892,9 @@

 			return authData;
 		}
+
+		static String createUUID() {
+			return System.Guid.NewGuid().ToString();
+		}
 	}
 }


/shrug-2

--- TCC.Core/ViewModels/DashboardViewModel.cs
+++ TCC.Core/ViewModels/DashboardViewModel.cs
@@ -710,12 +710,12 @@
             //if (!Game.Logged) return;
             Task.Run(() =>
             {
-                CurrentCharacter.Buffs.Clear();
-                Game.Me.Buffs.ToList().ForEach(b =>
+                CurrentCharacter.Buffs?.Clear();
+                Game.Me.Buffs?.ToList().ForEach(b =>
                 {
                     CurrentCharacter.Buffs.Add(new AbnormalityData { Id = b.Abnormality.Id, Duration = b.DurationLeft, Stacks = b.Stacks });
                 });
-                Game.Me.Debuffs.ToList().ForEach(b =>
+                Game.Me.Debuffs?.ToList().ForEach(b =>
                 {
                     CurrentCharacter.Buffs.Add(new AbnormalityData { Id = b.Abnormality.Id, Duration = b.DurationLeft, Stacks = b.Stacks });
                 });


fix to GetOrAdd

fix to GetOrAdd

--- src/Rocks.Helpers/UrlExtensions.cs
+++ src/Rocks.Helpers/UrlExtensions.cs
@@ -88,31 +88,20 @@

         private static bool TryGetEnumMemberAttr(Type type, string memberName, out EnumMemberAttribute enumMemberAttribute)
         {
-            enumMemberAttribute = null;
+            var key = type.FullName + memberName;
+
+            enumMemberAttribute = enumMemberCache.GetOrAdd(key, _ =>
+            {
+                var member = type.GetMember(memberName);
+                if (member.Length == 0)
+                {
+                    return null;
+                }

-            var key = type.FullName + memberName;
-            if (enumMemberCache.TryGetValue(key, out enumMemberAttribute))
-            {
-                return true;
-            }
+                return member[0].GetCustomAttribute<EnumMemberAttribute>(false);
+            });

-            var member = type.GetMember(memberName);
-            if (member.Length == 0)
-            {
-                return false;
-            }
-
-            var enum_member_attribute = member[0].GetCustomAttribute<EnumMemberAttribute>(false);
-            if (enum_member_attribute != null)
-            {
-                enumMemberCache.TryAdd(key, enum_member_attribute);
-
-                enumMemberAttribute = enum_member_attribute;
-
-                return true;
-            }
-
-            return false;
+            return enumMemberAttribute != null;
         }