configBuilder: pull converters earlier

configBuilder: pull converters earlier

--- src/Stronk/ConfigBuilder.cs
+++ src/Stronk/ConfigBuilder.cs
@@ -49,6 +49,7 @@
 				.Select(args => new
 				{
 					Property = args.Property,
+					Converters = GetValueConverters(availableConverters, args.Property),
 					Value = GetValueFromSource(valueSelectors, args)
 				})
 				.Where(descriptor =>
@@ -69,9 +70,7 @@

 			foreach (var descriptor in values)
 			{
-				var converters = GetValueConverters(availableConverters, descriptor.Property);
-
-				if (converters.Any() == false)
+				if (descriptor.Converters.Any() == false)
 				{
 					WriteLog("Unable to any converters for {typeName} for property {propertyName}", descriptor.Property.Type.Name, descriptor.Property.Name);

@@ -84,7 +83,7 @@
 					continue;
 				}

-				ApplyConversion(availableConverters, converters, target, descriptor.Property, descriptor.Value);
+				ApplyConversion(availableConverters, descriptor.Converters, target, descriptor.Property, descriptor.Value);
 			}
 		}


Simple steps to test first.

Simple steps to test first.

--- source/HelloWorld/Program.cs
+++ source/HelloWorld/Program.cs
@@ -3,6 +3,8 @@
 namespace HelloWorld {
 	public class Program {
 		public static void Main(string[] args) {
+            object x = new string('t', 1);
+            string s = "Test";
 			Console.WriteLine("Hello world!");
 			Console.ReadLine();
 		}


Fixed TimeLimitedCollection.ActiveValuesChanged()

Value coming back was opposite of expected value

--- DataRefresh/TimeLimited/TimeLimitedCollection.cs
+++ DataRefresh/TimeLimited/TimeLimitedCollection.cs
@@ -83,7 +83,7 @@
             Array.Sort(thenSorted);
             I[] nowSorted = nowIdentifiers.ToArray();
             Array.Sort(nowSorted);
-            return thenSorted.SequenceEqual(nowSorted);
+            return !thenSorted.SequenceEqual(nowSorted);
         }

         /// <summary>


Use Peek+Read instead of Read+Unread

Use Peek+Read instead of Read+Unread

--- src/Txt.Core/TextScanner.cs
+++ src/Txt.Core/TextScanner.cs
@@ -186,7 +186,7 @@
             {
                 throw new ObjectDisposedException(nameof(TextScanner));
             }
-            var head = textSource.Read();
+            var head = textSource.Peek();
             var expected = char.ToString(c);
             if (head == -1)
             {
@@ -197,9 +197,9 @@
             var text = char.ToString(next);
             if (c != next)
             {
-                textSource.Unread(next);
                 return MatchResult.FromMismatch(text, expected);
             }
+            textSource.Read();
             Interlocked.Increment(ref offset);
             return MatchResult.FromMatch(text, expected);
         }


Process enabled logic on load

Process enabled logic on load

- Issue MatterHackers/MCCentral#4002
Extruder controls enabled before printer is Connected

--- ActionBar/TemperatureWidgetBase.cs
+++ ActionBar/TemperatureWidgetBase.cs
@@ -111,24 +111,9 @@
 			};
 			container.AddChild(DirectionIndicator);

-			bool isEnabled = printer.Connection.IsConnected;
-
 			printer.Connection.CommunicationStateChanged.RegisterEvent((s, e) =>
 			{
-				if (isEnabled != printer.Connection.IsConnected)
-				{
-					isEnabled = printer.Connection.IsConnected;
-
-					var flowLayout = this.PopupContent.Children.OfType<FlowLayoutWidget>().FirstOrDefault();
-					if (flowLayout != null)
-					{
-						foreach (var child in flowLayout.Children.Except(alwaysEnabled))
-						{
-							child.Enabled = isEnabled;
-						}
-					}
-				}
-
+				enableControls();
 			}, ref unregisterEvents);
 		}

@@ -156,10 +141,38 @@

 		protected virtual void SetTargetTemperature(double targetTemp) { }

+		public override void OnLoad(EventArgs args)
+		{
+			enableControls();
+
+			base.OnLoad(args);
+		}
+
 		public override void OnClosed(ClosedEventArgs e)
 		{
 			unregisterEvents?.Invoke(this, null);
 			base.OnClosed(e);
 		}
+
+		bool? isEnabled = null;
+
+		private void enableControls()
+		{
+			if (isEnabled != printer.Connection.IsConnected)
+			{
+				isEnabled = printer.Connection.IsConnected;
+
+				var flowLayout = this.PopupContent.Children.OfType<FlowLayoutWidget>().FirstOrDefault();
+				if (flowLayout != null)
+				{
+					foreach (var child in flowLayout.Children.Except(alwaysEnabled))
+					{
+						child.Enabled = isEnabled == true;
+					}
+				}
+			}
+		}
+
+
 	}
 }


Makes it so Brain gets properly set when implanted (#8091)

--- UnityProject/Assets/Scripts/Items/Implants/Organs/Brain.cs
+++ UnityProject/Assets/Scripts/Items/Implants/Organs/Brain.cs
@@ -15,6 +15,11 @@
 		}
 		//Ensure removal of brain

+		public override void HealthMasterSet(LivingHealthMasterBase livingHealth)
+		{
+			livingHealth.Setbrain(this);
+		}
+
 		public override void RemovedFromBody(LivingHealthMasterBase livingHealth)
 		{
 			livingHealth.brain = null;


Update the performance manager to link each graph color to the correct value.

--- Xmas-Hell/Xmas-Hell-Core/Performance/PerformanceManager.cs
+++ Xmas-Hell/Xmas-Hell-Core/Performance/PerformanceManager.cs
@@ -1,8 +1,6 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
-using System.Text;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Graphics;
 using MonoGame.Extended;
@@ -27,8 +25,23 @@

     public class PerformanceManager
     {
+        private struct PerformanceStringData
+        {
+            public Color TextColor;
+            public string Text;
+            public Color? DotColor;
+
+            public PerformanceStringData(string text, Color? textColor = null, Color? dotColor = null)
+            {
+                Text = text;
+                TextColor = textColor ?? Color.White;
+                DotColor = dotColor;
+            }
+        }
+
         private XmasHell _game;
-        private StringBuilder _performanceInfo;
+        private List<PerformanceStringData> _performanceInfo;
+        private Vector2 _performanceInfoPosition;
         private FramesPerSecondCounterComponent _fpsCounter;
         private Dictionary<PerformanceStopwatchType, Stopwatch> _stopWatches;
         private Graph _performanceGraph;
@@ -38,19 +51,24 @@
         public PerformanceManager(Game game)
         {
             _game = (XmasHell) game;
-            _performanceInfo = new StringBuilder();
+            _performanceInfo = new List<PerformanceStringData>();
             _stopWatches = new Dictionary<PerformanceStopwatchType, Stopwatch>();
             _maxPerformanceSample = 200;
             _performanceData = new Dictionary<PerformanceStopwatchType, Queue<float>>();
+            _performanceInfoPosition = Vector2.Zero;
         }

         public void Initialize()
         {
             _game.Components.Add(_fpsCounter = new FramesPerSecondCounterComponent(_game));
-            _performanceGraph = new Graph(_game.GraphicsDevice, new Point(GameConfig.VirtualResolution.X, GameConfig.VirtualResolution.Y / 2), _game.ViewportAdapter.GetScaleMatrix());
-            _performanceGraph.Position = new Vector2(0, GameConfig.VirtualResolution.Y);
-            _performanceGraph.Type = Graph.GraphType.Line;
-            _performanceGraph.MaxValue = 16f; // 16ms = 60FPS
+            _performanceGraph = new Graph(_game.GraphicsDevice,
+                new Point(GameConfig.VirtualResolution.X, GameConfig.VirtualResolution.Y / 2),
+                _game.ViewportAdapter.GetScaleMatrix())
+            {
+                Position = new Vector2(0, GameConfig.VirtualResolution.Y),
+                Type = Graph.GraphType.Line,
+                MaxValue = 16f // 16ms = 60FPS
+            };
         }

         public void StartStopwatch(PerformanceStopwatchType type)
@@ -100,22 +118,23 @@
         {
             _performanceInfo.Clear();

-            _performanceInfo.AppendLine($"FPS: {_fpsCounter.FramesPerSecond:0}");
-            _performanceInfo.AppendLine($"Player's bullets: {_game.GameManager.GetPlayerBullets().Count:0}");
-            _performanceInfo.AppendLine($"Boss' bullets: {_game.GameManager.GetBossBullets().Count:0}");
-            _performanceInfo.AppendLine($"Active particles: {_game.GameManager.ParticleManager.ActiveParticlesCount()}");
-
-            if (_stopWatches.ContainsKey(PerformanceStopwatchType.GlobalUpdate))
-                _performanceInfo.AppendLine($"Update time: {_stopWatches[PerformanceStopwatchType.GlobalUpdate].Elapsed.TotalMilliseconds} ms");
-
-            if (_stopWatches.ContainsKey(PerformanceStopwatchType.BossBulletUpdate))
-                _performanceInfo.AppendLine($"  Boss' bullets update time: {_stopWatches[PerformanceStopwatchType.BossBulletUpdate].Elapsed.TotalMilliseconds} ms");
-
-            if (_stopWatches.ContainsKey(PerformanceStopwatchType.CollisionUpdate))
-                _performanceInfo.AppendLine($"  Collision update time: {_stopWatches[PerformanceStopwatchType.CollisionUpdate].Elapsed.TotalMilliseconds} ms");
-
-            if (_stopWatches.ContainsKey(PerformanceStopwatchType.GlobalDraw))
-                _performanceInfo.AppendLine($"Draw time: {_stopWatches[PerformanceStopwatchType.GlobalDraw].Elapsed.TotalMilliseconds} ms");
+            _performanceInfo.Add(new PerformanceStringData($"FPS: {_fpsCounter.FramesPerSecond:0}"));
+            _performanceInfo.Add(new PerformanceStringData($"Player's bullets: {_game.GameManager.GetPlayerBullets().Count:0}"));
+            _performanceInfo.Add(new PerformanceStringData($"Boss' bullets: {_game.GameManager.GetBossBullets().Count:0}"));
+            _performanceInfo.Add(new PerformanceStringData($"Active particles: {_game.GameManager.ParticleManager.ActiveParticlesCount()}"));
+
+            foreach (PerformanceStopwatchType type in Enum.GetValues(typeof(PerformanceStopwatchType)))
+            {
+                if (_stopWatches.ContainsKey(type))
+                {
+                    _performanceInfo.Add(
+                        new PerformanceStringData(
+                            $"{type.ToString()}: {_stopWatches[type].Elapsed.TotalMilliseconds} ms",
+                            Color.White, PerformanceStopwatchTypeToColor(type)
+                        )
+                    );
+                }
+            }
         }

         public void Draw(GameTime gameTime)
@@ -128,9 +147,7 @@
             if (GameConfig.ShowPerformanceGraph)
             {
                 foreach (var performanceData in _performanceData)
-                {
                     _performanceGraph.Draw(performanceData.Value.ToList(), PerformanceStopwatchTypeToColor(performanceData.Key));
-                }
             }
         }

@@ -144,7 +161,32 @@
                     transformMatrix: _game.ViewportAdapter.GetScaleMatrix()
                 );

-                _game.SpriteBatch.DrawString(Assets.GetFont("Graphics/Fonts/main"), _performanceInfo.ToString(), Vector2.Zero, Color.White);
+                var mainFont = Assets.GetFont("Graphics/Fonts/main");
+
+                for (int i = 0; i < _performanceInfo.Count; i++)
+                {
+                    var performanceInfo = _performanceInfo[i];
+                    var textPosition = _performanceInfoPosition;
+
+                    textPosition.Y += mainFont.LineHeight * i;
+
+                    if (performanceInfo.DotColor.HasValue)
+                    {
+                        _game.SpriteBatch.Draw(
+                            Assets.GetTexture2D("pixel"),
+                            new Rectangle(
+                                (int)textPosition.X,
+                                (int)textPosition.Y + (int)(mainFont.LineHeight / 2f) - (20 / 2),
+                                20, 20
+                            ),
+                            null,
+                            performanceInfo.DotColor.Value
+                        );
+                        textPosition.X += 20;
+                    }
+
+                    _game.SpriteBatch.DrawString(mainFont, performanceInfo.Text, textPosition, performanceInfo.TextColor);
+                }

                 _game.SpriteBatch.End();
             }
@@ -156,23 +198,14 @@
             {
               case PerformanceStopwatchType.GlobalUpdate:
                     return Color.Red;
-                    break;
-
                 case PerformanceStopwatchType.GlobalDraw:
                     return Color.Green;
-                    break;
-
                 case PerformanceStopwatchType.BossBulletUpdate:
                     return Color.Orange;
-                    break;
-
                 case PerformanceStopwatchType.CollisionUpdate:
                     return Color.Yellow;
-                    break;
-
                 default:
                     return Color.White;
-                    break;
             }
         }
     }


Guarded with null checks

Guarded with null checks

--- AngleSharp/DOM/MutationObserver.cs
+++ AngleSharp/DOM/MutationObserver.cs
@@ -28,6 +28,9 @@
         [DomConstructor]
         public MutationObserver(MutationCallback callback)
         {
+            if (callback == null)
+                throw new ArgumentNullException("callback");
+
             _records = new Queue<IMutationRecord>();
             _callback = callback;
             _observing = new List<MutationObserving>();
@@ -160,6 +163,8 @@

             if (node == null)
                 return;
+            else if (options == null)
+                options = new MutationObserverInit();

             if (options.IsExaminingOldCharacterData.HasValue == false)
                 options.IsExaminingOldCharacterData = false;
@@ -206,15 +211,19 @@
         [DomName("observe")]
         public void Connect(INode target, IDictionary<String, Object> options)
         {
-            var init = new MutationObserverInit();
-
-            init.AttributeFilters = options.TryGet("attributeFilter") as IEnumerable<String>;
-            init.IsObservingAttributes = options.TryGet<Boolean>("attributes");
-            init.IsObservingChildNodes = options.TryGet<Boolean>("childList") ?? false;
-            init.IsObservingCharacterData = options.TryGet<Boolean>("characterData");
-            init.IsObservingSubtree = options.TryGet<Boolean>("subtree") ?? false;
-            init.IsExaminingOldAttributeValue = options.TryGet<Boolean>("attributeOldValue");
-            init.IsExaminingOldCharacterData = options.TryGet<Boolean>("characterDataOldValue");
+            if (options == null)
+                throw new ArgumentNullException("options");
+
+            var init = new MutationObserverInit
+            {
+                AttributeFilters = options.TryGet("attributeFilter") as IEnumerable<String>,
+                IsObservingAttributes = options.TryGet<Boolean>("attributes"),
+                IsObservingChildNodes = options.TryGet<Boolean>("childList") ?? false,
+                IsObservingCharacterData = options.TryGet<Boolean>("characterData"),
+                IsObservingSubtree = options.TryGet<Boolean>("subtree") ?? false,
+                IsExaminingOldAttributeValue = options.TryGet<Boolean>("attributeOldValue"),
+                IsExaminingOldCharacterData = options.TryGet<Boolean>("characterDataOldValue")
+            };

             Connect(target, init);
         }
@@ -237,7 +246,7 @@

         #region Options

-        class MutationObserving
+        sealed class MutationObserving
         {
             readonly INode _target;
             readonly MutationObserverInit _options;


add jwt token authentication/authorization to user endpoints

--- Api/Controllers/UsersController.cs
+++ Api/Controllers/UsersController.cs
@@ -5,6 +5,7 @@
 using Microsoft.AspNet.Mvc;

 using Api.Models;
+using Api.Auth;

 namespace Api.Controllers
 {
@@ -17,10 +18,54 @@
             _db = new ApiDbContext();
         }

-        [HttpGet]
-        public IActionResult Get()
+        [HttpGet("{id}")]
+        public IActionResult Get(int id)
         {
-            return new ObjectResult(_db.Users);
+            string token = this.Request.Headers["Authorization"];
+            if (token == null)
+                return HttpBadRequest(new { error = "No authorization header" });
+
+            bool isValid = JWTAuth.ValidateToken(token, id);
+            if (!isValid)
+            {
+                this.Response.StatusCode = 403;
+                return new ObjectResult(new { error = "Invalid access token" });
+            }
+
+            User user = _db.Users.FirstOrDefault(u => u.Id == id);
+            return new ObjectResult(new
+            {
+                user.Id,
+                user.Username,
+                user.Firstname,
+                user.Middlename,
+                user.Lastname,
+                user.Age
+            });
+        }
+
+        [HttpPost("login")]
+        public IActionResult Login([FromBody]User user)
+        {
+            if (!ModelState.IsValid)
+            {
+                return HttpBadRequest(ModelState);
+            }
+
+            User _user = _db.Users.FirstOrDefault(
+                u => u.Username == user.Username &&
+                u.Password == user.Password);
+
+            if (_user == null)
+                return new HttpUnauthorizedResult();
+
+            string accessToken = JWTAuth.GenerateToken(_user);
+            return new ObjectResult(new
+            {
+                _user.Id,
+                _user.Username,
+                access_token = accessToken
+            });
         }

         [HttpPost]
@@ -46,7 +91,17 @@
             _db.Users.Add(user);
             _db.SaveChanges();

-            return new ObjectResult(_db.Users);
+            string accessToken = JWTAuth.GenerateToken(user);
+            return new ObjectResult(new
+            {
+                user.Id,
+                user.Username,
+                user.Firstname,
+                user.Middlename,
+                user.Lastname,
+                user.Age,
+                access_token = accessToken
+            });
         }
     }
 }


Make the manager a persistent singleton

Make the manager a persistent singleton

- Add DontDestroyOnLoad
- Add logic to ensure there is only 1 instance running

--- Assets/Plugins/GameJolt/Manager.cs
+++ Assets/Plugins/GameJolt/Manager.cs
@@ -21,11 +21,6 @@
 					{
 						Debug.LogError("An instance of " + typeof(Manager) + " is needed in the scene, but there is none.");
 					}
-					else
-					{
-						DontDestroyOnLoad(instance.gameObject);
-						instance.Configure();
-					}
 				}

 				return instance;
@@ -42,8 +37,32 @@
 		public Objects.User CurrentUser { get; set; }
 		#endregion Fields & Properties

-		#region Config
-		protected void Configure()
+		#region Init
+		void Awake()
+		{
+			if (Persist())
+			{
+				Configure();
+			}
+		}
+
+		bool Persist()
+		{
+			if (instance == null)
+			{
+				instance = this;
+			}
+			else if (instance != this)
+			{
+				Destroy(this.gameObject);
+				return false;
+			}
+
+			DontDestroyOnLoad(this.gameObject);
+			return true;
+		}
+
+		void Configure()
 		{
 			var settings = Resources.Load(Constants.SETTINGS_ASSET_NAME) as Settings;
 			GameID = settings.gameId;
@@ -58,10 +77,10 @@
 			{
 				Debug.LogWarning("Missing Private Key.");
 			}
+		}
+		#endregion Init

-		}
-		#endregion Config
-
+		#region Requests
 		public IEnumerator GetRequest(string url, Core.ResponseFormat format, Action<Core.Response> callback)
 		{
 			float timeout = Time.time + Timeout;
@@ -133,5 +152,6 @@
 			}
 			callback(response);
 		}
+		#endregion Requests
 	}
 }


Clamp player height to ground

Clamp player height to ground

--- Assets/Scripts/PlayerController.cs
+++ Assets/Scripts/PlayerController.cs
@@ -86,6 +86,11 @@
 					airborne = false;
 					goingDown = false;
 					fastFalling = false;
+					transform.position = new Vector3 (
+						transform.position.x,
+						groundHeight,
+						transform.position.z
+					);
 					RefreshAbilities ();
 				} else {
 					fallingSpeed -= fallGravity * fallGravity * Time.fixedDeltaTime;


Updated level generator

Updated level generator

--- Assets/Scripts/QQLevelGenerator.cs
+++ Assets/Scripts/QQLevelGenerator.cs
@@ -1,15 +1,72 @@
 using UnityEngine;
 using System.Collections;
+using System.Collections.Generic;

-public class QQLevelGenerator : MonoBehaviour {
+public class QQLevelGenerator : MonoBehaviour
+{
+	private  Vector3 TILE_POS_OFFSET = new Vector3(0.5f, 0.5f);
+	private TileType[,] tilesArray;
+	private Texture2D textureMap;
+	private int mapWidth, mapHeight;
+	private GameObject tilePrefab;
+	private List<QQTile> tileInstances;

-	// Use this for initialization
-	void Start () {
-
+	public TileType TileTypeAtPosition(Vector3 pos)
+	{
+		return tilesArray[(int)pos.x % mapWidth, (int)pos.y % mapHeight];
+	}
+
+	public void Init (Texture2D texMap, GameObject tile)
+	{
+		textureMap = texMap;
+		tilesArray = QQLevelParser.ParseMap (texMap);
+		mapWidth = textureMap.width;
+		mapHeight = textureMap.height;
+		tilePrefab = tile;
+		tileInstances = new List<QQTile>();
+
+
+	}
+
+	private IEnumerator ColumnGeneratorRoutine()
+	{
+		yield return null;
+	}
+
+	private void GenerateColumn(int columnIndex)
+	{
+		TileType[] typeSettings = new TileType[mapHeight];
+		for (int y = 0; y < mapHeight; y++)
+		{
+			typeSettings[y] = tilesArray[columnIndex % mapWidth, y];
+			tileInstances.Add(QQTile.CreateTile(new Vector2(columnIndex, y), typeSettings[y]));
+		}
 	}

-	// Update is called once per frame
-	void Update () {
-
+	private void GenerateColumns(int startColumnIndex, int count)
+	{
+		for (int i = startColumnIndex; i < startColumnIndex + count; i++)
+			GenerateColumn(i);
+	}
+
+	private void DeleteColumn(int columnIndex)
+	{
+		// Early exit if column tiles don't exist
+		if (columnIndex > (tileInstances.Count / mapHeight))
+			return;
+
+		int removalStartIdx = columnIndex / mapHeight;
+		QQTile[] tiles = new QQTile[mapHeight];
+		for (int i = removalStartIdx; i < mapHeight; i++)
+			tiles[i] = tileInstances[i];
+		tileInstances.RemoveRange(removalStartIdx, mapHeight);
+	}
+
+	private void UpdateTypeArray(Vector2 coordinates, TileType newType)
+	{
+		if (coordinates.x < mapWidth && coordinates.y < mapHeight && coordinates.x > 0f && coordinates.y > 0f)
+		{
+			tilesArray[(int)coordinates.x, (int)coordinates.y] =  newType;
+		}
 	}
 }


Fix build error in Unity2018.2.15f

Fix build error in Unity2018.2.15f

编译android平台包时，Lua_UnityEngine_QualitySettings和Lua_UnityEngine_Texture有报错，原因是有些api设计上只有Editor平台能访问，而SLua接口导出时导出了这些api，所以出包时会编译报错。
[issue #251](https://github.com/pangweiwei/slua/issues/251)

--- Assets/Slua/Editor/CustomExport.cs
+++ Assets/Slua/Editor/CustomExport.cs
@@ -81,6 +81,12 @@
         {
             "UIWidget.showHandles",
             "UIWidget.showHandlesWithMoveTool",
+            "UnityEngine.QualitySettings.get_streamingMipmapsRenderersPerFrame",
+            "UnityEngine.QualitySettings.set_streamingMipmapsRenderersPerFrame",
+            "UnityEngine.QualitySettings.streamingMipmapsRenderersPerFrame",
+            "UnityEngine.Texture.get_imageContentsHash",
+            "UnityEngine.Texture.set_imageContentsHash",
+            "UnityEngine.Texture.imageContentsHash",
         };
         // black list if white list not given
         public static void OnGetNoUseList(out List<string> list)
@@ -178,4 +184,4 @@
             };
         }
     }
-}+}


DebugUtils.CSV now recognizes Vector3/4(d)

--- DebugUtils.cs
+++ DebugUtils.cs
@@ -10,6 +10,7 @@
 #if DEBUG
 using System;
 using System.Linq;
+using System.Text;
 using System.Collections.Generic;
 using System.Diagnostics;
 using UnityEngine;
@@ -20,10 +21,56 @@
 	{
 		public static void CSV(params object[] args)
 		{
-			var row = "tag: ";
-			for(int i = 0; i < args.Length-1; i++) row += "{}, ";
-			row += "{}\n";
-			Utils.Log(row, args);
+			var row = new StringBuilder("tag: ");
+			var len = args.Length;
+			var last_i = len-1;
+			for(int i = 0; i < len; i++)
+			{
+				var arg = args[i];
+				if(arg is Vector3)
+				{
+					var v = (Vector3)arg;
+					row.Append(v.x);
+					row.Append(",");
+					row.Append(v.y);
+					row.Append(",");
+					row.Append(v.z);
+				}
+				else if(arg is Vector3d)
+				{
+					var v = (Vector3d)arg;
+					row.Append(v.x);
+					row.Append(",");
+					row.Append(v.y);
+					row.Append(",");
+					row.Append(v.z);
+				}
+				else if(arg is Vector4)
+				{
+					var v = (Vector4)arg;
+					row.Append(v.x);
+					row.Append(",");
+					row.Append(v.y);
+					row.Append(",");
+					row.Append(v.z);
+					row.Append(",");
+					row.Append(v.w);
+				}
+				else if(arg is Vector4d)
+				{
+					var v = (Vector4d)arg;
+					row.Append(v.x);
+					row.Append(",");
+					row.Append(v.y);
+					row.Append(",");
+					row.Append(v.z);
+					row.Append(",");
+					row.Append(v.w);
+				}
+				else row.Append(arg);
+				if(i < last_i) row.Append(", ");
+			}
+			UnityEngine.Debug.Log(row.ToString());
 		}

 		public static void logVectors(string tag, bool normalize = true, params Vector3[] vecs)


Add some detail for when the SSO token can't be retrieved so it can be captured and fixed.

--- EVEAccount.cs
+++ EVEAccount.cs
@@ -1170,7 +1170,11 @@
                         authCode = HttpUtility.ParseQueryString(resp.ResponseUri.ToString()).Get("code");
                         if (authCode == null)
                         {
-                            responseBody = resp.ResponseUri +
+                            responseBody =
+                                req.RequestUri +
+                                    Environment.NewLine +
+                                    Environment.NewLine +
+                                resp.ResponseUri +
                                     Environment.NewLine +
                                     Environment.NewLine +
                                     Environment.NewLine +


100% coverage

100% coverage

--- Frost/Size.cs
+++ Frost/Size.cs
@@ -3,3 +3,166 @@
 //
 // See LICENSE for more information.

+using System;
+using System.Diagnostics;
+using System.Diagnostics.Contracts;
+
+namespace Frost
+{
+	public struct Size : IEquatable<Size>
+	{
+		private static readonly Size _MinValue;
+		private static readonly Size _MaxValue;
+
+		private static readonly Size _Empty;
+
+		private readonly float _Width;
+		private readonly float _Height;
+
+		static Size()
+		{
+			_MinValue = new Size(float.MinValue);
+			_MaxValue = new Size(float.MaxValue);
+
+			_Empty = new Size(0.0f);
+		}
+
+		public Size(float width, float height)
+		{
+			Trace.Assert(Check.IsFinite(width));
+			Trace.Assert(Check.IsFinite(height));
+
+			this._Width = width;
+			this._Height = height;
+
+			Contract.Assert(Width.Equals(width));
+			Contract.Assert(Height.Equals(height));
+		}
+
+		public Size(float widthHeight) : this(widthHeight, widthHeight)
+		{
+		}
+
+		public float Height
+		{
+			get
+			{
+				Contract.Ensures(Check.IsFinite(Contract.Result<float>()));
+				Contract.Ensures(Contract.Result<float>().Equals(this._Height));
+
+				return this._Height;
+			}
+		}
+
+		public float Width
+		{
+			get
+			{
+				Contract.Ensures(Check.IsFinite(Contract.Result<float>()));
+				Contract.Ensures(Contract.Result<float>().Equals(this._Width));
+
+				return this._Width;
+			}
+		}
+
+		public static Size Empty
+		{
+			get { return _Empty; }
+		}
+
+		public static Size MaxValue
+		{
+			get { return _MaxValue; }
+		}
+
+		public static Size MinValue
+		{
+			get { return _MinValue; }
+		}
+
+		public float Area
+		{
+			get
+			{
+				Contract.Ensures(Check.IsPositive(Contract.Result<float>()));
+
+				return Math.Max(0.0f, this._Width * this._Height);
+			}
+		}
+
+		public Size Transform(ref Matrix3X2 transformation)
+		{
+			Point p1 = new Point(0.0f, 0.0f);
+			Point p2 = new Point(this._Width, 0.0f);
+			Point p4 = new Point(0.0f, this._Height);
+
+			p1 = p1.Transform(ref transformation);
+			p2 = p2.Transform(ref transformation);
+			p4 = p4.Transform(ref transformation);
+
+			return new Size(p1.DistanceTo(p2), p1.DistanceTo(p4));
+		}
+
+		public bool Equals(Size other)
+		{
+			return other._Width.Equals(this._Width) && other._Height.Equals(this._Height);
+		}
+
+		public override bool Equals(object obj)
+		{
+			if(ReferenceEquals(null, obj))
+			{
+				return false;
+			}
+
+			return obj is Size && Equals((Size)obj);
+		}
+
+		public override int GetHashCode()
+		{
+			unchecked
+			{
+				return (this._Width.GetHashCode() * 397) ^ this._Height.GetHashCode();
+			}
+		}
+
+		public static bool operator ==(Size left, Size right)
+		{
+			return left.Equals(right);
+		}
+
+		public static bool operator !=(Size left, Size right)
+		{
+			return !left.Equals(right);
+		}
+
+		public override string ToString()
+		{
+			return string.Format("Width: {0}, Height: {1}", this._Width, this._Height);
+		}
+
+#if(UNIT_TESTING)
+		[Fact] internal static void Test0()
+		{
+			Assert.Equal(0, new Size(0, 1).Width);
+			Assert.Equal(1, new Size(0, 1).Height);
+
+			Assert.Equal(0, Empty.Width);
+			Assert.Equal(0, Empty.Height);
+
+			Assert.Equal(6, new Size(3, 2).Area);
+			Assert.Equal(25, new Size(5).Area);
+			Assert.Equal(0, new Size(-5, 6).Area);
+
+			Matrix3X2 scaling;
+			Matrix3X2.Identity.Scale(2.0f, 2.0f, out scaling);
+
+			Size scaled = new Size(5, 5).Transform(ref scaling);
+
+			Assert.Equal(new Size(10, 10), scaled);
+
+			Assert.TestObject(MinValue, MaxValue);
+		}
+#endif
+	}
+}


Fixed a case where the new T_SYSTEM types were not correctly created

--- src/SME.VHDL/RenderHelper.cs
+++ src/SME.VHDL/RenderHelper.cs
@@ -348,8 +348,8 @@

             if (tvhdl.IsStdLogic)
                 res = string.Format(res, "'0'");
-            else if (tvhdl.IsNumeric)
-                res = string.Format(res, "0");
+            else if (tvhdl.IsSigned || tvhdl.IsUnsigned)
+                res = string.Format(res, tvhdl.ToSafeVHDLName().Substring("T_".Length) + "(0)");

             return res;
         }


Update details page too

Update details page too

--- Commencement.Mvc/Views/Student/DisplayRegistration.cshtml
+++ Commencement.Mvc/Views/Student/DisplayRegistration.cshtml
@@ -118,7 +118,7 @@

-                        How To Say Your Name Phonetically:
+                        How to Pronounce Your Name:
                         @Html.DisplayFor(x => x.Registration.Phonetic)


fixes #4003 (examine-spriteview is rotated)

--- Content.Client/GameObjects/EntitySystems/ExamineSystem.cs
+++ Content.Client/GameObjects/EntitySystems/ExamineSystem.cs
@@ -84,7 +84,7 @@
             vBox.AddChild(hBox);
             if (entity.TryGetComponent(out ISpriteComponent? sprite))
             {
-                hBox.AddChild(new SpriteView {Sprite = sprite});
+                hBox.AddChild(new SpriteView {Sprite = sprite, OverrideDirection = Direction.South});
             }

             hBox.AddChild(new Label


Fix handheld radio not accounting for obstructions

Fixes #4356

--- Content.Server/Radio/Components/HandheldRadioComponent.cs
+++ Content.Server/Radio/Components/HandheldRadioComponent.cs
@@ -3,6 +3,7 @@
 using Content.Server.Radio.EntitySystems;
 using Content.Shared.Examine;
 using Content.Shared.Interaction;
+using Content.Shared.Interaction.Helpers;
 using Content.Shared.Notification;
 using Content.Shared.Notification.Managers;
 using Robust.Shared.GameObjects;
@@ -80,8 +81,7 @@
         public bool CanListen(string message, IEntity source)
         {
             return RadioOn &&
-                   Owner.Transform.Coordinates.TryDistance(Owner.EntityManager, source.Transform.Coordinates, out var distance) &&
-                   distance <= ListenRange;
+                   Owner.InRangeUnobstructed(source.Transform.Coordinates, range: ListenRange);
         }

         public void Receive(string message, int channel, IEntity speaker)


Fix bug where build items that reference a dependency that reference another build item got mistakenly added to the set of objects to reload from disk.

--- ZocBuild.Database/DependencyWalking/DatabaseStateWalker.cs
+++ ZocBuild.Database/DependencyWalking/DatabaseStateWalker.cs
@@ -131,20 +131,20 @@
                     && !databaseObjectsToRebuild.Contains(s.Value))
                 {
                     databaseObjectsToRebuild.Add(s.Value);
-                    AddAllReferences(s.Value, dbState, databaseObjectsToRebuild);
+                    AddAllReferences(s.Value, dbState, databaseObjectsToRebuild, isBuildItem);
                 }
             }
             return databaseObjectsToRebuild;
         }

-        private static void AddAllReferences(TypedDatabaseObject objectToSearch, IDictionary<TypedDatabaseObject, GraphNode> dependencyGraph, ISet<TypedDatabaseObject> set)
+        private static void AddAllReferences(TypedDatabaseObject objectToSearch, IDictionary<TypedDatabaseObject, GraphNode> dependencyGraph, ISet<TypedDatabaseObject> set, Func<TypedDatabaseObject, bool> excludeFromSet)
         {
             var references = dependencyGraph[objectToSearch].ReferencedBy;
-            var toAdd = references.Where(x => !set.Contains(x));
+            var toAdd = references.Where(x => !set.Contains(x) && !excludeFromSet(x));
             foreach (var r in toAdd)
             {
                 set.Add(r);
-                AddAllReferences(r, dependencyGraph, set);
+                AddAllReferences(r, dependencyGraph, set, excludeFromSet);
             }
         }


ボス戦でもグレイズ判定が生きるよう実装

ボス戦でもグレイズ判定が生きるよう実装


Updated Interface

Updated Interface

--- EmotionalGUI/Framework/DatabaseInterface/IDatabaseArgs.cs
+++ EmotionalGUI/Framework/DatabaseInterface/IDatabaseArgs.cs
@@ -18,6 +18,13 @@
         /// <param name="minValueEmotionSpaceDTO"></param>
         /// <param name="maxValueEmotionSpaceDTO"></param>
         /// <returns></returns>
-        string[] getSongWithConstraints(int numberOfSongs, EmotionSpaceDTO minValueEmotionSpaceDTO, EmotionSpaceDTO maxValueEmotionSpaceDTO);
+        string[] getSongithConstraints(int numberOfSongs, EmotionSpaceDTO minValueEmotionSpaceDTO, EmotionSpaceDTO maxValueEmotionSpaceDTO);
+
+        /// <summary>
+        /// Adds a song to the database
+        /// </summary>
+        /// <param name="songpath">The location of the song</param>
+        /// <param name="emotionSpaceDTO">The coordinates in the emotionspace</param>
+        void addSongToDatabase(string songpath, EmotionSpaceDTO emotionSpaceDTO);
     }
 }


Refactoring

Refactoring

--- AutoAdapter.Fody/AdapterFactory.cs
+++ AutoAdapter.Fody/AdapterFactory.cs
@@ -75,9 +75,7 @@
             var resolvedDestinationType = request.DestinationType.Resolve();

             var resolvedSourceType = request.SourceType.Resolve();
-
-            var resolvedExtraParametersType = request.ExtraParametersType.Chain(x => x.Resolve());
-
+
             foreach (var targetMethod in resolvedDestinationType.Methods)
             {
                 var methodOnAdapter =
@@ -111,7 +109,7 @@
                     .ToList()
                     .ForEach(parameters =>
                     {
-                        var instructions = CreateInstructionsForArgument(request, extraParametersField, parameters, ilProcessor, resolvedExtraParametersType);
+                        var instructions = CreateInstructionsForArgument(request, extraParametersField, parameters, ilProcessor);

                         ilProcessor.AppendRange(instructions);
                     });
@@ -130,8 +128,7 @@
             AdaptationRequestInstance request,
             Maybe<FieldDefinition> extraParametersField,
             SourceAndTargetParameters parameters,
-            ILProcessor ilProcessor,
-            Maybe<TypeDefinition> resolvedExtraParametersType)
+            ILProcessor ilProcessor)
         {
             if (parameters.TargetParameter.HasValue)
                 return CreateInstructionsForArgumentUsingTargetParameter(
@@ -144,7 +141,6 @@
                     ilProcessor,
                     request,
                     extraParametersField,
-                    resolvedExtraParametersType,
                     parameters);
             }

@@ -220,9 +216,10 @@
             ILProcessor ilProcessor,
             AdaptationRequestInstance request,
             Maybe<FieldDefinition> extraParametersField,
-            Maybe<TypeDefinition> resolvedExtraParametersType,
             SourceAndTargetParameters parameters)
         {
+            var resolvedExtraParametersType = request.ExtraParametersType.Chain(x => x.Resolve());
+
             var instructions = new List<Instruction>();

             instructions.Add(ilProcessor.Create(OpCodes.Ldarg_0));


Update fill logs to include broker ids

Update fill logs to include broker ids

--- Engine/TransactionHandlers/BrokerageTransactionHandler.cs
+++ Engine/TransactionHandlers/BrokerageTransactionHandler.cs
@@ -105,7 +105,13 @@
             _brokerage.OrderStatusChanged += (sender, fill) =>
             {
                 // log every fill in live mode
-                if (algorithm.LiveMode) Log.Trace("BrokerageTransactionHandler.OrderStatusChanged(): " + fill);
+                if (algorithm.LiveMode)
+                {
+                    var brokerIds = string.Empty;
+                    var order = GetOrderById(fill.OrderId);
+                    if (order != null && order.BrokerId.Count > 0) brokerIds = string.Join(", ", order.BrokerId);
+                    Log.Trace("BrokerageTransactionHandler.OrderStatusChanged(): " + fill + " BrokerId: " + brokerIds);
+                }

                 HandleOrderEvent(fill);
             };


Signed-off-by: qianqians <anxiangqq@gmail.com>

--- common/component/gate/gate/client_msg_handle.cs
+++ common/component/gate/gate/client_msg_handle.cs
@@ -35,7 +35,9 @@

 				_logicproxy.client_disconnect (uuid);
 			}
-		}
+
+            _clientmanager.unreg_client(juggle.Imodule.current_ch);
+        }

 		public void forward_client_call_logic(string module, string func, ArrayList argv)
 		{


Simplify thumbnail activation code (more efficient Task call)

--- Eve-O-Preview/Services/Implementation/ThumbnailManager.cs
+++ Eve-O-Preview/Services/Implementation/ThumbnailManager.cs
@@ -396,14 +396,13 @@
 				{
 					this._windowManager.ActivateWindow(view.Id);
 				})
-				.ConfigureAwait(true)
-				.GetAwaiter()
-				.OnCompleted(() =>
-				{
+				.ContinueWith((task) =>
+				{
+					// This code should be executed on UI thread
 					this.SwitchActiveClient(view.Id, view.Title);
 					this.UpdateClientLayouts();
 					this.RefreshThumbnails();
-				});
+				}, TaskScheduler.FromCurrentSynchronizationContext());
 		}

 		private void ThumbnailDeactivated(IntPtr id, bool switchOut)
@@ -683,9 +682,9 @@
 		}

 		// Quick sanity check that the window is not minimized
-		private bool IsValidWindowPosition(int letf, int top, int width, int height)
-		{
-			return (letf > ThumbnailManager.WINDOW_POSITION_THRESHOLD_LOW) && (letf < ThumbnailManager.WINDOW_POSITION_THRESHOLD_HIGH)
+		private bool IsValidWindowPosition(int left, int top, int width, int height)
+		{
+			return (left > ThumbnailManager.WINDOW_POSITION_THRESHOLD_LOW) && (left < ThumbnailManager.WINDOW_POSITION_THRESHOLD_HIGH)
 					&& (top > ThumbnailManager.WINDOW_POSITION_THRESHOLD_LOW) && (top < ThumbnailManager.WINDOW_POSITION_THRESHOLD_HIGH)
 					&& (width > ThumbnailManager.WINDOW_SIZE_THRESHOLD) && (height > ThumbnailManager.WINDOW_SIZE_THRESHOLD);
 		}


[Core] Issue #58. Win32RegistryUtilities documentation

--- Bam.Core/Win32RegistryUtilities.cs
+++ Bam.Core/Win32RegistryUtilities.cs
@@ -29,6 +29,9 @@
 #endregion // License
 namespace Bam.Core
 {
+    /// <summary>
+    /// Static utility class for all Windows registry methods.
+    /// </summary>
     public static class Win32RegistryUtilities
     {
         private static string Wow6432NodeString = @"Wow6432Node";
@@ -92,6 +95,11 @@
             return exists;
         }

+        /// <summary>
+        /// Query if the current user software key at the provided path exists?
+        /// </summary>
+        /// <returns><c>true</c>, if CU software key exist was doesed, <c>false</c> otherwise.</returns>
+        /// <param name="path">Path.</param>
         public static bool
         DoesCUSoftwareKeyExist(
             string path)
@@ -100,6 +108,11 @@
             return exists;
         }

+        /// <summary>
+        /// Does the 32-bit local machine software key at the provided path exists?
+        /// </summary>
+        /// <returns><c>true</c>, if bit LM software key exist was does32ed, <c>false</c> otherwise.</returns>
+        /// <param name="path">Path.</param>
         public static bool
         Does32BitLMSoftwareKeyExist(
             string path)
@@ -128,6 +141,11 @@
             return key;
         }

+        /// <summary>
+        /// Open the 32-bit local machine software key specified by the path.
+        /// </summary>
+        /// <returns>The bit LM software key.</returns>
+        /// <param name="path">Path.</param>
         public static Microsoft.Win32.RegistryKey
         Open32BitLMSoftwareKey(
             string path)
@@ -135,6 +153,11 @@
             return OpenSoftwareKey(path, Microsoft.Win32.Registry.LocalMachine, true);
         }

+        /// <summary>
+        /// Open the current user software key specified by the path.
+        /// </summary>
+        /// <returns>The CU software key.</returns>
+        /// <param name="path">Path.</param>
         public static Microsoft.Win32.RegistryKey
         OpenCUSoftwareKey(
             string path)
@@ -142,6 +165,11 @@
             return OpenSoftwareKey(path, Microsoft.Win32.Registry.CurrentUser, false);
         }

+        /// <summary>
+        /// Does the local machine software key exist at the path?
+        /// </summary>
+        /// <returns><c>true</c>, if LM software key exist was doesed, <c>false</c> otherwise.</returns>
+        /// <param name="path">Path.</param>
         public static bool
         DoesLMSoftwareKeyExist(
             string path)
@@ -150,6 +178,11 @@
             return exists;
         }

+        /// <summary>
+        /// Open the local machine software key at the path.
+        /// </summary>
+        /// <returns>The LM software key.</returns>
+        /// <param name="path">Path.</param>
         public static Microsoft.Win32.RegistryKey
         OpenLMSoftwareKey(
             string path)


Some minor changes around exception details

--- Bddify/Reporters/HtmlReport.cshtml
+++ Bddify/Reporters/HtmlReport.cshtml
@@ -186,6 +186,11 @@
 				cursor:pointer;
 				font-weight: bold;
 				color: Maroon;
+			}
+
+			.exceptionDetails
+			{
+			    color:Maroon;
 			}

 			th.scenarioHeader
@@ -416,22 +421,23 @@
                   @foreach (var step in scenario.Steps) {
                     string stepClass = string.Empty;
                     string result = step.ReadableMethodName;
+                    var rowSpan = 1;
                     if(step.Exception != null){
                       stepClass = "hasException";
+                      rowSpan = 2;

                       if(!string.IsNullOrEmpty(step.Exception.Message)){
                           result += " [Exception Message: '" + step.Exception.Message + "']";
                       }
                     }

-
+

 										  @result

                     if (step.Exception != null) {
-

-
+

 										  @step.Exception.StackTrace
@@ -441,11 +447,7 @@

-
-

-
-

-                            }
+                }
               }


More improvement on HtmlReport: added exception message and stack trace to the steps

--- Bddify/Reporters/HtmlReport.cshtml
+++ Bddify/Reporters/HtmlReport.cshtml
@@ -8,7 +8,6 @@
 			{
 				margin:auto;
 				width:80%;
-				height:100%;
 				background-color:#a0a0e0;
 			}

@@ -20,7 +19,7 @@
 			#header
 			{
 				padding:10px;
-				height:100px;
+				height:60px;
 				background-color:#555555;
 				color:White;
 			}
@@ -173,25 +172,43 @@

 						@foreach (var assembly in Model.GroupBy(b => b.Object.GetType().Assembly.CodeBase)) {

-								Assembly: @assembly.Key
+								Assembly: @assembly.Key

 							foreach (var group in assembly.GroupBy(b => b.Object.GetType().Namespace)){

-									Class: @group.Key
+									Class: @group.Key

 								foreach (var bddee in group) {

 										@bddee.Duration.Milliseconds (ms)
-										@bddee.ScenarioSentence
+										@bddee.ScenarioSentence
 										@bddee.Result

 									foreach (var step in bddee.Steps) {
-

-
-										@step.ReadableMethodName
-										@step.Result
-

+                                        string stepClass = "step " + bddee.Object.GetType().Name;
+                                        string result = step.ReadableMethodName;
+                                        if(step.Exception != null){
+                                            stepClass += " hasException";
+
+                                            if(!string.IsNullOrEmpty(step.Exception.Message)){
+                                                result += " (" + step.Exception.Message + ")";
+                                            }
+                                        }
+
+

+
+										    @result
+										    @step.Result
+

+
+                                        if (step.Exception != null){
+

+
+
+										        @step.Exception.StackTrace
+

+                                        }
 									}


more transient work

more transient work

--- Facade/NakedObjects.Facade.Impl/Facade/FrameworkFacade.cs
+++ Facade/NakedObjects.Facade.Impl/Facade/FrameworkFacade.cs
@@ -568,13 +568,10 @@
             return oc.ToObjectContextFacade(this, framework);
         }

-        private ObjectContextFacade SetObject(INakedObjectAdapter nakedObject, ArgumentsContextFacade arguments) {
-            if (((IObjectSpec) nakedObject.Spec).Properties.OfType<IOneToOneAssociationSpec>().Any(p => !arguments.Values.Keys.Contains(p.Id))) {
-                throw new BadRequestNOSException("Malformed arguments");
-            }
+        private ObjectContextFacade SetTransientObject(INakedObjectAdapter nakedObject, ArgumentsContextFacade arguments) {

             Dictionary<string, PropertyContext> contexts = arguments.Values.ToDictionary(kvp => kvp.Key, kvp => CanSetProperty(nakedObject, kvp.Key, kvp.Value));
-            var objectContext = new ObjectContext(contexts.First().Value.Target) {VisibleProperties = contexts.Values.ToArray()};
+            var objectContext = new ObjectContext(contexts.First().Value.Target) { VisibleProperties = contexts.Values.ToArray() };

             // if we fail we need to display all - if OK only those that are visible
             PropertyContext[] propertiesToDisplay = objectContext.VisibleProperties;
@@ -590,9 +587,9 @@
                         else {
                             framework.Persistor.ObjectChanged(nakedObject, framework.LifecycleManager, framework.MetamodelManager);
                         }
-                        propertiesToDisplay = ((IObjectSpec) nakedObject.Spec).Properties.
+                        propertiesToDisplay = ((IObjectSpec)nakedObject.Spec).Properties.
                             Where(p => p.IsVisible(nakedObject)).
-                            Select(p => new PropertyContext {Target = nakedObject, Property = p}).ToArray();
+                            Select(p => new PropertyContext { Target = nakedObject, Property = p }).ToArray();
                     }
                 }
             }
@@ -601,6 +598,15 @@
             oc.Reason = objectContext.Reason;
             oc.VisibleProperties = propertiesToDisplay;
             return oc.ToObjectContextFacade(this, framework);
+        }
+
+        private ObjectContextFacade SetObject(INakedObjectAdapter nakedObject, ArgumentsContextFacade arguments) {
+            // this is for ProtoPersistents where the arguments must contain all values
+            // for standard transients the object may already have values set so no need to check
+            if (((IObjectSpec) nakedObject.Spec).Properties.OfType<IOneToOneAssociationSpec>().Any(p => !arguments.Values.Keys.Contains(p.Id))) {
+                throw new BadRequestNOSException("Malformed arguments");
+            }
+            return SetTransientObject(nakedObject, arguments);
         }

         private bool ValidateParameters(ActionContext actionContext, IDictionary<string, object> rawParms) {
@@ -1020,7 +1026,7 @@
         private ObjectContextFacade PersistTransientObject(IObjectFacade transient, ArgumentsContextFacade arguments) {

             INakedObjectAdapter nakedObject = transient.WrappedAdapter();
-            return SetObject(nakedObject, arguments);
+            return SetTransientObject(nakedObject, arguments);
         }


code improvement

code improvement

--- BookmarksManager/BookmarkFolder.cs
+++ BookmarksManager/BookmarkFolder.cs
@@ -34,7 +34,7 @@
         /// </summary>
         public IEnumerable<BookmarkFolder> AllFolders
         {
-            get { return AllItems.OfType<BookmarkFolder>(); }
+            get { return this.GetAllItems<BookmarkFolder>(); }
         }

         public BookmarkFolder()


Move check if message came from second bot to method

--- FineBot/FineBot.BotRunner/Responders/SeconderResponder.cs
+++ FineBot/FineBot.BotRunner/Responders/SeconderResponder.cs
@@ -27,8 +27,8 @@
         {
             return !context.BotHasResponded
                    && context.Message.Text.ToLower().StartsWith("seconded")
-                   && context.UserNameCache.ContainsKey(context.Message.User.ID)
-                   && !context.UserNameCache[context.Message.User.ID].Equals("finebotssecondcousin");
+                   && context.UserNameCache.ContainsKey(context.Message.User.ID)
+                   && !context.IsMessageFromUser("finebotssecondcousin");
         }

         public BotMessage GetResponse(ResponseContext context)


Remove version update check

Remove version update check

--- Brofiler/TimeLine/TimeLine.xaml.cs
+++ Brofiler/TimeLine/TimeLine.xaml.cs
@@ -35,11 +35,24 @@
     /// </summary>
     public partial class TimeLine : UserControl
     {
+        /// <summary>
+        /// Storage for all the collected frames
+        /// </summary>
         FrameCollection frames = new FrameCollection();
+
+        /// <summary>
+        /// Message receiving thread
+        /// </summary>
         Thread socketThread = null;

+        /// <summary>
+        /// Internal syncing object
+        /// </summary>
         Object criticalSection = new Object();

+        /// <summary>
+        /// This web-client is used to check online for the availability of a new version
+        /// </summary>
         WebClient checkVersion;

         public TimeLine()
@@ -67,7 +80,9 @@

         void TimeLine_Loaded(object sender, RoutedEventArgs e)
         {
-            checkVersion = new WebClient();
+            // Do not execute the version check as long as we don't have a new location
+            // to check for one
+            /*checkVersion = new WebClient();

             checkVersion.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
             checkVersion.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnVersionDownloaded);
@@ -79,8 +94,7 @@
             catch (Exception ex)
             {
                 Debug.Print(ex.Message);
-            }
-
+            }*/
         }

         void OnVersionDownloaded(object sender, DownloadStringCompletedEventArgs e)


Fixes

Fixes

--- GlobalEvents/GlobalEvents/Controllers/EventsController.cs
+++ GlobalEvents/GlobalEvents/Controllers/EventsController.cs
@@ -101,17 +101,21 @@
             if (Roles.IsUserInRole(WebSecurity.CurrentUserName, "Admin"))
                 events = EventsService.ObtenerEventos(id, true, true).FirstOrDefault();
             else
-            {
                 events = EventsService.ObtenerEventos(id, false, true).Where(c => c.IdUser == WebSecurity.CurrentUserId).FirstOrDefault();
-            }

-
             if (events == null)
                 return Errores.MostrarError(DatosErrores.ErrorParametros);

-            if (events.Estado == EventState.Pendiente_De_Aprobacion &&
-                (events.IdUser != WebSecurity.CurrentUserId && !Roles.IsUserInRole(WebSecurity.CurrentUserName, "Admin")))
-                return Errores.MostrarError(DatosErrores.Permisos);
+            if (events.Estado == EventState.Pendiente_De_Aprobacion)
+            {
+                if (events.IdUser != WebSecurity.CurrentUserId)
+                {
+                    if (!Roles.IsUserInRole(WebSecurity.CurrentUserName, "Admin"))
+                    {
+                        return Errores.MostrarError(DatosErrores.Permisos);
+                    }
+                }
+            }

             EventViewModel.EventModel EventModel = new EventViewModel.EventModel();
             EventViewModel.EventVM model = new EventViewModel.EventVM();
@@ -201,44 +205,53 @@
         {
             if (ModelState.IsValid)
             {
-                // Se pueden hacer 3 eventos por día.
-                // Se pueden hacer 10 comentarios por día.
-                int CantidadEventosEnDia = EventsService.ObtenerEventos(WebSecurity.CurrentUserId)
-                    .Where(z => z.FechaCreacion.Year == DateTime.Now.Year)
-                    .Where(z => z.FechaCreacion.Month == DateTime.Now.Month)
-                    .Where(z => z.FechaCreacion.Day == DateTime.Now.Day)
-                    .Count();
-                if (CantidadEventosEnDia < 3)
-                {
-                    TimeSpan Inicio = TimeSpan.Parse(HoraInicio);
-                    TimeSpan Fin = TimeSpan.Parse(HoraFin);
-
-                    Events evento = new Events()
-                    {
-                        Descripcion = events.Descripcion,
-                        Direccion = events.Direccion,
-                        FechaCreacion = DateTime.Now,
-                        FechaFin = events.FechaFin,
-                        FechaInicio = events.FechaInicio,
-                        IdCategoria = events.IdCategoria,
-                        IdUser = WebSecurity.CurrentUserId,
-                        lat = events.lat,
-                        lng = events.lng,
-                        RutaImagen = events.RutaImagen,
-                        HoraFin = events.HoraFin,
-                        HoraInicio = events.HoraInicio,
-                        NombreEvento = events.NombreEvento,
-                        Estado = Rolls.ObtenerEstadoEventoPorUsuario(WebSecurity.CurrentUserId) ?
-                                    EventState.Habilitado :
-                                    EventState.Pendiente_De_Aprobacion,
+                events.FechaInicio = events.FechaInicio + TimeSpan.Parse(HoraInicio);
+                events.FechaFin = events.FechaFin + TimeSpan.Parse(HoraFin);
+                if (events.FechaInicio < DateTime.Now || events.FechaFin <= events.FechaInicio)
+                {
+                    ModelState.AddModelError("", "Error en las fechas seleccionadas, el evento debe crearse al menos el día anterior.");
+                }
+                else
+                {
+                    // Se pueden hacer 3 eventos por día.
+                    // Se pueden hacer 10 comentarios por día.
+                    int CantidadEventosEnDia = EventsService.ObtenerEventos(WebSecurity.CurrentUserId)
+                        .Where(z => z.FechaCreacion.Year == DateTime.Now.Year)
+                        .Where(z => z.FechaCreacion.Month == DateTime.Now.Month)
+                        .Where(z => z.FechaCreacion.Day == DateTime.Now.Day)
+                        .Count();
+                    if (CantidadEventosEnDia < 3)
+                    {
+                        TimeSpan Inicio = TimeSpan.Parse(HoraInicio);
+                        TimeSpan Fin = TimeSpan.Parse(HoraFin);
+
+                        Events evento = new Events()
+                        {
+                            Descripcion = events.Descripcion,
+                            Direccion = events.Direccion,
+                            FechaCreacion = DateTime.Now,
+                            FechaFin = events.FechaFin,
+                            FechaInicio = events.FechaInicio,
+                            IdCategoria = events.IdCategoria,
+                            IdUser = WebSecurity.CurrentUserId,
+                            lat = events.lat,
+                            lng = events.lng,
+                            RutaImagen = events.RutaImagen,
+                            HoraFin = events.HoraFin,
+                            HoraInicio = events.HoraInicio,
+                            NombreEvento = events.NombreEvento,
+                            Estado = Rolls.ObtenerEstadoEventoPorUsuario(WebSecurity.CurrentUserId) ?
+                                        EventState.Habilitado :
+                                        EventState.Pendiente_De_Aprobacion,
                             Destacado = Rolls.ObtenerSiEventoEsDestacado(WebSecurity.CurrentUserId)
                         };

-                    EventsService.Create(evento, file);
-                    return RedirectToAction("Details", "Events", new { id = EventsService.ObtenerEventos(WebSecurity.CurrentUserId).Max(z => z.Id) });
-                }
-                else
-                    ModelState.AddModelError("", "Has llegado al límite para crear de 3 eventos por día.");
+                        EventsService.Create(evento, file);
+                        return RedirectToAction("Details", "Events", new { id = EventsService.ObtenerEventos(WebSecurity.CurrentUserId).Max(z => z.Id) });
+                    }
+                    else
+                        ModelState.AddModelError("", "Has llegado al límite para crear de 3 eventos por día.");
+                }
             }

             return View(events);