Minor Mori4Game/character data changes

Minor Mori4Game/character data changes

Some more fields in the character data figured out (certain flags,
status ailments, available skill points)

--- EO4SaveEdit/FileHandlers/Mori4Game.cs
+++ EO4SaveEdit/FileHandlers/Mori4Game.cs
@@ -8,6 +8,19 @@

 namespace EO4SaveEdit.FileHandlers
 {
+    [Flags]
+    public enum BaseFlags : byte
+    {
+        Bit0 = 0x01,
+        InParty = 0x02,
+        Bit2 = 0x04,
+        Bit3 = 0x08,
+        Bit4 = 0x10,
+        IsGuildCardCharacter = 0x20,
+        Bit6 = 0x40,
+        Bit7 = 0x80
+    }
+
     public enum Class : byte
     {
         Landsknecht = 0x00,
@@ -22,6 +35,29 @@
         Imperial = 0x09,

         None = 0xFF
+    }
+
+    [Flags]
+    public enum StatusAilments : ushort
+    {
+        None = 0x0000,
+
+        Dead = 0x0001,
+        Petrified = 0x0002,
+        Asleep = 0x0004,
+        Panicked = 0x0008,
+        Bit4 = 0x0010,
+        Poisoned = 0x0020,
+        Blindness = 0x0040,
+        Cursed = 0x0080,
+        Paralyzed = 0x0100,
+        Bit9 = 0x0200,
+        HeadBind = 0x0400,
+        ArmBind = 0x0800,
+        LegBind = 0x1000,
+        Bit13 = 0x2000,
+        Bit14 = 0x4000,
+        Bit15 = 0x8000
     }

     public enum ForgeEffect : byte
@@ -163,13 +199,13 @@

         int nameLength, guildNameLength;

-        public byte Unknown1 { get; set; }
+        public BaseFlags BaseFlags { get; set; }
         public byte Portrait { get; set; }
         public byte ID { get; set; }
         public byte Level { get; set; }
         public Class Class { get; set; }
         public Class Subclass { get; set; }
-        public ushort Unknown2 { get; set; }
+        public StatusAilments StatusAilments { get; set; }
         public Item WeaponSlot { get; set; }
         public Item EquipmentSlot { get; set; }
         public Item ArmorSlot1 { get; set; }
@@ -189,8 +225,9 @@
         public ushort CurrentTP { get; set; }
         public uint CurrentEXP { get; set; }
         byte[] name;
-        public ushort Unknown8 { get; set; }
-        public ushort UnknownTotalSkillPoints { get; set; }
+        public ushort NamePadding { get; set; }
+        public byte UnknownTotalSkillPoints { get; set; }
+        public byte AvailableSkillPoints { get; set; }
         public byte[] MainSkillLevels { get; set; }
         public byte[] SubSkillLevels { get; set; }
         public ushort Unknown9 { get; set; }
@@ -246,13 +283,13 @@
                 guildNameLength = GuildNameLengthJpn;
             }

-            Unknown1 = reader.ReadByte();
+            BaseFlags = (BaseFlags)reader.ReadByte();
             Portrait = reader.ReadByte();
             ID = reader.ReadByte();
             Level = reader.ReadByte();
             Class = (Class)reader.ReadByte();
             Subclass = (Class)reader.ReadByte();
-            Unknown2 = reader.ReadUInt16();
+            StatusAilments = (StatusAilments)reader.ReadUInt16();
             WeaponSlot = new Item(stream);
             EquipmentSlot = new Item(stream);
             ArmorSlot1 = new Item(stream);
@@ -272,8 +309,9 @@
             CurrentTP = reader.ReadUInt16();
             CurrentEXP = reader.ReadUInt32();
             name = reader.ReadBytes(nameLength);
-            Unknown8 = reader.ReadUInt16();
-            UnknownTotalSkillPoints = reader.ReadUInt16();
+            NamePadding = reader.ReadUInt16();
+            UnknownTotalSkillPoints = reader.ReadByte();
+            AvailableSkillPoints = reader.ReadByte();
             MainSkillLevels = reader.ReadBytes(25);
             SubSkillLevels = reader.ReadBytes(25);
             Unknown9 = reader.ReadUInt16();
@@ -305,13 +343,13 @@
         {
             BinaryWriter writer = new BinaryWriter(stream);

-            writer.Write(Unknown1);
+            writer.Write((byte)BaseFlags);
             writer.Write(Portrait);
             writer.Write(ID);
             writer.Write(Level);
             writer.Write((byte)Class);
             writer.Write((byte)Subclass);
-            writer.Write(Unknown2);
+            writer.Write((ushort)StatusAilments);
             WeaponSlot.WriteToStream(stream);
             EquipmentSlot.WriteToStream(stream);
             ArmorSlot1.WriteToStream(stream);
@@ -331,8 +369,9 @@
             writer.Write(CurrentTP);
             writer.Write(CurrentEXP);
             writer.Write(name);
-            writer.Write(Unknown8);
+            writer.Write(NamePadding);
             writer.Write(UnknownTotalSkillPoints);
+            writer.Write(AvailableSkillPoints);
             writer.Write(MainSkillLevels);
             writer.Write(SubSkillLevels);
             writer.Write(Unknown9);


Use distinct, some map files have duplicate entries

--- Engine/DataFeeds/Auxiliary/MapFile.cs
+++ Engine/DataFeeds/Auxiliary/MapFile.cs
@@ -56,7 +56,7 @@
         public MapFile(string entitySymbol, IEnumerable<MapFileRow> data)
         {
             EntitySymbol = entitySymbol;
-            _data = new SortedDictionary<DateTime, MapFileRow>(data.ToDictionary(x => x.Date));
+            _data = new SortedDictionary<DateTime, MapFileRow>(data.Distinct().ToDictionary(x => x.Date));
         }

         /// <summary>


Don't return too early or we risk corrupted data


encapsulate box drawing for reuse

encapsulate box drawing for reuse

--- Common/CommonHelper.cs
+++ Common/CommonHelper.cs
@@ -32,7 +32,7 @@
         /// A blank pixel which can be colorised and stretched to draw geometric shapes.
         public static Texture2D Pixel => CommonHelper.LazyPixel.Value;

-        /// The width of the horizontal and vertical scroll edges (between the scroll origin position and start of content padding).
+        /// The width of the horizontal and vertical scroll edges (between the origin position and start of content padding).
         public static readonly Vector2 ScrollEdgeSize = new Vector2(CommonSprites.Scroll.TopLeft.Width * Game1.pixelZoom, CommonSprites.Scroll.TopLeft.Height * Game1.pixelZoom);

@@ -72,7 +72,7 @@
         /// <param name="label">The text to display.</param>
         /// <param name="position">The position at which to draw the text.</param>
         /// <param name="wrapWidth">The maximum width to display.</param>
-        public static Vector2 DrawHoverBox(SpriteBatch spriteBatch, string label, Vector2 position, float wrapWidth)
+        public static Vector2 DrawHoverBox(SpriteBatch spriteBatch, string label, in Vector2 position, float wrapWidth)
         {
             const int paddingSize = 27;
             const int gutterSize = 20;
@@ -91,10 +91,49 @@
         /// <param name="contentPos">The pixel position at which the content begins.</param>
         /// <param name="bounds">The scroll's outer bounds.</param>
         /// <param name="padding">The padding between the content and border.</param>
-        public static void DrawScroll(SpriteBatch spriteBatch, Vector2 position, Vector2 contentSize, out Vector2 contentPos, out Rectangle bounds, int padding = 5)
-        {
-            int cornerWidth = (int)CommonHelper.ScrollEdgeSize.X;
-            int cornerHeight = (int)CommonHelper.ScrollEdgeSize.Y;
+        public static void DrawScroll(SpriteBatch spriteBatch, in Vector2 position, in Vector2 contentSize, out Vector2 contentPos, out Rectangle bounds, int padding = 5)
+        {
+            CommonHelper.DrawContentBox(
+                spriteBatch: spriteBatch,
+                texture: CommonSprites.Scroll.Sheet,
+                background: in CommonSprites.Scroll.Background,
+                top: CommonSprites.Scroll.Top,
+                right: CommonSprites.Scroll.Right,
+                bottom: CommonSprites.Scroll.Bottom,
+                left: CommonSprites.Scroll.Left,
+                topLeft: CommonSprites.Scroll.TopLeft,
+                topRight: CommonSprites.Scroll.TopRight,
+                bottomRight: CommonSprites.Scroll.BottomRight,
+                bottomLeft: CommonSprites.Scroll.BottomLeft,
+                position: position,
+                contentSize: contentSize,
+                contentPos: out contentPos,
+                bounds: out bounds,
+                padding: padding
+            );
+        }
+
+        /// Draw a generic content box like a scroll or button.
+        /// <param name="spriteBatch">The sprite batch to which to draw.</param>
+        /// <param name="texture">The texture to draw.</param>
+        /// <param name="background">The source rectangle for the background.</param>
+        /// <param name="top">The source rectangle for the top border.</param>
+        /// <param name="right">The source rectangle for the right border.</param>
+        /// <param name="bottom">The source rectangle for the bottom border.</param>
+        /// <param name="left">The source rectangle for the left border.</param>
+        /// <param name="topLeft">The source rectangle for the top-left corner.</param>
+        /// <param name="topRight">The source rectangle for the top-right corner.</param>
+        /// <param name="bottomRight">The source rectangle for the bottom-right corner.</param>
+        /// <param name="bottomLeft">The source rectangle for the bottom-left corner.</param>
+        /// <param name="position">The top-left pixel coordinate at which to draw the button.</param>
+        /// <param name="contentSize">The button content's pixel size.</param>
+        /// <param name="contentPos">The pixel position at which the content begins.</param>
+        /// <param name="bounds">The box's outer bounds.</param>
+        /// <param name="padding">The padding between the content and border.</param>
+        public static void DrawContentBox(SpriteBatch spriteBatch, Texture2D texture, in Rectangle background, in Rectangle top, in Rectangle right, in Rectangle bottom, in Rectangle left, in Rectangle topLeft, in Rectangle topRight, in Rectangle bottomRight, in Rectangle bottomLeft, in Vector2 position, in Vector2 contentSize, out Vector2 contentPos, out Rectangle bounds, int padding)
+        {
+            int cornerWidth = topLeft.Width * Game1.pixelZoom;
+            int cornerHeight = topLeft.Height * Game1.pixelZoom;
             int innerWidth = (int)(contentSize.X + padding * 2);
             int innerHeight = (int)(contentSize.Y + padding * 2);
             int outerWidth = innerWidth + cornerWidth * 2;
@@ -103,19 +142,19 @@
             int y = (int)position.Y;

             // draw scroll background
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x + cornerWidth, y + cornerHeight, innerWidth, innerHeight), CommonSprites.Scroll.Background, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x + cornerWidth, y + cornerHeight, innerWidth, innerHeight), background, Color.White);

             // draw borders
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x + cornerWidth, y, innerWidth, cornerHeight), CommonSprites.Scroll.Top, Color.White);
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x + cornerWidth, y + cornerHeight + innerHeight, innerWidth, cornerHeight), CommonSprites.Scroll.Bottom, Color.White);
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x, y + cornerHeight, cornerWidth, innerHeight), CommonSprites.Scroll.Left, Color.White);
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x + cornerWidth + innerWidth, y + cornerHeight, cornerWidth, innerHeight), CommonSprites.Scroll.Right, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x + cornerWidth, y, innerWidth, cornerHeight), top, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x + cornerWidth, y + cornerHeight + innerHeight, innerWidth, cornerHeight), bottom, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x, y + cornerHeight, cornerWidth, innerHeight), left, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x + cornerWidth + innerWidth, y + cornerHeight, cornerWidth, innerHeight), right, Color.White);

             // draw corners
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x, y, cornerWidth, cornerHeight), CommonSprites.Scroll.TopLeft, Color.White);
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x, y + cornerHeight + innerHeight, cornerWidth, cornerHeight), CommonSprites.Scroll.BottomLeft, Color.White);
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x + cornerWidth + innerWidth, y, cornerWidth, cornerHeight), CommonSprites.Scroll.TopRight, Color.White);
-            spriteBatch.Draw(CommonSprites.Scroll.Sheet, new Rectangle(x + cornerWidth + innerWidth, y + cornerHeight + innerHeight, cornerWidth, cornerHeight), CommonSprites.Scroll.BottomRight, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x, y, cornerWidth, cornerHeight), topLeft, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x, y + cornerHeight + innerHeight, cornerWidth, cornerHeight), bottomLeft, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x + cornerWidth + innerWidth, y, cornerWidth, cornerHeight), topRight, Color.White);
+            spriteBatch.Draw(texture, new Rectangle(x + cornerWidth + innerWidth, y + cornerHeight + innerHeight, cornerWidth, cornerHeight), bottomRight, Color.White);

             // set out params
             contentPos = new Vector2(x + cornerWidth + padding, y + cornerHeight + padding);
@@ -146,7 +185,7 @@
         /// <param name="y">The X-position at which to start the line.</param>
         /// <param name="size">The line dimensions.</param>
         /// <param name="color">The color to tint the sprite.</param>
-        public static void DrawLine(this SpriteBatch batch, float x, float y, Vector2 size, Color? color = null)
+        public static void DrawLine(this SpriteBatch batch, float x, float y, in Vector2 size, in Color? color = null)
         {
             batch.Draw(CommonHelper.Pixel, new Rectangle((int)x, (int)y, (int)size.X, (int)size.Y), color ?? Color.White);
         }
@@ -161,7 +200,7 @@
         /// <param name="bold">Whether to draw bold text.</param>
         /// <param name="scale">The font scale.</param>
         /// <returns>Returns the text dimensions.</returns>
-        public static Vector2 DrawTextBlock(this SpriteBatch batch, SpriteFont font, string text, Vector2 position, float wrapWidth, Color? color = null, bool bold = false, float scale = 1)
+        public static Vector2 DrawTextBlock(this SpriteBatch batch, SpriteFont font, string text, in Vector2 position, float wrapWidth, in Color? color = null, bool bold = false, float scale = 1)
         {
             if (text == null)
                 return new Vector2(0, 0);


Added in memory host sample.

Added in memory host sample.

--- SignalR.Client.Samples/Program.cs
+++ SignalR.Client.Samples/Program.cs
@@ -9,6 +9,19 @@
     class Program
     {
         static void Main(string[] args)
+        {
+            RunInMemoryHost();
+
+            //var hubConnection = new HubConnection("http://localhost:40476/");
+
+            //RunDemoHub(hubConnection);
+
+            //RunStreamingSample();
+
+            Console.ReadKey();
+        }
+
+        private static void RunInMemoryHost()
         {
             var host = new MemoryHost();
             host.MapConnection<MyConnection>("/echo");
@@ -39,30 +52,7 @@

                 }
             });
-
-            //var hubConnection = new HubConnection("http://localhost:40476/");
-
-            //RunDemoHub(hubConnection);
-
-            //RunStreamingSample();
-
-            Console.ReadKey();
         }
-
-        public class MyConnection : PersistentConnection
-        {
-            protected override Task OnConnectedAsync(Hosting.IRequest request, string connectionId)
-            {
-                Console.WriteLine("{0} Connected", connectionId);
-                return base.OnConnectedAsync(request, connectionId);
-            }
-
-            protected override Task OnReceivedAsync(string connectionId, string data)
-            {
-                return Connection.Broadcast(data);
-            }
-        }
-
         private static void RunDemoHub(HubConnection hubConnection)
         {
             var demo = hubConnection.CreateProxy("SignalR.Samples.Hubs.DemoHub.DemoHub");
@@ -109,5 +99,19 @@

             connection.Start().Wait();
         }
+
+        public class MyConnection : PersistentConnection
+        {
+            protected override Task OnConnectedAsync(Hosting.IRequest request, string connectionId)
+            {
+                Console.WriteLine("{0} Connected", connectionId);
+                return base.OnConnectedAsync(request, connectionId);
+            }
+
+            protected override Task OnReceivedAsync(string connectionId, string data)
+            {
+                return Connection.Broadcast(data);
+            }
+        }
     }
 }


ConsoleSwitch separators

ConsoleSwitch separators

--- Signum.Utilities/ConsoleSwitch.cs
+++ Signum.Utilities/ConsoleSwitch.cs
@@ -11,7 +11,7 @@
     public class ConsoleSwitch<K, V> : IEnumerable<KeyValuePair<string, WithDescription<V>>> where V : class
     {
         Dictionary<string, WithDescription<V>> dictionary = new Dictionary<string, WithDescription<V>>(StringComparer.InvariantCultureIgnoreCase);
-        List<int> separators = new List<int>();
+        Dictionary<int, string> separators = new Dictionary<int, string>();
         string welcomeMessage;

         public ConsoleSwitch()
@@ -25,9 +25,9 @@
         }

         //Separator
-        public void Add()
-        {
-            separators.Add(dictionary.Keys.Count);
+        public void Add(string value)
+        {
+            separators.AddOrThrow(dictionary.Keys.Count, value, "Already a separator on {0}");
         }

         public void Add(K key, V value)
@@ -68,7 +68,7 @@
                 Console.WriteLine(welcomeMessage);
                 PrintOptions();

-                Console.Write(endMessage);
+                Console.WriteLine(endMessage);
                 string line = Console.ReadLine();

                 if (string.IsNullOrEmpty(line))
@@ -92,8 +92,12 @@
             {
                 var key = keys[i];

-                if (separators.Contains(i))
+                string value = separators.TryGetC(i);
+                if (value.HasText())
+                {
                     Console.WriteLine();
+                    Console.WriteLine(value);
+                }

                 SafeConsole.WriteColor(ConsoleColor.White, " " + keys[i]);
                 Console.WriteLine(" - " + dictionary[key].Description);
@@ -130,7 +134,7 @@
                 Console.WriteLine(welcomeMessage);
                 PrintOptions();

-                Console.Write(endMessage);
+                Console.WriteLine(endMessage);
                 string line = Console.ReadLine();

                 if (string.IsNullOrEmpty(line))
@@ -158,12 +162,12 @@
                     return Enumerable.Empty<WithDescription<V>>();

                 if (from == null && to.HasValue)
-                    return dictionary.Keys.Take(to.Value).Select(dictionary.GetOrThrow);
+                    return dictionary.Keys.Take(to.Value + 1).Select(dictionary.GetOrThrow);

                 if (from.HasValue && to == null)
                     return dictionary.Keys.Skip(from.Value).Select(dictionary.GetOrThrow);

-                return dictionary.Keys.Skip(from.Value).Take(to.Value - from.Value).Select(dictionary.GetOrThrow);
+                return dictionary.Keys.Skip(from.Value).Take((to.Value + 1) - from.Value).Select(dictionary.GetOrThrow);
             }
             else
             {


Relations - more detailed speed comparison

--- SimpleTester/RelationSpeedTest.cs
+++ SimpleTester/RelationSpeedTest.cs
@@ -8,6 +8,7 @@
 {
     public class RelationSpeedTest
     {
+        [StoredInline]
         public class Person
         {
             [PrimaryKey(1)]
@@ -16,7 +17,7 @@
             public string Email { get; set; }
         }

-        ObjectDB CreateDb()
+        static ObjectDB CreateInMemoryDb()
         {
             var lowDb = new InMemoryKeyValueDB();
             var db = new ObjectDB();
@@ -24,49 +25,111 @@
             return db;
         }

-        IEnumerable<string> GenerateEmails(int count)
+        static ObjectDB CreateDb(IFileCollection fc)
+        {
+            var lowDb = new KeyValueDB(fc);
+            var db = new ObjectDB();
+            db.Open(lowDb, true);
+            return db;
+        }
+
+        static IEnumerable<string> GenerateEmails(int count)
         {
             var rnd = new Random();
             while (count-- > 0)
                 yield return $"a{rnd.Next(999)}@b{count}.com";
         }

+        interface IMesureOperations
+        {
+            void Insert();
+            void List();
+            void Update();
+            void Remove();
+        }
+
         //definitinos for relations
         public interface IPersonTable
         {
             void Insert(Person person);
+            void Update(Person person);
+            Person FindById(ulong id);
+            void RemoveById(ulong id);
             IEnumerator<Person> ListByEmail(AdvancedEnumeratorParam<Person> param);
         }
         //

-        void InsertPersonsAndIterateByEmailRelation(int count)
-        {
-            using (var db = CreateDb())
-            {
-                Func<IObjectDBTransaction, IPersonTable> creator;
-                using (var tr = db.StartTransaction())
-                {
-                    creator = tr.InitRelation<IPersonTable>("Job");
-                    var jobTable = creator(tr);
-                    ulong idx = 0;
-                    foreach (var email in GenerateEmails(count))
-                    {
-                        jobTable.Insert(new Person { Email = email, Id = idx++ });
-                    }
-                    tr.Commit();
-                }
+        class RelationPersonTest : IMesureOperations
+        {
+            readonly int _count;
+            readonly ObjectDB _db;
+            readonly Func<IObjectDBTransaction, IPersonTable> _creator;
+
+            public RelationPersonTest(ObjectDB db, int count)
+            {
+                _count = count;
+                _db = db;
+                using (var tr = _db.StartTransaction())
+                {
+                    _creator = tr.InitRelation<IPersonTable>("Job");
+                }
+            }
+
+            public void Insert()
+            {
+                ulong idx = 0;
+                foreach (var email in GenerateEmails(_count))
+                {
+                    using (var tr = _db.StartTransaction())
+                    {
+                        var personTable = _creator(tr);
+                        personTable.Insert(new Person { Email = email, Id = idx++ });
+                        tr.Commit();
+                    }
+                }
+            }
+
+            public void List()
+            {
                 ulong sum = 0;
-                using (var tr = db.StartTransaction())
-                {
-                    var jobTable = creator(tr);
-                    var en = jobTable.ListByEmail(new AdvancedEnumeratorParam<Person>());
+                using (var tr = _db.StartTransaction())
+                {
+                    var personTable = _creator(tr);
+                    var en = personTable.ListByEmail(new AdvancedEnumeratorParam<Person>());
                     while (en.MoveNext())
                     {
                         sum += en.Current.Id;
                     }
                 }
             }
-        }
+
+            public void Update()
+            {
+                for (var id = 0ul; id < (ulong)_count; id++)
+                {
+                    using (var tr = _db.StartTransaction())
+                    {
+                        var personTable = _creator(tr);
+                        var p = personTable.FindById(id);
+                        p.Email += "a";
+                        personTable.Update(p);
+                    }
+                }
+            }
+
+            public void Remove()
+            {
+                for (var id = 0ul; id < (ulong)_count; id++)
+                {
+                    using (var tr = _db.StartTransaction())
+                    {
+                        var personTable = _creator(tr);
+                        personTable.RemoveById(id);
+                    }
+                }
+            }
+        }
+

         //definitions for singletons
         public class PersonMap
@@ -80,24 +143,39 @@
         }
         //

-        void InsertPersonsAndIterateByEmailRelationSingleton(int count)
-        {
-            using (var db = CreateDb())
-            {
-                using (var tr = db.StartTransaction())
-                {
-                    var persons = tr.Singleton<PersonMap>();
-                    var emails = tr.Singleton<PersonNameIndex>();
-                    ulong idx = 0;
-                    foreach (var email in GenerateEmails(count))
-                    {
+        class SingletonPersonTest : IMesureOperations
+        {
+            readonly int _count;
+            readonly ObjectDB _db;
+            readonly Func<IObjectDBTransaction, IPersonTable> _creator;
+
+            public SingletonPersonTest(ObjectDB db, int count)
+            {
+                _db = db;
+                _count = count;
+            }
+
+            public void Insert()
+            {
+                ulong idx = 0;
+                foreach (var email in GenerateEmails(_count))
+                {
+                    using (var tr = _db.StartTransaction())
+                    {
+                        var persons = tr.Singleton<PersonMap>();
+                        var emails = tr.Singleton<PersonNameIndex>();
+
                         persons.Items[idx] = new Person { Email = email, Id = idx };
                         emails.Items[email] = idx;
                         idx++;
-                    }
-                    tr.Commit();
-                }
-                using (var tr = db.StartReadOnlyTransaction())
+                        tr.Commit();
+                    }
+                }
+            }
+
+            public void List()
+            {
+                using (var tr = _db.StartReadOnlyTransaction())
                 {
                     var persons = tr.Singleton<PersonMap>();
                     var emails = tr.Singleton<PersonNameIndex>();
@@ -109,24 +187,99 @@
                     }
                 }
             }
-        }
-
-        public void Run()
-        {
+
+            public void Update()
+            {
+                for (var id = 0ul; id < (ulong)_count; id++)
+                {
+                    using (var tr = _db.StartTransaction())
+                    {
+                        var persons = tr.Singleton<PersonMap>();
+                        var emails = tr.Singleton<PersonNameIndex>();
+
+                        var p = persons.Items[id];
+                        emails.Items.Remove(p.Email);
+                        p.Email += "a";
+                        emails.Items[p.Email] = id;
+
+                    }
+                }
+            }
+
+            public void Remove()
+            {
+                for (var id = 0ul; id < (ulong)_count; id++)
+                {
+                    using (var tr = _db.StartTransaction())
+                    {
+                        var persons = tr.Singleton<PersonMap>();
+                        var emails = tr.Singleton<PersonNameIndex>();
+
+                        var p = persons.Items[id];
+                        emails.Items.Remove(p.Email);
+                        persons.Items.Remove(id);
+                    }
+                }
+            }
+
+            public void Dispose()
+            {
+                _db.Dispose();
+            }
+        }
+
+
+        void Measure(string name, IMesureOperations testImpl)
+        {
+            GC.Collect();
+            GC.WaitForPendingFinalizers();
+
+            Console.WriteLine($"Measure {name}");
             var sw = new Stopwatch();
             sw.Start();
-            InsertPersonsAndIterateByEmailRelationSingleton(1000000);
+
+            Do("Insert", testImpl.Insert);
+            Do("Update", testImpl.Update);
+            Do("List  ", testImpl.List);
+            Do("Remove", testImpl.Remove);
+
             sw.Stop();
-            Console.WriteLine($"2 Maps: {TimeSpan.FromTicks(sw.ElapsedTicks)}");
-
-            GC.Collect();
-            GC.WaitForPendingFinalizers();
-
-            sw.Reset();
+
+            Console.WriteLine($"Total : {TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds)}");
+            Console.WriteLine();
+
+        }
+
+        void Do(string operationName, Action action)
+        {
+            var sw = new Stopwatch();
             sw.Start();
-            InsertPersonsAndIterateByEmailRelation(1000000);
+            action();
             sw.Stop();
-            Console.WriteLine($"Relation: {TimeSpan.FromTicks(sw.ElapsedTicks)}");
+            Console.WriteLine($"{operationName}: {TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds)}");
+        }
+
+        public void Run()
+        {
+            int cnt = 500000;
+            using (var fc = new InMemoryFileCollection())
+            using (var db = CreateDb(fc))
+            {
+                Measure("Relation: ", new RelationPersonTest(db, cnt));
+            }
+            using (var fc = new InMemoryFileCollection())
+            using (var db = CreateDb(fc))
+            {
+                Measure("2 Maps: ", new SingletonPersonTest(db, cnt));
+            }
+            using (var db = CreateInMemoryDb())
+            {
+                Measure("Relation (mem): ", new RelationPersonTest(db, cnt));
+            }
+            using (var db = CreateInMemoryDb())
+            {
+                Measure("2 Maps (mem): ", new SingletonPersonTest(db, cnt));
+            }
         }
     }
 }


Display progress when updating all commits

--- kerbalgit/kerbalgit/Git/CommitMessageRewriter.cs
+++ kerbalgit/kerbalgit/Git/CommitMessageRewriter.cs
@@ -33,9 +33,14 @@
 		}

 		private CommitRewriteInfo rewriteCommit(Commit commit) {
+			onRewriteCommit();
 			return CommitRewriteInfo.From(commit, message: commit.Parents.Any() ? repository.CreateDiff(commit).Message : commit.Message);
-		}
-
+		}
+
+		private void onRewriteCommit() {
+			completedCommits++;
+			Console.WriteLine("Rewriting commit messages... " + (100 * completedCommits / totalCommits) + "% complete.");
+		}

 		public void Run() {
 			var commitsToUpdate = getAllCommits();


Use the same reference for all method calls

--- src/net45/WampSharp.Default/WAMP2/V2/DefaultWampChannelFactory.cs
+++ src/net45/WampSharp.Default/WAMP2/V2/DefaultWampChannelFactory.cs
@@ -7,6 +7,9 @@
 {
     public class DefaultWampChannelFactory : WampChannelFactory
     {
+        private readonly MessagePackObjectBinding mMsgpackBinding = new MessagePackObjectBinding();
+        private readonly JTokenBinding mJsonBinding = new JTokenBinding();
+
         public IWampChannel CreateChannel<TMessage>(string address,
                                                     string realm,
                                                     IWampTextBinding<TMessage> binding)
@@ -30,17 +33,13 @@
         public IWampChannel CreateJsonChannel(string address,
                                               string realm)
         {
-            JTokenBinding binding = new JTokenBinding();
-
-            return this.CreateChannel(address, realm, binding);
+            return this.CreateChannel(address, realm, mJsonBinding);
         }

         public IWampChannel CreateMsgpackChannel(string address,
                                                  string realm)
         {
-            MessagePackObjectBinding binding = new MessagePackObjectBinding();
-
-            return this.CreateChannel(address, realm, binding);
+            return this.CreateChannel(address, realm, mMsgpackBinding);
         }
     }
 }


ошибка загрузки DLL

ошибка загрузки DLL

--- robopascal-runner/ReferenceLoader.cs
+++ robopascal-runner/ReferenceLoader.cs
@@ -15,7 +15,7 @@

         public string[] LoadClassTypes(string assemblyPath)
         {
-            var assembly = Assembly.ReflectionOnlyLoadFrom(assemblyPath);
+            var assembly = Assembly.LoadFrom(assemblyPath);
             var paths = assembly.GetTypes().Where(x => x.IsClass).Select(x => x.FullName).ToArray();
             return paths;
         }


Correct whitespace

Correct whitespace

--- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -1,512 +1,3 @@
-<<<<<<< HEAD:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the OpenSimulator Project nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.Remoting.Lifetime;
-using OpenMetaverse;
-using Nini.Config;
-using OpenSim;
-using OpenSim.Framework;
-using OpenSim.Region.CoreModules.World.LightShare;
-using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.Framework.Scenes;
-using OpenSim.Region.ScriptEngine.Shared;
-using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
-using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
-using OpenSim.Region.ScriptEngine.Interfaces;
-using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
-
-using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
-using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
-using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
-using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
-using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
-using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
-using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
-
-namespace OpenSim.Region.ScriptEngine.Shared.Api
-{
-    [Serializable]
-    public class LS_Api : MarshalByRefObject, ILS_Api, IScriptApi
-    {
-        internal IScriptEngine m_ScriptEngine;
-        internal SceneObjectPart m_host;
-        internal uint m_localID;
-        internal UUID m_itemID;
-        internal bool m_LSFunctionsEnabled = false;
-        internal IScriptModuleComms m_comms = null;
-
-        public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
-        {
-            m_ScriptEngine = ScriptEngine;
-            m_host = host;
-            m_localID = localID;
-            m_itemID = itemID;
-
-            if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
-                m_LSFunctionsEnabled = true;
-
-            if (m_ScriptEngine.Config.GetBoolean("AllowCareminsterFunctions", false))
-                m_LSFunctionsEnabled = true;
-
-            m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>();
-            if (m_comms == null)
-                m_LSFunctionsEnabled = false;
-        }
-
-        public override Object InitializeLifetimeService()
-        {
-            ILease lease = (ILease)base.InitializeLifetimeService();
-
-            if (lease.CurrentState == LeaseState.Initial)
-            {
-                lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
-                //                lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
-                //                lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
-            }
-            return lease;
-        }
-
-        public Scene World
-        {
-            get { return m_ScriptEngine.World; }
-        }
-
-        //
-        //Dumps an error message on the debug console.
-        //
-
-        internal void LSShoutError(string message)
-        {
-            if (message.Length > 1023)
-                message = message.Substring(0, 1023);
-
-            World.SimChat(Utils.StringToBytes(message),
-                          ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true);
-
-            IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
-            wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
-        }
-
-        /// <summary>
-        /// Get the current Windlight scene
-        /// </summary>
-        /// <returns>List of windlight parameters</returns>
-        public LSL_List lsGetWindlightScene(LSL_List rules)
-        {
-            if (!m_LSFunctionsEnabled)
-            {
-                LSShoutError("LightShare functions are not enabled.");
-                return new LSL_List();
-            }
-            m_host.AddScriptLPS(1);
-            RegionLightShareData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings;
-
-            LSL_List values = new LSL_List();
-            int idx = 0;
-            while (idx < rules.Length)
-            {
-                uint rule = (uint)rules.GetLSLIntegerItem(idx);
-                LSL_List toadd = new LSL_List();
-
-                switch (rule)
-                {
-                    case (int)ScriptBaseClass.WL_AMBIENT:
-                        toadd.Add(new LSL_Rotation(wl.ambient.X, wl.ambient.Y, wl.ambient.Z, wl.ambient.W));
-                        break;
-                    case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
-                        toadd.Add(new LSL_Vector(wl.bigWaveDirection.X, wl.bigWaveDirection.Y, 0.0f));
-                        break;
-                    case (int)ScriptBaseClass.WL_BLUE_DENSITY:
-                        toadd.Add(new LSL_Rotation(wl.blueDensity.X, wl.blueDensity.Y, wl.blueDensity.Z, wl.blueDensity.W));
-                        break;
-                    case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER:
-                        toadd.Add(new LSL_Float(wl.blurMultiplier));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_COLOR:
-                        toadd.Add(new LSL_Rotation(wl.cloudColor.X, wl.cloudColor.Y, wl.cloudColor.Z, wl.cloudColor.W));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_COVERAGE:
-                        toadd.Add(new LSL_Float(wl.cloudCoverage));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
-                        toadd.Add(new LSL_Vector(wl.cloudDetailXYDensity.X, wl.cloudDetailXYDensity.Y, wl.cloudDetailXYDensity.Z));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCALE:
-                        toadd.Add(new LSL_Float(wl.cloudScale));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X:
-                        toadd.Add(new LSL_Float(wl.cloudScrollX));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
-                        toadd.Add(new LSL_Integer(wl.cloudScrollXLock ? 1 : 0));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y:
-                        toadd.Add(new LSL_Float(wl.cloudScrollY));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
-                        toadd.Add(new LSL_Integer(wl.cloudScrollYLock ? 1 : 0));
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY:
-                        toadd.Add(new LSL_Vector(wl.cloudXYDensity.X, wl.cloudXYDensity.Y, wl.cloudXYDensity.Z));
-                        break;
-                    case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER:
-                        toadd.Add(new LSL_Float(wl.densityMultiplier));
-                        break;
-                    case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
-                        toadd.Add(new LSL_Float(wl.distanceMultiplier));
-                        break;
-                    case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
-                        toadd.Add(new LSL_Integer(wl.drawClassicClouds ? 1 : 0));
-                        break;
-                    case (int)ScriptBaseClass.WL_EAST_ANGLE:
-                        toadd.Add(new LSL_Float(wl.eastAngle));
-                        break;
-                    case (int)ScriptBaseClass.WL_FRESNEL_OFFSET:
-                        toadd.Add(new LSL_Float(wl.fresnelOffset));
-                        break;
-                    case (int)ScriptBaseClass.WL_FRESNEL_SCALE:
-                        toadd.Add(new LSL_Float(wl.fresnelScale));
-                        break;
-                    case (int)ScriptBaseClass.WL_HAZE_DENSITY:
-                        toadd.Add(new LSL_Float(wl.hazeDensity));
-                        break;
-                    case (int)ScriptBaseClass.WL_HAZE_HORIZON:
-                        toadd.Add(new LSL_Float(wl.hazeHorizon));
-                        break;
-                    case (int)ScriptBaseClass.WL_HORIZON:
-                        toadd.Add(new LSL_Rotation(wl.horizon.X, wl.horizon.Y, wl.horizon.Z, wl.horizon.W));
-                        break;
-                    case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
-                        toadd.Add(new LSL_Vector(wl.littleWaveDirection.X, wl.littleWaveDirection.Y, 0.0f));
-                        break;
-                    case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
-                        toadd.Add(new LSL_Integer(wl.maxAltitude));
-                        break;
-                    case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
-                        toadd.Add(new LSL_Key(wl.normalMapTexture.ToString()));
-                        break;
-                    case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
-                        toadd.Add(new LSL_Vector(wl.reflectionWaveletScale.X, wl.reflectionWaveletScale.Y, wl.reflectionWaveletScale.Z));
-                        break;
-                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
-                        toadd.Add(new LSL_Float(wl.refractScaleAbove));
-                        break;
-                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
-                        toadd.Add(new LSL_Float(wl.refractScaleBelow));
-                        break;
-                    case (int)ScriptBaseClass.WL_SCENE_GAMMA:
-                        toadd.Add(new LSL_Float(wl.sceneGamma));
-                        break;
-                    case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS:
-                        toadd.Add(new LSL_Float(wl.starBrightness));
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS:
-                        toadd.Add(new LSL_Float(wl.sunGlowFocus));
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE:
-                        toadd.Add(new LSL_Float(wl.sunGlowSize));
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_MOON_COLOR:
-                        toadd.Add(new LSL_Rotation(wl.sunMoonColor.X, wl.sunMoonColor.Y, wl.sunMoonColor.Z, wl.sunMoonColor.W));
-                        break;
-                    case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
-                        toadd.Add(new LSL_Float(wl.underwaterFogModifier));
-                        break;
-                    case (int)ScriptBaseClass.WL_WATER_COLOR:
-                        toadd.Add(new LSL_Vector(wl.waterColor.X, wl.waterColor.Y, wl.waterColor.Z));
-                        break;
-                    case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
-                        toadd.Add(new LSL_Float(wl.waterFogDensityExponent));
-                        break;
-                }
-
-                if (toadd.Length > 0)
-                {
-                    values.Add(new LSL_Integer(rule));
-                    values.Add(toadd.Data[0]);
-                }
-                idx++;
-            }
-
-
-            return values;
-
-        }
-
-        private RegionLightShareData getWindlightProfileFromRules(LSL_List rules)
-        {
-            RegionLightShareData wl = (RegionLightShareData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone();
-
-            LSL_List values = new LSL_List();
-            int idx = 0;
-            while (idx < rules.Length)
-            {
-                uint rule = (uint)rules.GetLSLIntegerItem(idx);
-                LSL_Types.Quaternion iQ;
-                LSL_Types.Vector3 iV;
-                switch (rule)
-                {
-                    case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
-                        idx++;
-                        wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_AMBIENT:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.ambient = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.bigWaveDirection = new Vector2((float)iV.x, (float)iV.y);
-                        break;
-                    case (int)ScriptBaseClass.WL_BLUE_DENSITY:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.blueDensity = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER:
-                        idx++;
-                        wl.blurMultiplier = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_COLOR:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.cloudColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_COVERAGE:
-                        idx++;
-                        wl.cloudCoverage = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.cloudDetailXYDensity = new Vector3((float)iV.x, (float)iV.y, (float)iV.z);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCALE:
-                        idx++;
-                        wl.cloudScale = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X:
-                        idx++;
-                        wl.cloudScrollX = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
-                        idx++;
-                        wl.cloudScrollXLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y:
-                        idx++;
-                        wl.cloudScrollY = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
-                        idx++;
-                        wl.cloudScrollYLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.cloudXYDensity = new Vector3((float)iV.x, (float)iV.y, (float)iV.z);
-                        break;
-                    case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER:
-                        idx++;
-                        wl.densityMultiplier = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
-                        idx++;
-                        wl.distanceMultiplier = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
-                        idx++;
-                        wl.drawClassicClouds = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
-                        break;
-                    case (int)ScriptBaseClass.WL_EAST_ANGLE:
-                        idx++;
-                        wl.eastAngle = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_FRESNEL_OFFSET:
-                        idx++;
-                        wl.fresnelOffset = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_FRESNEL_SCALE:
-                        idx++;
-                        wl.fresnelScale = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_HAZE_DENSITY:
-                        idx++;
-                        wl.hazeDensity = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_HAZE_HORIZON:
-                        idx++;
-                        wl.hazeHorizon = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_HORIZON:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.horizon = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.littleWaveDirection = new Vector2((float)iV.x, (float)iV.y);
-                        break;
-                    case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
-                        idx++;
-                        wl.maxAltitude = (ushort)rules.GetLSLIntegerItem(idx).value;
-                        break;
-                    case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
-                        idx++;
-                        wl.normalMapTexture = new UUID(rules.GetLSLStringItem(idx).m_string);
-                        break;
-                    case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.reflectionWaveletScale = new Vector3((float)iV.x, (float)iV.y, (float)iV.z);
-                        break;
-                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
-                        idx++;
-                        wl.refractScaleAbove = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
-                        idx++;
-                        wl.refractScaleBelow = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SCENE_GAMMA:
-                        idx++;
-                        wl.sceneGamma = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS:
-                        idx++;
-                        wl.starBrightness = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS:
-                        idx++;
-                        wl.sunGlowFocus = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE:
-                        idx++;
-                        wl.sunGlowSize = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_MOON_COLOR:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.sunMoonColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
-                        idx++;
-                        wl.underwaterFogModifier = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_WATER_COLOR:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.waterColor = new Vector3((float)iV.x, (float)iV.y, (float)iV.z);
-                        break;
-                    case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
-                        idx++;
-                        wl.waterFogDensityExponent = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                }
-                idx++;
-            }
-            return wl;
-        }
-        /// <summary>
-        /// Set the current Windlight scene
-        /// </summary>
-        /// <param name="rules"></param>
-        /// <returns>success: true or false</returns>
-        public int lsSetWindlightScene(LSL_List rules)
-        {
-            if (!m_LSFunctionsEnabled)
-            {
-                LSShoutError("LightShare functions are not enabled.");
-                return 0;
-            }
-            if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
-            {
-                LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
-                return 0;
-            }
-            int success = 0;
-            m_host.AddScriptLPS(1);
-            if (LightShareModule.EnableWindlight)
-            {
-                RegionLightShareData wl = getWindlightProfileFromRules(rules);
-                m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
-                success = 1;
-            }
-            else
-            {
-                LSShoutError("Windlight module is disabled");
-                return 0;
-            }
-            return success;
-        }
-        /// <summary>
-        /// Set the current Windlight scene to a target avatar
-        /// </summary>
-        /// <param name="rules"></param>
-        /// <returns>success: true or false</returns>
-        public int lsSetWindlightSceneTargeted(LSL_List rules, LSL_Key target)
-        {
-            if (!m_LSFunctionsEnabled)
-            {
-                LSShoutError("LightShare functions are not enabled.");
-                return 0;
-            }
-            if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
-            {
-                LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners.");
-                return 0;
-            }
-            int success = 0;
-            m_host.AddScriptLPS(1);
-            if (LightShareModule.EnableWindlight)
-            {
-                RegionLightShareData wl = getWindlightProfileFromRules(rules);
-                World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
-                success = 1;
-            }
-            else
-            {
-                LSShoutError("Windlight module is disabled");
-                return 0;
-            }
-            return success;
-        }
-
-    }
-}
-=======
 /*
  * Copyright (c) Contributors, http://opensimulator.org/
  * See CONTRIBUTORS.TXT for a full list of copyright holders.
@@ -1009,4 +500,3 @@

     }
 }
->>>>>>> master:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs


added missing exception handling to Script State serializer

--- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs
+++ OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs
@@ -73,13 +73,18 @@

             XmlElement queue = xmldoc.CreateElement("", "Queue", "");

-            long count = instance.EventsQueued;
-
-            while (count > 0)
-            {
-                EventParams ep = (EventParams)instance.DequeueEvent();
+            for (; ;)
+            {
+                EventParams ep;
+                try
+                {
+                    ep = (EventParams)instance.DequeueEvent();
+                }
+                catch (InvalidOperationException)
+                {
+                    break;
+                }
                 instance.EnqueueEvent(ep);
-                count--;

                 XmlElement item = xmldoc.CreateElement("", "Item", "");
                 XmlAttribute itemEvent = xmldoc.CreateAttribute("", "event",


removed usings

removed usings

--- src/test/DomainDrivenDesign.Specs/EntitySpec.cs
+++ src/test/DomainDrivenDesign.Specs/EntitySpec.cs
@@ -6,9 +6,6 @@
 {
     using DomainDrivenDesign;
     using FluentAssertions;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Linq;
     using Xbehave;

     public static class EntitySpec


Added LostPassword model - UserName value

--- GameUi/Models/AccountModels.cs
+++ GameUi/Models/AccountModels.cs
@@ -56,5 +56,11 @@
         public bool RememberMe { get; set; }
     }

+    public class LostPasswordModel
+    {
+        [DataType(DataType.Text)]
+        public string UserName { get; set; }
+    }
+

 }


Data type for user name added

Data type for user name added

--- GameUi/Models/AccountModels.cs
+++ GameUi/Models/AccountModels.cs
@@ -46,6 +46,7 @@
     public class LogOnModel
     {
         [Required]
+        [DataType(DataType.Text)]
         public string UserName { get; set; }

         [Required]


Smoothing dog

Smoothing dog

--- Games3Project2/RemotePlayer.cs
+++ Games3Project2/RemotePlayer.cs
@@ -73,13 +73,13 @@
         {
             simulationState.position += simulationState.velocity * Global.Constants.MOVEMENT_VELOCITY * (float)Global.gameTime.ElapsedGameTime.TotalSeconds;
             previousState.position += previousState.velocity * Global.Constants.MOVEMENT_VELOCITY * (float)Global.gameTime.ElapsedGameTime.TotalSeconds;
-            currentSmoothing -= 1.0f / PACKET_INTERVAL;
+            currentSmoothing -= 1.0f / (float)PACKET_INTERVAL;
             if (currentSmoothing < 0)
                 currentSmoothing = 0;
             position = Vector3.Lerp(simulationState.position, previousState.position, currentSmoothing);
             velocity = Vector3.Lerp(simulationState.velocity, previousState.velocity, currentSmoothing);
             sphere.Position = position;
-            sphere.Update(Global.gameTime);
+            //sphere.Update(Global.gameTime);
         }

         public void draw()


Corrected some of the documentation to VerticalLine

git-svn-id: 64cc320d9ecd7aad470f8b18be342a8e58536f88@1042 a61f9e97-bd4c-0410-8c65-85b29eaa70ff

--- Gorgon/Targets/RenderTarget.cs
+++ Gorgon/Targets/RenderTarget.cs
@@ -1053,7 +1053,7 @@
 		}

 		/// <summary>
-		/// Function to draw a horizontal line.
+		/// Function to draw a vertical line.
 		/// </summary>
 		/// <param name="x">Starting horizontal position.</param>
 		/// <param name="y">Starting vertical position.</param>
@@ -1108,7 +1108,7 @@
 		}

 		/// <summary>
-		/// Function to draw a horizontal line.
+        /// Function to draw a vertical line.
 		/// </summary>
 		/// <param name="x">Starting horizontal position.</param>
 		/// <param name="y">Starting vertical position.</param>
@@ -1121,7 +1121,7 @@
 		}

 		/// <summary>
-		/// Function to draw a horizontal line.
+        /// Function to draw a vertical line.
 		/// </summary>
 		/// <param name="x">Starting horizontal position.</param>
 		/// <param name="y">Starting vertical position.</param>


Update PartyInspector.cs

Update PartyInspector.cs

--- plugins/Prrovoss/PartyInspector.cs
+++ plugins/Prrovoss/PartyInspector.cs
@@ -8,7 +8,7 @@
 namespace Turbo.Plugins.Prrovoss
 {

-    public class PartyInspector : BasePlugin, IInGameWorldPainter, IKeyEventHandler
+    public class PartyInspector : BasePlugin, IInGameTopPainter, IKeyEventHandler
     {
         public bool Show { get; set; }
         public IKeyEvent ToggleKeyEvent { get; set; }
@@ -32,13 +32,14 @@
         public PartyInspector()
         {
             Enabled = true;
+            Order = 99;
         }

         public override void Load(IController hud)
         {
             base.Load(hud);

-            Show = true;
+            Show = false;
             ToggleKeyEvent = Hud.Input.CreateKeyEvent(true, Key.F8, false, false, false);

             LegendaryGemItemIDs = new Dictionary<uint, uint>();
@@ -101,10 +102,16 @@
             ElementOrder = new List<int>(new int[] { 0, 1, 2, 3 });
         }

-        public void PaintWorld(WorldLayer layer)
-        {
+        public void PaintTopInGame(ClipState clipState)
+        {
+            if (clipState != ClipState.BeforeClip) return;
             if (Show)
             {
+                if(XOffset==0) XOffset = Hud.Window.Size.Width * 0.14f;
+                if(YOffset==0) YOffset = Hud.Window.Size.Width * 0.012f;
+                if(Gap==0) Gap = Hud.Window.Size.Width * 0.012f;
+
+
                 foreach (IPlayer player in Hud.Game.Players)
                 {
                     currentX = XOffset;
@@ -136,7 +143,7 @@
                             case 3:
                                 if (DrawLegendaryItems)
                                 {
-                                    DrawLegItems(player);
+                                    DrawBuffs(player);
                                 }
                                 break;
                         }
@@ -147,12 +154,12 @@
         }

-        private void DrawLegItems(IPlayer player)
+        private void DrawBuffs(IPlayer player)
         {
             foreach (IBuff buff in player.Powers.UsedLegendaryPowers.AllLegendaryPowerBuffs().Where(b => b.Active))
             {
                 IEnumerable<uint> itemSnos = buff.SnoPower.GetItemSnos();
-                if (!itemSnos.Contains(player.CubeSnoItem1.Sno) && !itemSnos.Contains(player.CubeSnoItem2.Sno) && !itemSnos.Contains(player.CubeSnoItem3.Sno)) DrawItem(Hud.Inventory.GetSnoItem(itemSnos.First()), player);
+                if ((itemSnos != null) && !itemSnos.Contains(player.CubeSnoItem1.Sno) && !itemSnos.Contains(player.CubeSnoItem2.Sno) && !itemSnos.Contains(player.CubeSnoItem3.Sno)) DrawItem(Hud.Inventory.GetSnoItem(itemSnos.First()), player);
             }
             currentX += Gap;
         }
@@ -182,15 +189,26 @@

             if (Hud.Window.CursorInsideRect(itemRect.X, itemRect.Y, itemRect.Width, itemRect.Height))
             {
-                var description = snoItem.NameLocalized;
+                var itemName = snoItem.NameLocalized;

                 var power = snoItem.LegendaryPower;
+                var powerDesc = "";
                 if (power != null)
                 {
-                    description += "\n\n" + power.DescriptionLocalized;
-                }
-
-                Hud.Render.SetHint(description);
+                    itemName += "\n\n";
+                    powerDesc = power.DescriptionLocalized;
+                    var patternBegin = powerDesc.IndexOf("{c_magic}");
+                    if(patternBegin!=-1) {
+                        var patternEnd = powerDesc.IndexOf("{/c}") != -1 ? powerDesc.IndexOf("{/c}")+4 : powerDesc.IndexOf("{/c_magic}")+10;
+                        if(patternEnd!= -1) {
+                            var toReplace = powerDesc.Substring(patternBegin,patternEnd-patternBegin);
+                            var replacement = toReplace.Contains("%") ? "X%" : "X";
+                            powerDesc = powerDesc.Replace(toReplace,replacement);
+                        }
+                    }
+                }
+
+                Hud.Render.SetHint(itemName+powerDesc);
             }

             var backgroundTexture = snoItem.ItemHeight == 2 ? Hud.Texture.InventoryLegendaryBackgroundLarge : Hud.Texture.InventoryLegendaryBackgroundSmall;
@@ -300,4 +318,4 @@
             }
         }
     }
-}+}


#17387: Failure to save media from a zip file with directory structure that corresponds to a directory in tenant media folder that does not exist yet.

--HG--
branch : 1.x

--- src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs
+++ src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs
@@ -233,6 +233,11 @@
                 throw new ArgumentException(T("File {0} already exists", fileInfo.Name).ToString());
             }

+            // ensure the directory exists
+            var dirName = Path.GetDirectoryName(fileInfo.FullName);
+            if (!Directory.Exists(dirName)) {
+                Directory.CreateDirectory(dirName);
+            }
             File.WriteAllBytes(fileInfo.FullName, new byte[0]);

             return new FileSystemStorageFile(Fix(path), fileInfo);


Added a comment to new method

Added a comment to new method

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -1008,6 +1008,7 @@
                 Exit();
         }
         protected override IDictionary<FrameworkSetting, object> GetFrameworkConfigDefaults() {
+            // Overriding settings determined by Framework
             IDictionary<FrameworkSetting, object> defaultOverrides = new Dictionary<FrameworkSetting, object>();
             defaultOverrides.Add(FrameworkSetting.WindowMode, WindowMode.Fullscreen);
             return defaultOverrides;


Bring music controller in front of notification overlay

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -355,7 +355,7 @@
             loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, mainContent.Add);
             loadComponentSingleFile(musicController = new MusicController
             {
-                Depth = -4,
+                Depth = -5,
                 Position = new Vector2(0, Toolbar.HEIGHT),
                 Anchor = Anchor.TopRight,
                 Origin = Anchor.TopRight,


Only allow settings or notifications to be visible at once

Resolves #2273.

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -302,6 +302,21 @@
                 };
             }

+            var singleDisplaySideOverlays = new OverlayContainer[] { settings, notifications };
+            foreach (var overlay in singleDisplaySideOverlays)
+            {
+                overlay.StateChanged += state =>
+                {
+                    if (state == Visibility.Hidden) return;
+
+                    foreach (var c in singleDisplaySideOverlays)
+                    {
+                        if (c == overlay) continue;
+                        c.State = Visibility.Hidden;
+                    }
+                };
+            }
+
             // eventually informational overlays should be displayed in a stack, but for now let's only allow one to stay open at a time.
             var informationalOverlays = new OverlayContainer[] { beatmapSetOverlay, userProfile };
             foreach (var overlay in informationalOverlays)


Add ability to change ui scaling via keyboard

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -986,6 +986,31 @@
             return false;
         }

+        public override bool OnPressed(KeyBindingPressEvent<PlatformAction> e)
+        {
+            switch (e.Action)
+            {
+                case PlatformAction.ZoomIn:
+                    adjustUIScaling(1);
+                    return true;
+
+                case PlatformAction.ZoomOut:
+                    adjustUIScaling(-1);
+                    return true;
+
+                case PlatformAction.ZoomDefault:
+                    LocalConfig.GetBindable<float>(OsuSetting.UIScale).SetDefault();
+                    return true;
+            }
+
+            void adjustUIScaling(int amount)
+            {
+                LocalConfig.SetValue(OsuSetting.UIScale, LocalConfig.Get<float>(OsuSetting.UIScale) + (0.05f * amount));
+            }
+
+            return base.OnPressed(e);
+        }
+
         #region Inactive audio dimming

         private readonly BindableDouble inactiveVolumeFade = new BindableDouble();


Raise precedence of assignments against "not" operators.

--- Scripting/Parser/Construct/ParseExpression.cs
+++ Scripting/Parser/Construct/ParseExpression.cs
@@ -193,7 +193,7 @@
                         {
                             if (IsDynamicReference(name))
                                 dynamic = true;
-                            else
+                            else
                                 throw new ParseException("Invalid function name");
                         }

@@ -272,7 +272,7 @@
                                 parts[n] = VarId(((decimal)((CodePrimitiveExpression)parts[n]).Value).ToString());
                             else
 #endif
-                            throw new ParseException("Can only assign to a variable");
+                                throw new ParseException("Can only assign to a variable");
                         }

                         // (x += y) => (x = x + y)
@@ -346,7 +346,7 @@

             #region Operators

-            #region Unary
+            #region Unary (precedent)

             for (int i = 1; i < parts.Count; i++)
             {
@@ -391,6 +391,8 @@

             #endregion

+            #region Generic
+
             bool scan = true;
             int level = -1;

@@ -463,6 +465,12 @@
                         #region Unary
                         else if (x == -1)
                         {
+                            int z = y + 1;
+                            if (op == Script.Operator.LogicalNotEx && parts[y] is CodeComplexVariableReferenceExpression && z < parts.Count)
+                                MergeAssignmentAt(parts, z);
+
+                            // TODO: raise precedence of assignments for other cases (e.g. ++var)
+
                             invoke.Method = (CodeMethodReferenceExpression)InternalMethods.OperateUnary;
                             invoke.Parameters.Add(OperatorAsFieldReference(op));
                             invoke.Parameters.Add(ExpressionNode(parts[y]));
@@ -508,25 +516,11 @@

             #endregion

+            #endregion
+
             #region Assignments
             for (int i = parts.Count - 1; i > 0; i--)
-            {
-                if (parts[i] is CodeComplexAssignStatement)
-                {
-                    int x = i - 1, y = i + 1;
-                    bool right = y < parts.Count;
-
-                    var assign = (CodeComplexAssignStatement)parts[i];
-                    assign.Left = (CodeComplexVariableReferenceExpression)parts[x];
-                    assign.Right = right ? parts[y] is CodeComplexVariableReferenceExpression ?
-                        (CodeMethodInvokeExpression)(CodeComplexVariableReferenceExpression)parts[y] : (CodeExpression)parts[y] : new CodePrimitiveExpression(null);
-                    parts[x] = (CodeMethodInvokeExpression)assign;
-
-                    if (right)
-                        parts.RemoveAt(y);
-                    parts.RemoveAt(i);
-                }
-            }
+                MergeAssignmentAt(parts, i);
             #endregion

             #region Variables
@@ -539,6 +533,25 @@
                 throw new ArgumentOutOfRangeException();

             return (CodeExpression)parts[0];
+        }
+
+        void MergeAssignmentAt(List<object> parts, int i)
+        {
+            if (!(parts[i] is CodeComplexAssignStatement))
+                return;
+
+            int x = i - 1, y = i + 1;
+            bool right = y < parts.Count;
+
+            var assign = (CodeComplexAssignStatement)parts[i];
+            assign.Left = (CodeComplexVariableReferenceExpression)parts[x];
+            assign.Right = right ? parts[y] is CodeComplexVariableReferenceExpression ?
+                (CodeMethodInvokeExpression)(CodeComplexVariableReferenceExpression)parts[y] : (CodeExpression)parts[y] : new CodePrimitiveExpression(null);
+            parts[x] = (CodeMethodInvokeExpression)assign;
+
+            if (right)
+                parts.RemoveAt(y);
+            parts.RemoveAt(i);
         }

         CodeExpression ExpressionNode(object part)


added db initialization todo for discussion with @herecydev

--- test/IdentityServer4.MongoDB.IntegrationTests/DatabaseProviderFixture.cs
+++ test/IdentityServer4.MongoDB.IntegrationTests/DatabaseProviderFixture.cs
@@ -7,6 +7,9 @@
 {
 	public class DatabaseProviderFixture : IDisposable
 	{
+		// TODO: Find a way to intialize MongoDB
+		// Given we don't have the luxury of EF migrations, initialization, nor seeds,
+		// contemplating using some docker integration, such as https://github.com/mariotoffia/FluentDocker
 		public void Dispose()
 		{
 		}


Remove newline

Remove newline

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -1144,7 +1144,6 @@
                         userProfile.Hide();
                         return true;
                     }
-
                     else
                     {
                         ShowUser(new APIUser { Id = API.LocalUser.Value.Id });


Fixed handling of blank successive mutlipart expressions (,,).

--- Scripting/Parser/Construct/ParseExpression.cs
+++ Scripting/Parser/Construct/ParseExpression.cs
@@ -94,15 +94,11 @@
                         break;

                     case Multicast:
-                        if (level == 0)
-                        {
-                            if (sub.Count == 0)
-                                expr.Add(new CodePrimitiveExpression(null));
-                            else
-                            {
-                                expr.Add(ParseExpression(sub));
-                                sub = new List<object>();
-                            }
+                        if (level == 0 && sub.Count != 0)
+                        {
+                            expr.Add(ParseExpression(sub));
+                            sub.Clear();
+                            continue;
                         }
                         break;
                 }


Done VGAScreen api docs

Done VGAScreen api docs

--- source/Cosmos.System2/Graphics/VGAScreen.cs
+++ source/Cosmos.System2/Graphics/VGAScreen.cs
@@ -3,24 +3,92 @@

 namespace Cosmos.System.Graphics
 {
+    /// <summary>
+    /// VGAScreen class. Used to control screen.
+    /// </summary>
     public class VGAScreen
     {
-        public enum TextSize { Size40x25, Size40x50, Size80x25, Size80x50, Size90x30, Size90x60 };
-
+        /// <summary>
+        /// Text size.
+        /// </summary>
+        public enum TextSize {
+            /// <summary>
+            /// 40x25
+            /// </summary>
+            Size40x25,
+            /// <summary>
+            /// 40x50
+            /// </summary>
+            Size40x50,
+            /// <summary>
+            /// 80x25
+            /// </summary>
+            Size80x25,
+            /// <summary>
+            /// 80x50
+            /// </summary>
+            Size80x50,
+            /// <summary>
+            /// 90x30
+            /// </summary>
+            Size90x30,
+            /// <summary>
+            /// 90x60
+            /// </summary>
+            Size90x60 };
+
+        /// <summary>
+        /// Screen size (resolution).
+        /// </summary>
         public enum ScreenSize
         {
+            /// <summary>
+            /// 640x480 graphics mode  - 2 and 4 bit color depth available
+            /// </summary>
             Size640x480,
+
+            /// <summary>
+            /// 720x480 graphics mode  - 16 bit color depth available
+            /// </summary>
             Size720x480,
+
+            /// <summary>
+            /// 320x200 graphics mode  - 4 and 8 bit color depth available
+            /// </summary>
             Size320x200
         };

+        /// <summary>
+        /// Color depth. bits per pixel.
+        /// </summary>
         public enum ColorDepth
         {
-            BitDepth2, BitDepth4, BitDepth8, BitDepth16
+            /// <summary>
+            /// 2 bits per pixel.
+            /// </summary>
+            BitDepth2,
+            /// <summary>
+            /// 4 bits per pixel.
+            /// </summary>
+            BitDepth4,
+            /// <summary>
+            /// 8 bits per pixel.
+            /// </summary>
+            BitDepth8,
+            /// <summary>
+            /// 16 bits per pixel.
+            /// </summary>
+            BitDepth16
         };

         private static HALVGAScreen mScreen = new HALVGAScreen();

+        /// <summary>
+        /// Set graphics mode.
+        /// </summary>
+        /// <param name="screenSize">Screen size.</param>
+        /// <param name="colorDepth">Color depth.</param>
+        /// <exception cref="Exception">Thrown if screen size / color depth not supported.</exception>
         public static void SetGraphicsMode(ScreenSize screenSize, ColorDepth colorDepth)
         {
             HALVGAScreen.ScreenSize ScrSize = HALVGAScreen.ScreenSize.Size320x200;
@@ -62,36 +130,80 @@
             mScreen.SetGraphicsMode(ScrSize, ClrDepth);
         }

+        /// <summary>
+        /// Set pixel color.
+        /// </summary>
+        /// <param name="X">x coordinat.</param>
+        /// <param name="Y">y coordinat.</param>
+        /// <param name="Color">Color to set.</param>
         public static void SetPixel(uint X, uint Y, uint Color)
         {
             mScreen.SetPixel(X, Y, Color);
         }

+        /// <summary>
+        /// Clear screen, and paint in in color.
+        /// </summary>
+        /// <param name="Color">Color to set the screen to.</param>
         public static void Clear(int Color)
         {
             mScreen.Clear(Color);
         }

+        /// <summary>
+        /// Test mode 320x200x8
+        /// </summary>
+        /// <exception cref="Exception">
+        /// <list type="bullet">
+        /// <item>Thrown when color depth not supported for the size.</item>
+        /// <item>Unknown screen size.</item>
+        /// <item>Memory error.</item>
+        /// </list>
+        /// </exception>
         public static void TestMode320x200x8()
         {
             mScreen.TestMode320x200x8();
         }

+        /// <summary>
+        /// Set palette.
+        /// </summary>
+        /// <param name="Index">Index.</param>
+        /// <param name="Palette">Palette.</param>
+        /// <exception cref="OverflowException">The array contains more than Int32.MaxValue elements.</exception>
         public static void SetPalette(int Index, byte[] Palette)
         {
             mScreen.SetPalette(Index, Palette);
         }

+        /// <summary>
+        /// Set palette entry.
+        /// </summary>
+        /// <param name="index">Index.</param>
+        /// <param name="r">Red.</param>
+        /// <param name="g">Green.</param>
+        /// <param name="b">Blue.</param>
         public static void SetPaletteEntry(int Index, byte R, byte G, byte B)
         {
             mScreen.SetPaletteEntry(Index, R, G, B);
         }

+        /// <summary>
+        /// Get pixel.
+        /// </summary>
+        /// <param name="X">x coordinat.</param>
+        /// <param name="Y">y coordinat.</param>
+        /// <returns>uint value.</returns>
         public static uint GetPixel(uint X, uint Y)
         {
             return mScreen.GetPixel(X, Y);
         }

+        /// <summary>
+        /// Set text mode.
+        /// </summary>
+        /// <param name="Size">Text size.</param>
+        /// <exception cref="Exception">Thrown when text size invalid / unable to determine memory segment.</exception>
         public static void SetTextMode(TextSize Size)
         {
             switch (Size)
@@ -119,10 +231,19 @@
             }
         }

+        /// <summary>
+        /// Get pixel height.
+        /// </summary>
         public static int PixelHeight = mScreen.PixelHeight;

+        /// <summary>
+        /// Get pixel width.
+        /// </summary>
         public static int PixelWidth = mScreen.PixelWidth;

+        /// <summary>
+        /// Get colors.
+        /// </summary>
         public static int Colors = mScreen.Colors;
     }
 }


Replaced lz4 compression lib LZ4PCL -> LZ4

--- source/ElasticsearchInside/Elasticsearch.cs
+++ source/ElasticsearchInside/Elasticsearch.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Diagnostics;
 using System.IO;
+using System.IO.Compression;
 using System.Net;
 using System.Net.Http;
 using System.Reflection;
@@ -11,8 +12,8 @@
 using ElasticsearchInside.Executables;
 using ElasticsearchInside.Utilities;
 using ElasticsearchInside.Utilities.Archive;
-using LZ4PCL;
-using CompressionMode = LZ4PCL.CompressionMode;
+using LZ4;
+

 namespace ElasticsearchInside
 {


add precondition code contract

add precondition code contract

--- GFDN.ThaiBahtText/ThaiBahtTextUtil.cs
+++ GFDN.ThaiBahtText/ThaiBahtTextUtil.cs
@@ -1,6 +1,6 @@
 using System;
 using System.Diagnostics.Contracts;
-using System.Text;
+using System.Text;

 namespace GreatFriends.ThaiBahtText {

@@ -40,12 +40,13 @@
     /// <returns>ข้อความจำนวนเงินภาษาไทย</returns>
     public static string ThaiBahtText(this decimal? amount,
                                       ThaiBahtTextOptions options) {
-      Contract.Ensures(Contract.Result<string>() != null);
-      Contract.Ensures(Contract.Result<string>().Length > 0);
-
-      return ThaiBahtText(amount.HasValue ? amount.Value : 0m,
-                          options.Mode,
-                          options.Unit,
+      Contract.Requires(options != null);
+      Contract.Ensures(Contract.Result<string>() != null);
+      Contract.Ensures(Contract.Result<string>().Length > 0);
+
+      return ThaiBahtText(amount.HasValue ? amount.Value : 0m,
+                          options.Mode,
+                          options.Unit,
                           options.AppendBahtOnly);
     }

@@ -58,6 +59,7 @@
     /// <returns>ข้อความจำนวนเงินภาษาไทย</returns>
     public static string ThaiBahtText(this decimal amount,
                                   ThaiBahtTextOptions options) {
+      Contract.Requires(options != null);
       Contract.Ensures(Contract.Result<string>() != null);
       Contract.Ensures(Contract.Result<string>().Length > 0);

@@ -94,9 +96,9 @@
     /// <param name="unit">หน่วยของจำนวนเงิน</param>
     /// <param name="appendBahtOnly">เพิ่มคำว่า 'ถ้วน' ท้ายข้อความ</param>
     /// <returns>ข้อความจำนวนเงินภาษาไทย</returns>
-    public static string ThaiBahtText(this decimal amount,
-                                      UsesEt mode = UsesEt.TensOnly,
-                                      Unit unit = Unit.Baht,
+    public static string ThaiBahtText(this decimal amount,
+                                      UsesEt mode = UsesEt.TensOnly,
+                                      Unit unit = Unit.Baht,
                                       bool appendBahtOnly = true) {
       Contract.Ensures(Contract.Result<string>() != null);
       Contract.Ensures(Contract.Result<string>().Length > 0);
@@ -123,13 +125,13 @@
       if (parts[0].Length > 0) {
         speakTo(result, parts[0], mode);
         result.Append("ล้าน");
-      }
+      }

       if (parts[1].Length > 0) {
         speakTo(result, parts[1], mode);
         result.Append("ล้าน");
       }
-
+
       if (parts[2].Length > 0) {
         speakTo(result, parts[2], mode);
         result.Append("บาท");
@@ -155,27 +157,27 @@

       string text;
       string s1 = string.Empty;
-      string s2 = string.Empty;
-      string s3;
-      string s4;
+      string s2 = string.Empty;
+      string s3;
+      string s4;
       int position;

       text = amount.ToString("#.00");

       position = text.IndexOf('.');
-
+
       s3 = text.Substring(0, position);
       s4 = text.Substring(position + 1);
       if (s4 == "00") {
         s4 = string.Empty;
-      }
+      }

       int length = s3.Length;
       if (length > 6) {
         s2 = s3.Substring(0, length - 6);
         s3 = s3.Substring(length - 6);
       }
-
+
       length = s2.Length;
       if (length > 6) {
         s1 = s2.Substring(0, length - 6);
@@ -193,8 +195,8 @@
     private static void speakTo(StringBuilder sb, string text, UsesEt mode) {
       Contract.Requires(text != null);
       Contract.Requires(text.Length > 0);
-
-      int length = text.Length;
+
+      int length = text.Length;
       int c = 0;
       int lastc = -1;
       bool negative = false;


Notify for correct property when EffectiveCulture changes.

--- Gu.Localization/Translator.Culture.cs
+++ Gu.Localization/Translator.Culture.cs
@@ -82,7 +82,7 @@

                 effectiveCulture = value;
                 OnCurrentCultureChanged(value);
-                StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(nameof(CurrentCulture)));
+                StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(nameof(EffectiveCulture)));
             }
         }


Change PatchCycle3 test

Change PatchCycle3 test

--- HarmonyTests/Patching/PatchSorting.cs
+++ HarmonyTests/Patching/PatchSorting.cs
@@ -154,7 +154,7 @@
 					$"#{i} Expected: {patches[expectedOrder[i]].FullDescription()}, Got: {methods[i].FullDescription()}");
 		}

-		// Test with 2 crossdependant cyclic dependencies.
+		// Test with 2 crossdependant cyclic dependencies. Impossible to break any cycle with just 1 cut.
 		[TestMethod]
 		public void PatchCycle3()
 		{
@@ -169,12 +169,12 @@
 				new Patch(patches[2], 2, "owner C", Priority.Normal, new[] {"owner B"}, new string[0]),
 				new Patch(patches[3], 3, "owner D", Priority.Normal, new string[0], new string[0]),
 				new Patch(patches[4], 4, "owner E", Priority.First, new string[0], new string[0]),
-				new Patch(patches[5], 5, "owner F", Priority.High, new string[0], new[] {"owner G", "owner B"}),
+				new Patch(patches[5], 5, "owner F", Priority.Low, new []{"owner C", "owner H"}, new[] {"owner G", "owner B"}),
 				new Patch(patches[6], 6, "owner G", Priority.Normal, new string[0], new[] {"owner H"}),
 				new Patch(patches[7], 7, "owner H", Priority.Normal, new string[0], new[] {"owner F"})
 			};

-			var expectedOrder = new[] {4, 3, 7, 6, 2, 1, 5, 0};
+			var expectedOrder = new[] { 4, 3, 5, 7, 6, 2, 1, 0 };
 			var methods = PatchFunctions.GetSortedPatchMethods(null, patchInstances);
 			for (var i = 0; i < expectedOrder.Length; i++)
 				Assert.AreSame(patches[expectedOrder[i]], methods[i],


Updating download urls.

Updating download urls.

--- trunk/WebExtras.DemoApp/Views/Home/Download.cshtml
+++ trunk/WebExtras.DemoApp/Views/Home/Download.cshtml
@@ -5,14 +5,14 @@

-    @(Html.Hyperlink(" Stable", "http://mihirmone.dyndns.org/downloads/webextras/latest-stable.zip")
+    @(Html.Hyperlink(" Stable (v1.1.0)", "http://mihirmone.dyndns.org/app-downloads/webextras/webextras-1.1.0.zip")
       .AddCssClass("btn-large")
       .AsButton(EBootstrapButton.Success)
       .AddWhiteIcon(EFontAwesomeIcon.Download_Alt, EFontAwesomeIconSize.Large))

-    @(Html.Hyperlink(" Nightly", "http://mihirmone.dyndns.org/downloads/webextras/latest-nightly.zip")
+    @(Html.Hyperlink(" Nightly", "http://mihirmone.dyndns.org/app-downloads/webextras/webextras-nightly.zip")
       .AddCssClass("btn-large").AsButton()
       .AddIcon(EFontAwesomeIcon.Download_Alt, EFontAwesomeIconSize.Large))


Adding consts for Statuses, and minor documentation fixes

--- Source/Coinbase/Models/Objects.cs
+++ Source/Coinbase/Models/Objects.cs
@@ -124,6 +124,9 @@
       [JsonProperty("type")]
       public string Type { get; set; }

+      /// <summary>
+      /// Status can be comapred using <see cref="TransactionStatus"/>
+      /// </summary>
       [JsonProperty("status")]
       public string Status { get; set; }

@@ -651,6 +654,9 @@

    public partial class Notification : Entity
    {
+      /// <summary>
+      /// Types can be compared using <see cref="NotificationEventNames"/>
+      /// </summary>
       [JsonProperty("type")]
       public string Type { get; set; }

@@ -769,5 +775,42 @@
       public const string WalletWithdrawalCanceled = "wallet:withdrawal:canceled";
    }

+   public class TransactionStatus
+   {
+      /// <summary>
+      /// Pending transactions (e.g.a send or a buy)
+      /// </summary>
+      public const string Pending = "pending";
+
+      /// <summary>
+      /// Completed transactions(e.g.a send or a buy)
+      /// </summary>
+      public const string Completed = "completed";
+
+      /// <summary>
+      /// Failed transactions(e.g.failed buy)s
+      /// </summary>
+      public const string Failed = "failed";
+
+      /// <summary>
+      /// Conditional transaction expired due to external factors
+      /// </summary>
+      public const string Expired = "expired";
+
+      /// <summary>
+      /// Transaction was canceled
+      /// </summary>
+      public const string Canceled = "canceled";
+
+      /// <summary>
+      /// Vault withdrawal is waiting for approval
+      /// </summary>
+      public const string WaitingForSignature = "waiting_for_signature";
+
+      /// <summary>
+      /// Vault withdrawal is waiting to be cleared
+      /// </summary>
+      public const string WaitingForClearing = "waiting_for_clearing";
+   }

 }


Compilation fix

Compilation fix

--- PART/Source/CprBroker/Tracking.Tests/Properties/AssemblyInfo.cs
+++ PART/Source/CprBroker/Tracking.Tests/Properties/AssemblyInfo.cs
@@ -1,6 +1,7 @@
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
+using CprBroker.Utilities;

 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information


Check for the exception message in the loop test

--- Gu.Inject.Tests/KernelTests.cs
+++ Gu.Inject.Tests/KernelTests.cs
@@ -36,9 +36,9 @@
             }
         }

-        [TestCase(typeof(A))]
-        [TestCase(typeof(Circular.A))]
-        public void Loop(Type t)
+        [TestCase(typeof(A), "Circular dependency detected A -> B -> A")]
+        [TestCase(typeof(Circular.A), "Circular dependency detected A -> E -> G -> A")]
+        public void Loop(Type t, string message)
         {
             using (var kernel = new Kernel())
             {
@@ -46,7 +46,7 @@
                 {
                     var actual = kernel.Get(t);
                 });
-                Console.WriteLine(exception.Message);
+                Assert.AreEqual(message, exception.Message);
             }
         }


Removed link from "Velkominn notandi"

Removed link from "Velkominn notandi"

--- Skermstafir/Views/Shared/_LoginPartial.cshtml
+++ Skermstafir/Views/Shared/_LoginPartial.cshtml
@@ -7,7 +7,7 @@

-			@Html.ActionLink("Velkomin(n) " + User.Identity.GetUserName(), "Index", "Home")
+			@("Velkomin(n) " + User.Identity.GetUserName() + "!")

@Html.ActionLink("Mínar síður", "Manage", "Account", routeValues: null, htmlAttributes: new { title = "Manage" })

Útskrá


Þýðingar fixed

Þýðingar fixed

--- Skermstafir/Views/Shared/_SearchResult.cshtml
+++ Skermstafir/Views/Shared/_SearchResult.cshtml
@@ -18,30 +18,11 @@
 				▲
 				@sub.Name
 				@sub.YearCreated
-				User
-				@sub.Language.Name
+				Tungumál
+				UserName
 				▼
-				NOT IMPL
+				Niðurhöl

-<<<<<<< HEAD
 		}

-=======
-

-

-			@for (int i = 0; i < Model.modelList.Count; i++)
-			{
-

-
▲
 @Model.modelList[i].votes
-					@Model.modelList[i].name
-					@Model.modelList[i].yearCreated
-					@Model.modelList[i].language
-					@Model.modelList[i].user
-					▼
-					@Model.modelList[i].downloads
-

-			}
-

->>>>>>> 4be52bc1ef7c2d7fdb466599853d340e2f213a40
-


Added Error Summary box to confirm identity page

--- src/SFA.DAS.EmployerUsers.Web/Views/Account/Confirm.cshtml
+++ src/SFA.DAS.EmployerUsers.Web/Views/Account/Confirm.cshtml
@@ -5,6 +5,17 @@
     ViewBag.HideSigninLink = "true";

     var invalidAttributes = Model.Data.Valid ? "aria-invalid=\"true\" aria-labeledby=\"invalidMessage\"" : "";
+}
+
+@if (!Model.Data.Valid)
+{
+

+
 Errors to fix

+
Check the following details:

+

+
Invalid code

+

+

 }

Confirm your identity


Jordan/Simon 730/732 Added metadescription to events calendar

--- src/StockportWebapp/Views/stockportgov/Events/Index.cshtml
+++ src/StockportWebapp/Views/stockportgov/Events/Index.cshtml
@@ -6,7 +6,7 @@
     var category = Model.Homepage.Categories.Where(c => c.Slug == Model.Category).FirstOrDefault();
     ViewData["og:title"] = string.IsNullOrWhiteSpace(Model.Category) ? "What's on in Stockport" : category == null ? Model.Category : category.Name;
     ViewData["Title"] = ViewData["og:title"];
-    ViewData["Description"] = Model.MetaDescription;
+    ViewData["Description"] = "Whats on in Stockport"
     Layout = "../Shared/_Layout.cshtml";
 }


Added a fail test for a connector without a parameterless ctor

--- src/Tests/DevOpsFlex.Core.Tests/DiscoveryExtensionsTest.cs
+++ src/Tests/DevOpsFlex.Core.Tests/DiscoveryExtensionsTest.cs
@@ -1,7 +1,12 @@
 using System;
+using System.IO;
+using System.Linq;
+using System.Reflection;
 using DevOpsFlex.Core;
 using DevOpsFlex.Tests.Core;
 using FluentAssertions;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
 using Xunit;

 // ReSharper disable once CheckNamespace
@@ -12,15 +17,65 @@
         [Fact, IsUnit]
         public void Test_GetSinglePull()
         {
-            var result = new[] { GetType().Assembly }.GetConnectors<IPullTelemetry>();
+            var result = new[] { GetType().Assembly }.GetConnectors<IPullTelemetry>().ToList();
             result.Should().ContainSingle(c => c.GetType() == typeof(TestPullConnector));
         }

         [Fact, IsUnit]
         public void Test_GetSinglePush()
         {
-            var result = new[] {GetType().Assembly}.GetConnectors<IPushTelemetry>();
+            var result = new[] { GetType().Assembly }.GetConnectors<IPushTelemetry>().ToList();
             result.Should().ContainSingle(c => c.GetType() == typeof(TestPushConnector));
+        }
+
+        [Fact, IsUnit]
+        public void Ensure_GetSinglePush_InvalidCtor_Throws()
+        {
+            using (var ms = new MemoryStream())
+            {
+                var code = CSharpSyntaxTree.ParseText($@"
+                    using System;
+                    using DevOpsFlex.Core;
+
+                    namespace {nameof(DevOpsFlex)}.{nameof(DiscoveryExtensionsTest)}.InvalidConnector
+                    {{
+                        public class {nameof(DiscoveryExtensionsTest)}InvalidConnector  : IPushTelemetry
+                        {{
+                            public {nameof(DiscoveryExtensionsTest)}InvalidConnector(string badParam)
+                            {{
+                            }}
+
+                            public IObserver<BbEvent> Connect()
+                            {{
+                                throw new NotImplementedException();
+                            }}
+                        }}
+                    }}");
+
+                var compilationOld = CSharpCompilation.Create(
+
+                    $"{nameof(DevOpsFlex)}.{nameof(DiscoveryExtensionsTest)}.InvalidConnector",
+                    new[] { code },
+                    new[]
+                    {
+                        MetadataReference.CreateFromFile(typeof(object).Assembly.Location),
+                        MetadataReference.CreateFromFile(typeof(IPushTelemetry).Assembly.Location)
+                    },
+
+                    new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
+
+                var compilationResult = compilationOld.Emit(ms);
+                Assert.True(compilationResult.Success, $"OldReference assembly generation failed, inspect {nameof(compilationResult)}.Diagnostics");
+
+                ms.Seek(0, SeekOrigin.Begin);
+
+                var asm = Assembly.Load(ms.ToArray());
+
+                // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
+                Action act = () => new[] { asm }.GetConnectors<IPushTelemetry>().ToList();
+                act.ShouldThrow<InvalidOperationException>();
+            }
+
         }
     }
 }