Quick fix to make the estate ban list effective again, when the region crossing is also a sim crossing. Prevents the CAPS handler from being set up for a banned user,making them redmap out. Dirty hack, temporary until I can work out how to do it right.

--- OpenSim/Region/Environment/Scenes/Scene.cs
+++ OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2474,6 +2474,8 @@
         /// <param name="capsObjectPath"></param>
         public void AddCapsHandler(LLUUID agentId)
         {
+			if(RegionInfo.EstateSettings.IsBanned(agentId))
+				return;
             String capsObjectPath = GetCapsPath(agentId);

             m_log.DebugFormat(


Usings

Usings

--- PSql.Core/_Utilities/SqlCmdPreprocessor.cs
+++ PSql.Core/_Utilities/SqlCmdPreprocessor.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;


Added ObjectPropertiesFamily PropertiesFamily; to LLObject

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@919 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife-cs/LLObject.cs
+++ libsecondlife-cs/LLObject.cs
@@ -245,6 +245,8 @@
         public LLQuaternion Rotation = LLQuaternion.Identity;
         ///
         public TextureEntry Textures = new TextureEntry();
+        ///
+        public ObjectPropertiesFamily PropertiesFamily;

         #endregion Public Properties


Add missing root to test URLs

Add missing root to test URLs

--- tests/HttpQueryTests.cs
+++ tests/HttpQueryTests.cs
@@ -18,7 +18,7 @@
         {
             var tt = new TestTransport().EnqueueText(string.Empty);

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Accept("text/plain");

             // Succeeds if it doesn't throw.
@@ -29,7 +29,7 @@
         {
             var tt = new TestTransport().EnqueueJson("{}");

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Accept("text/json", "application/json");

             // Succeeds if it doesn't throw.
@@ -41,7 +41,7 @@
             var tt = new TestTransport().EnqueueText("foo");

             Assert.ThrowsAsync<Exception>(() =>
-                tt.Http.Get(new Uri("https://www.example.com"))
+                tt.Http.Get(new Uri("https://www.example.com/"))
                     .Accept("text/html")
                     .ToTask());
         }
@@ -51,11 +51,11 @@
         {
             var tt = new TestTransport().Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"));
+            await tt.Http.Get(new Uri("https://www.example.com/"));
             var request = tt.DequeueRequestMessage();

             Assert.That(request.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request.Headers, Is.Empty);
         }

@@ -65,11 +65,11 @@
             var tt = new TestTransport(HttpConfig.Default.WithHeaders(HttpHeaderCollection.Empty));
             tt.Enqueue(new byte[0]);

-            await tt.Http.SetHeader("foo", "bar").Get(new Uri("https://www.example.com"));
+            await tt.Http.SetHeader("foo", "bar").Get(new Uri("https://www.example.com/"));
             var request = tt.DequeueRequest((m, c) => new { Message = m, c.Headers });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));

             Assert.That(tt.Http.Config.Headers, Is.Empty);
             Assert.That(request.Headers.Single().Key, Is.EqualTo("foo"));
@@ -82,7 +82,7 @@
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.NotFound);

             Assert.ThrowsAsync<HttpRequestException>(() =>
-                tt.Http.Get(new Uri("https://www.example.com")).ToTask());
+                tt.Http.Get(new Uri("https://www.example.com/")).ToTask());
         }

         [Test]
@@ -90,10 +90,10 @@
         {
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.NotFound);

-            var result = await tt.Http.Get(new Uri("https://www.example.com"))
+            var result = await tt.Http.Get(new Uri("https://www.example.com/"))
                                    .ReturnErrorneousFetch();

-            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.NotFound));
         }

@@ -103,7 +103,7 @@
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.NotImplemented);

             Assert.ThrowsAsync<HttpRequestException>(() =>
-                tt.Http.Get(new Uri("https://www.example.com")).ToTask());
+                tt.Http.Get(new Uri("https://www.example.com/")).ToTask());
         }

         [Test]
@@ -111,10 +111,10 @@
         {
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.NotImplemented);

-            var result = await tt.Http.Get(new Uri("https://www.example.com"))
+            var result = await tt.Http.Get(new Uri("https://www.example.com/"))
                                    .ReturnErrorneousFetch();

-            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.NotImplemented));
         }

@@ -124,7 +124,7 @@
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.BadGateway);

             Assert.ThrowsAsync<HttpRequestException>(() =>
-                tt.Http.Get(new Uri("https://www.example.com")).ToTask());
+                tt.Http.Get(new Uri("https://www.example.com/")).ToTask());
         }

         [Test]
@@ -132,10 +132,10 @@
         {
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.BadGateway);

-            var result = await tt.Http.Get(new Uri("https://www.example.com"))
+            var result = await tt.Http.Get(new Uri("https://www.example.com/"))
                                    .ReturnErrorneousFetch();

-            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.BadGateway));
         }

@@ -145,7 +145,7 @@
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.GatewayTimeout);

             Assert.ThrowsAsync<HttpRequestException>(() =>
-                tt.Http.Get(new Uri("https://www.example.com")).ToTask());
+                tt.Http.Get(new Uri("https://www.example.com/")).ToTask());
         }

         [Test]
@@ -153,10 +153,10 @@
         {
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.GatewayTimeout);

-            var result = await tt.Http.Get(new Uri("https://www.example.com"))
+            var result = await tt.Http.Get(new Uri("https://www.example.com/"))
                                    .ReturnErrorneousFetch();

-            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.GatewayTimeout));
         }

@@ -166,7 +166,7 @@
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.Forbidden);

             Assert.ThrowsAsync<HttpRequestException>(() =>
-                tt.Http.Get(new Uri("https://www.example.com")).ToTask());
+                tt.Http.Get(new Uri("https://www.example.com/")).ToTask());
         }

         [Test]
@@ -174,10 +174,10 @@
         {
             var tt = new TestTransport().Enqueue(new byte[0], HttpStatusCode.Forbidden);

-            var result = await tt.Http.Get(new Uri("https://www.example.com"))
+            var result = await tt.Http.Get(new Uri("https://www.example.com/"))
                                    .ReturnErrorneousFetch();

-            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(result.RequestUrl, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.Forbidden));
         }

@@ -195,14 +195,14 @@
                     Content = new ByteArrayContent(new byte[0]),
                 });

-            var result = await tt.Http.Get(new Uri("https://www.example.com"))
+            var result = await tt.Http.Get(new Uri("https://www.example.com/"))
                                    .Get(new Uri("https://www.example.com/page"));

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
             var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
             Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/page")));
             Assert.That(result.Client.Config.Cookies.Single().Name, Is.EqualTo("foo"));
@@ -231,15 +231,15 @@
                     Content = new ByteArrayContent(new byte[0]),
                 });

-            var result = await tt.Http.Get(new Uri("https://www.example.com"))
-                                   .Get(new Uri("https://www.google.com"));
-            var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-            var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-
-            Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
-            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.google.com")));
+            var result = await tt.Http.Get(new Uri("https://www.example.com/"))
+                                   .Get(new Uri("https://www.google.com/"));
+            var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+            var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+
+            Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
+            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.google.com/")));
             Assert.That(result.Client.Config.Cookies.Single(c => c.Domain.Equals("www.example.com")).Name, Is.EqualTo("foo"));
             Assert.That(result.Client.Config.Cookies.Single(c => c.Domain.Equals("www.example.com")).Value, Is.EqualTo("bar"));
             Assert.That(result.Client.Config.Cookies.Single(c => c.Domain.Equals("www.google.com")).Name, Is.EqualTo("foo"));
@@ -255,22 +255,22 @@
                 {
                     Headers =
                     {
-                        { "Set-Cookie", "foo=bar;Domain=example.com" }
+                        { "Set-Cookie", "foo=bar;Domain=example.com/" }
                     },
                     Content = new ByteArrayContent(new byte[0]),
                 });

             var result = await
-                tt.Http.Get(new Uri("https://www.example.com"))
-                               .Get(new Uri("https://mail.example.com"));
-
-            var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-            var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-
-            Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
-            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://mail.example.com")));
+                tt.Http.Get(new Uri("https://www.example.com/"))
+                               .Get(new Uri("https://mail.example.com/"));
+
+            var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+            var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+
+            Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
+            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://mail.example.com/")));
             Assert.That(result.Client.Config.Cookies.Single().Name, Is.EqualTo("foo"));
             Assert.That(result.Client.Config.Cookies.Single().Value, Is.EqualTo("bar"));
         }
@@ -281,11 +281,11 @@
             var tt = new TestTransport(HttpConfig.Default.WithHeader("name1", "value1"))
                 .Enqueue(new byte[0]);

-            await tt.Http.SetHeader("name2", "value2").Get(new Uri("https://www.example.com"));
+            await tt.Http.SetHeader("name2", "value2").Get(new Uri("https://www.example.com/"));
             var request = tt.DequeueRequest((m, c) => new { Message = m, c.Headers });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));

             Assert.That(tt.Http.Config.Headers.Single().Key, Is.EqualTo("name1"));
             Assert.That(tt.Http.Config.Headers.Single().Value.Single(), Is.EqualTo("value1"));
@@ -299,11 +299,11 @@
             var tt = new TestTransport(HttpConfig.Default.WithHeader("foo", "bar"))
                 .Enqueue(new byte[0]);

-            await tt.Http.SetHeader("foo", "bar").Get(new Uri("https://www.example.com"));
+            await tt.Http.SetHeader("foo", "bar").Get(new Uri("https://www.example.com/"));
             var request = tt.DequeueRequest((m, c) => new { Message = m, c.Headers });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));

             Assert.That(request.Headers.Single().Key, Is.EqualTo("foo"));
             Assert.That(request.Headers.Single().Value.Single(), Is.EqualTo("bar"));
@@ -316,14 +316,14 @@
                 .Enqueue(new byte[0])
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Get(new Uri("https://www.example.com/page"));
             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
             var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
             Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/page")));
             Assert.That(request1.Config, Is.SameAs(HttpConfig.Default));
             Assert.That(request2.Config, Is.SameAs(HttpConfig.Default));
@@ -337,7 +337,7 @@
                 .Enqueue(new byte[0]);

             await tt.Http.SetHeader("h1", "v1")
-                         .Get(new Uri("https://www.example.com"))
+                         .Get(new Uri("https://www.example.com/"))
                          .SetHeader("h2", "v2")
                          .Get(new Uri("https://www.example.com/page"));

@@ -346,7 +346,7 @@

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
             Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/page")));

             Assert.That(request1.Headers.Single().Key, Is.EqualTo("h1"));
@@ -362,7 +362,7 @@
                 .Enqueue(new byte[0])
                 .Enqueue(new byte[0]);

-            await tt.Http.SetHeader("h1", "v1").Get(new Uri("https://www.example.com"));
+            await tt.Http.SetHeader("h1", "v1").Get(new Uri("https://www.example.com/"));
             await tt.Http.SetHeader("h2", "v2").Get(new Uri("https://www.example.com/page"));

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, c.Headers });
@@ -370,7 +370,7 @@

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
             Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/page")));

             Assert.That(request1.Headers.Single().Key, Is.EqualTo("h1"));
@@ -386,11 +386,11 @@
                 .Enqueue(new byte[0])
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"));
+            await tt.Http.Get(new Uri("https://www.example.com/"));
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c});

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request.Config.Headers.Single().Key, Is.EqualTo("foo"));
             Assert.That(request.Config.Headers.Single().Value.Single(), Is.EqualTo("bar"));
         }
@@ -401,11 +401,11 @@
             var tt = new TestTransport(HttpConfig.Default.WithUserAgent("Spider/1.0"))
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"));
-            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-
-            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            await tt.Http.Get(new Uri("https://www.example.com/"));
+            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+
+            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request.Config.UserAgent, Is.EqualTo("Spider/1.0"));
         }

@@ -416,11 +416,11 @@
             var tt = new TestTransport(HttpConfig.Default.WithCredentials(credentials))
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"));
-            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-
-            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            await tt.Http.Get(new Uri("https://www.example.com/"));
+            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+
+            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request.Config.Credentials, Is.SameAs(credentials));
         }

@@ -430,11 +430,11 @@
             var tt = new TestTransport(HttpConfig.Default.WithTimeout(new TimeSpan(0, 1, 0)))
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"));
-            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-
-            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            await tt.Http.Get(new Uri("https://www.example.com/"));
+            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+
+            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request.Config.Timeout, Is.EqualTo(new TimeSpan(0, 1, 0)));
         }

@@ -444,11 +444,11 @@
             var tt = new TestTransport(HttpConfig.Default.WithCookies(new[] { new Cookie("name", "value") }))
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"));
-            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
-
-            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            await tt.Http.Get(new Uri("https://www.example.com/"));
+            var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
+
+            Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request.Config.Cookies.Single(), Is.EqualTo(new Cookie("name", "value")));
         }

@@ -459,7 +459,7 @@
                 .Enqueue(new byte[0])
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Get(new Uri("https://www.example.com/page"));

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
@@ -467,7 +467,7 @@

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
             Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/page")));
             Assert.That(request1.Config.Cookies.Single(), Is.EqualTo(new Cookie("name", "value")));
             Assert.That(request2.Config.Cookies.Single(), Is.EqualTo(new Cookie("name", "value")));
@@ -481,11 +481,11 @@

             var data = new NameValueCollection { ["name"] = "value" };

-            await tt.Http.Post(new Uri("https://www.example.com"), data);
+            await tt.Http.Post(new Uri("https://www.example.com/"), data);
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Post));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));

             Assert.That(request.Config.Headers, Is.Empty);
             Assert.That(await request.Message.Content.ReadAsStringAsync(), Is.EqualTo("name=value"));
@@ -499,11 +499,11 @@

             var data = new NameValueCollection { ["name"] = "value" };

-            await tt.Http.Post(new Uri("https://www.example.com"), data);
+            await tt.Http.Post(new Uri("https://www.example.com/"), data);
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Post));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));

             Assert.That(request.Config.Headers, Is.Empty);
             Assert.That(await request.Message.Content.ReadAsStringAsync(), Is.EqualTo("name=value"));
@@ -520,11 +520,11 @@
                 ["name2"] = "value2",
             };

-            await tt.Http.Post(new Uri("https://www.example.com"), data);
+            await tt.Http.Post(new Uri("https://www.example.com/"), data);
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Post));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));

             Assert.That(request.Config.Headers, Is.Empty);
             Assert.That(await request.Message.Content.ReadAsStringAsync(), Is.EqualTo("name1=value1&name2=value2"));
@@ -537,11 +537,11 @@

             var data = new NameValueCollection { ["foo&bar"] = "baz" };

-            await tt.Http.Post(new Uri("https://www.example.com"), data);
+            await tt.Http.Post(new Uri("https://www.example.com/"), data);
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Post));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));

             Assert.That(request.Config.Headers, Is.Empty);
             Assert.That(await request.Message.Content.ReadAsStringAsync(), Is.EqualTo("foo%26bar=baz"));
@@ -550,7 +550,7 @@
         [Test]
         public async Task SubmitNoFormNoInputTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var tt = new TestTransport()
                 .EnqueueHtml(
                     "<!DOCTYPE html>" +
@@ -565,22 +565,22 @@
                     "</html>")
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Submit(0, null);

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
             var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
-            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com" + action)));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
+            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri(new Uri("https://www.example.com/"), action)));
         }

         [Test]
         public async Task SubmitDefaultMethodIsGetTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var tt = new TestTransport()
                 .EnqueueHtml(
                     "<!DOCTYPE html>" +
@@ -601,22 +601,22 @@
                 ["lastname"] = "Mouse"
             };

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                                  .Submit(0, data);

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
             var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
-            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com" + action + "?firstname=Mickey&lastname=Mouse")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
+            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri(new Uri("https://www.example.com/"), action + "?firstname=Mickey&lastname=Mouse")));
         }

         [Test]
         public async Task SubmitInputTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var tt = new TestTransport()
                 .EnqueueHtml(
                     "<!DOCTYPE html>" +
@@ -636,23 +636,23 @@
                     "</html>")
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Submit(0, null);

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
             var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
-            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com" + action + "?firstname=Mickey&lastname=Mouse")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
+            Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Get));
+            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri(new Uri("https://www.example.com/"), action + "?firstname=Mickey&lastname=Mouse")));
         }

         [Test]
         public async Task SubmitInputPostTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var tt = new TestTransport()
                 .EnqueueHtml(
                     "<!DOCTYPE html>" +
@@ -672,16 +672,16 @@
                     "</html>")
                 .Enqueue(new byte[0]);

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Submit(0, null);

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
             var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Post));
-            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com" + action)));
+            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri(new Uri("https://www.example.com/"), action)));
             Assert.That(await request2.Message.Content.ReadAsStringAsync(), Is.EqualTo("firstname=Mickey&lastname=Mouse"));
             Assert.That(request2.Message.Content.Headers.GetValues("Content-Type").Single(), Is.EqualTo("application/x-www-form-urlencoded"));
         }
@@ -689,7 +689,7 @@
         [Test]
         public async Task SubmitPostTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var tt = new TestTransport()
                 .EnqueueHtml(
                     "<!DOCTYPE html>" +
@@ -710,16 +710,16 @@
                 ["lastname"] = "Mouse"
             };

-            await tt.Http.Get(new Uri("https://www.example.com"))
+            await tt.Http.Get(new Uri("https://www.example.com/"))
                          .Submit(0, data);

             var request1 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });
             var request2 = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request1.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com")));
+            Assert.That(request1.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com/")));
             Assert.That(request2.Message.Method, Is.EqualTo(HttpMethod.Post));
-            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.com" + action)));
+            Assert.That(request2.Message.RequestUri, Is.EqualTo(new Uri(new Uri("https://www.example.com/"), action)));
             Assert.That(await request2.Message.Content.ReadAsStringAsync(), Is.EqualTo("firstname=Mickey&lastname=Mouse"));
             Assert.That(request2.Message.Content.Headers.GetValues("Content-Type").Single(), Is.EqualTo("application/x-www-form-urlencoded"));
         }
@@ -727,7 +727,7 @@
         [Test]
         public async Task SubmitToInputTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var html = "<!DOCTYPE html>" +
                                                  "<html>" +
                                                  "<body>" +
@@ -746,20 +746,20 @@

             var tt = new TestTransport().Enqueue(new byte[0]);

-            await tt.Http.SubmitTo(new Uri("https://www.example.org"),
-                                   Html.HtmlParser.Default.Parse(html, new Uri("https://www.example.com")),
+            await tt.Http.SubmitTo(new Uri("https://www.example.org/"),
+                                   Html.HtmlParser.Default.Parse(html, new Uri("https://www.example.com/")),
                                    0, null);
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.org" + "?firstname=Mickey&lastname=Mouse")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.org/" + "?firstname=Mickey&lastname=Mouse")));
             Assert.That(request.Message.Headers, Is.Empty);
         }

         [Test]
         public async Task SubmitToNoInputTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var html = "<!DOCTYPE html>" +
                                                  "<html>" +
                                                  "<body>" +
@@ -777,20 +777,20 @@
                 ["firstname"] = "Mickey",
                 ["lastname"] = "Mouse"
             };
-            await tt.Http.SubmitTo(new Uri("https://www.example.org"),
-                                   Html.HtmlParser.Default.Parse(html, new Uri("https://www.example.com")),
+            await tt.Http.SubmitTo(new Uri("https://www.example.org/"),
+                                   Html.HtmlParser.Default.Parse(html, new Uri("https://www.example.com/")),
                                    0, data);
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Get));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.org" + "?firstname=Mickey&lastname=Mouse")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.org/" + "?firstname=Mickey&lastname=Mouse")));
             Assert.That(request.Message.Headers, Is.Empty);
         }

         [Test]
         public async Task SubmitToPostRequestTest()
         {
-            var action = "/action_page.php";
+            var action = "/action_page.php/";
             var html = "<!DOCTYPE html>" +
                        "<html>" +
                        "<body>" +
@@ -809,13 +809,13 @@
                 ["firstname"] = "Mickey",
                 ["lastname"] = "Mouse"
             };
-            await tt.Http.SubmitTo(new Uri("https://www.example.org"),
-                                   Html.HtmlParser.Default.Parse(html, new Uri("https://www.example.com")),
+            await tt.Http.SubmitTo(new Uri("https://www.example.org/"),
+                                   Html.HtmlParser.Default.Parse(html, new Uri("https://www.example.com/")),
                                    0, data);
             var request = tt.DequeueRequest((m, c) => new { Message = m, Config = c });

             Assert.That(request.Message.Method, Is.EqualTo(HttpMethod.Post));
-            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.org")));
+            Assert.That(request.Message.RequestUri, Is.EqualTo(new Uri("https://www.example.org/")));
             Assert.That(request.Message.Content.Headers.GetValues("Content-Type").Single(), Is.EqualTo("application/x-www-form-urlencoded"));
             Assert.That(await request.Message.Content.ReadAsStringAsync(), Is.EqualTo("firstname=Mickey&lastname=Mouse"));
             Assert.That(request.Message.Content.Headers.GetValues("Content-Type").Single(), Is.EqualTo("application/x-www-form-urlencoded"));


Update XMLTests.cs

Update XMLTests.cs

--- tests/XMLTests.cs
+++ tests/XMLTests.cs
@@ -22,13 +22,16 @@
 			Assert.AreEqual(dt.TableName, "root");

 			xe = XElement.Parse(@"<root><row><id example='test'>7</id><name><last>Bloggs</last><first>Fred</first></name></row><row><id>6</id><name><first>Joe</first><last>Bloggs</last></name></row></root>");
-			dt = XML.ToDataTable(xe, ".", false, false)
+			dt = XML.ToDataTable(xe, ".", false, false);
 			Assert.IsTrue(dt.Columns.OfType<DataColumn>().Select(c => c.ColumnName).SequenceEqual(new [] { "id", "first.name", "last.name" }));

 			Assert.IsTrue(dt.Rows.GetValuesInColumn(0).SequenceEqual(new [] { "7", "6" }));
 			Assert.IsTrue(dt.Rows.GetValuesInColumn(1).SequenceEqual(new [] { "Fred", "Joe" }));
 			Assert.IsTrue(dt.Rows.GetValuesInColumn(2).SequenceEqual(new [] { "Bloggs", "Bloggs" }));
 			Assert.AreEqual(dt.TableName, "row");
+
+			dt = XML.ToDataTable(xe, null, false, false);
+			Assert.IsTrue(dt.Columns.OfType<DataColumn>().Select(c => c.ColumnName).SequenceEqual(new [] { "id", "first", "last" }));
 		}
 	}
 }


Filled in basics of get, post, and delete

--- Antsy/AntsyHost.cs
+++ Antsy/AntsyHost.cs
@@ -17,6 +17,10 @@
     /// </summary>
     public class AntsyHost
     {
+        private List<Tuple<string, Func<AntsyRequest, AntsyResponse, Task>>> getList = new List<Tuple<string, Func<AntsyRequest, AntsyResponse, Task>>>();
+        private List<Tuple<string, Func<AntsyRequest, AntsyResponse, Task>>> postList = new List<Tuple<string, Func<AntsyRequest, AntsyResponse, Task>>>();
+        private List<Tuple<string, Func<AntsyRequest, AntsyResponse, Task>>> deleteList = new List<Tuple<string, Func<AntsyRequest, AntsyResponse, Task>>>();
+
         private IWebHostBuilder _builder;

         public AntsyHost(int port)
@@ -33,7 +37,19 @@
         /// </summary>
         public void Get(string path, Action<AntsyRequest, AntsyResponse> del)
         {
+            Get(path, (req, res) =>
+            {
+                del(req, res);
+                return Task.FromResult(0);
+            });
+        }

+        /// <summary>
+        /// Handle a GET request at the given path.
+        /// </summary>
+        public void Get(string path, Func<AntsyRequest, AntsyResponse, Task> del)
+        {
+            getList.Add(Tuple.Create(path, del));
         }

         /// <summary>
@@ -41,7 +57,19 @@
         /// </summary>
         public void Post(string path, Action<AntsyRequest, AntsyResponse> del)
         {
+            Post(path, (req, res) =>
+            {
+                del(req, res);
+                return Task.FromResult(0);
+            });
+        }

+        /// <summary>
+        /// Handle a POST request at the given path.
+        /// </summary>
+        public void Post(string path, Func<AntsyRequest, AntsyResponse, Task> del)
+        {
+            postList.Add(Tuple.Create(path, del));
         }

         /// <summary>
@@ -49,7 +77,19 @@
         /// </summary>
         public void Delete(string path, Action<AntsyRequest, AntsyResponse> del)
         {
+            Delete(path, (req, res) =>
+            {
+                del(req, res);
+                return Task.FromResult(0);
+            });
+        }

+        /// <summary>
+        /// Handle a DELETE request at the given path.
+        /// </summary>
+        public void Delete(string path, Func<AntsyRequest, AntsyResponse, Task> del)
+        {
+            deleteList.Add(Tuple.Create(path, del));
         }

         public void Run()
@@ -66,6 +106,27 @@
         private void Configure(IApplicationBuilder app)
         {
             var routeBuilder = new RouteBuilder(app);
+            foreach (var item in getList)
+            {
+                routeBuilder.MapGet(item.Item1, new RequestDelegate(context =>
+                {
+                    return item.Item2(new AntsyRequest(context.Request), new AntsyResponse(context.Response));
+                }));
+            }
+            foreach (var item in postList)
+            {
+                routeBuilder.MapPost(item.Item1, new RequestDelegate(context =>
+                {
+                    return item.Item2(new AntsyRequest(context.Request), new AntsyResponse(context.Response));
+                }));
+            }
+            foreach (var item in deleteList)
+            {
+                routeBuilder.MapDelete(item.Item1, new RequestDelegate(context =>
+                {
+                    return item.Item2(new AntsyRequest(context.Request), new AntsyResponse(context.Response));
+                }));
+            }
             routeBuilder.MapGet("path", new RequestDelegate(context => Task.FromResult(0)));
             app.UseRouter(routeBuilder.Build());
         }


Add virtual dir ending slash when finalizing build

--- tools-local/tasks/FinalizeBuild.cs
+++ tools-local/tasks/FinalizeBuild.cs
@@ -94,7 +94,7 @@

                 try
                 {
-                    CopyBlobs($"Runtime/{ProductVersion}", $"Runtime/{Channel}/");
+                    CopyBlobs($"Runtime/{ProductVersion}/", $"Runtime/{Channel}/");

                     // Generate the latest version text file
                     string sfxVersion = GetSharedFrameworkVersionFileContent();


ajustando numero da versao

ajustando numero da versao

--HG--
branch : 2.0.0.0-beta

--- AssemblyVersion.cs
+++ AssemblyVersion.cs
@@ -1,5 +1,5 @@
 using System.Reflection;

-[assembly: AssemblyVersion("1.4.0.0")]
-[assembly: AssemblyFileVersion("1.4.0.0")]
-[assembly: AssemblyInformationalVersion("1.4.0.0")]+[assembly: AssemblyVersion("2.0.0.0")]
+[assembly: AssemblyFileVersion("2.0.0.0")]
+[assembly: AssemblyInformationalVersion("2.0.0.0")]


Removed verbatim prefix

Removed verbatim prefix

--- AutoGrid/MyItem.cs
+++ AutoGrid/MyItem.cs
@@ -71,13 +71,13 @@
         }

         public void Shrink() {
-            double by = -0.2;
-            ResizeBy(@by, @by, 350, null);
+            const double by = -0.2;
+            ResizeBy(by, by, 350, null);
         }

         public void Grow() {
-            double by = 0.2;
-            ResizeBy(@by, @by, 350, null);
+            const double by = 0.2;
+            ResizeBy(by, by, 350, null);
         }

         public void Hide(EventHandler onCompleted) {


Improving messages.

Improving messages.

--- BinInfo/BinList.cs
+++ BinInfo/BinList.cs
@@ -41,7 +41,7 @@
                 }
                 catch (WebException ex)
                 {
-                    String addInfo = String.Format("No results for {0}. Make sure you enter a valid BIN/IIN number. \n", bin);
+                    String addInfo = String.Format("No results for {0}. Make sure you enter a valid BIN/IIN number. --- ", bin);
                     throw new WebException(addInfo + ex.Message, ex, ex.Status, ex.Response);
                 }
                 catch (Exception)


Add a method to draw a border around an image

--- BitmapUtilities.cs
+++ BitmapUtilities.cs
@@ -72,6 +72,16 @@
 		/// </summary>
 		public static Bitmap Resize(Bitmap orig, Size resizeTo) {
 			return TextureConverterDialog.ResizeImage(orig, resizeTo.Width, resizeTo.Height);
+		}
+
+		public static Bitmap Border(Bitmap orig, Color color, int penwidth = 1) {
+			Bitmap b = new Bitmap(orig.Width, orig.Height);
+			Graphics g = Graphics.FromImage(b);
+			g.DrawImage(orig, 0, 0);
+			g.DrawRectangle(new Pen(color, penwidth),
+				penwidth - 1, penwidth - 1,
+				orig.Width - penwidth, orig.Height - penwidth);
+			return b;
 		}

 		/// <summary>


added stuff

added stuff

--- mono/bot.cs
+++ mono/bot.cs
@@ -20,6 +20,7 @@
 			writer.AutoFlush = true;

 			new Bot(reader, writer, new Join(botName, botKey));
+			//new Bot(reader, writer, new JoinRace(botName, botKey, "france"));
 		}
 	}

@@ -49,7 +50,7 @@
 		}
 	}

-	private SendMsg GetDeceleration(){
+	private SendMsg GetDeceleration(){/*
 		if(myCar.speed == 0){
 			throttle = 1;
 			return new Throttle(1.0);
@@ -65,6 +66,7 @@
 				Console.WriteLine("End distance: "+myCar.piecePosition.inPieceDistance);
 				Console.WriteLine("End speed: "+myCar.speed);
 				deceleration = speedLowered / distanceTraveled;
+				Console.WriteLine ("Deceleration: "+deceleration);
 				return new Throttle(1.0);
 			}else{
 				if(myCar.speed < 1){
@@ -76,8 +78,9 @@
 					return new Throttle(0);
 				}
 			}
-		}
-
+		}*/
+		deceleration = 0.0204081632653056;
+		return new Throttle(1);
 	}

 	private LearningData GetLearnedDataById(int id){
@@ -182,8 +185,54 @@
 		}
 		return dist - myCar.piecePosition.inPieceDistance;
 	}
-
-	private SendMsg DetermineAction(){
+
+	private int GetNextTurn (Car car)
+	{
+		int i = car.piecePosition.pieceIndex;
+		while(currentTrack.pieces[i].angle == 0){
+			i++;
+			if(i > currentTrack.pieces.Count - 1){
+				i = 0;
+			}
+		}
+		return i;
+	}
+
+	private Double GuessSlipAngle ()
+	{
+		//if (currentTrack.pieces[myCar.piecePosition.pieceIndex].angle < 0) {
+			//return -(myCar.angularForce * 60 * 2);
+		//}
+		return myCar.angularForce * 60 * 2;
+	}
+
+	private Double GetMaxSpeed ()
+	{
+		double totalradius = 0;
+		if(currentTrack.pieces[myCar.piecePosition.pieceIndex].angle > 0){
+			totalradius = currentTrack.pieces[myCar.piecePosition.pieceIndex].radius - currentTrack.lanes[myCar.piecePosition.lane.startLaneIndex].distanceFromCenter;
+		}else{
+			totalradius = currentTrack.pieces[myCar.piecePosition.pieceIndex].radius + currentTrack.lanes[myCar.piecePosition.lane.startLaneIndex].distanceFromCenter;
+		}
+		//Console.WriteLine(myCar.angularForce);
+		return Math.Sqrt((0.38 * GuessSlipAngle () * totalradius) / 60 );
+	}
+
+	private Double GetMaxEntrySpeed ()
+	{
+		double totalradius = 0;
+		if(currentTrack.pieces[GetNextTurn(myCar)].angle > 0){
+			totalradius = currentTrack.pieces[GetNextTurn(myCar)].radius - currentTrack.lanes[myCar.piecePosition.lane.startLaneIndex].distanceFromCenter;
+		}else{
+			totalradius = currentTrack.pieces[GetNextTurn(myCar)].radius + currentTrack.lanes[myCar.piecePosition.lane.startLaneIndex].distanceFromCenter;
+		}
+		return Math.Sqrt (0.48 * totalradius);
+	}
+
+	private SendMsg DetermineAction ()
+	{
+
+		/*
 		if(myCar.piecePosition.pieceIndex > 1 && myCar.piecePosition.pieceIndex < 4 && myCar.piecePosition.lane.startLaneIndex == 0 && myCar.piecePosition.lane.endLaneIndex == 0){
 			if(currentTrack.GetNextPiece(myCar).@switch){
 				return new SwitchLane("Right");
@@ -217,7 +266,7 @@
 			}
 			return new Throttle(1.0); //slow only to tight curves
 		}*/
-
+		/*
 		if(currentTrack.pieces[myCar.piecePosition.pieceIndex].angle != 0){
 			Corner currentCorner = trackCorners.GetCornerByPiece(currentTrack.pieces[myCar.piecePosition.pieceIndex]);
 			if(currentCorner == null){
@@ -265,10 +314,45 @@
 			}
 		}

-
-	}
-
-	Bot(StreamReader reader, StreamWriter writer, Join join) {
+		*/
+		/*Piece current = currentTrack.pieces [myCar.piecePosition.pieceIndex];
+		if (currentTrack.pieces [myCar.piecePosition.pieceIndex].angle != 0) {
+
+			using (System.IO.StreamWriter file = new System.IO.StreamWriter("./angle.txt", true))
+        				{
+							double totalradius;
+							if(currentTrack.pieces[myCar.piecePosition.pieceIndex].angle > 0){
+								totalradius = currentTrack.pieces[myCar.piecePosition.pieceIndex].radius - currentTrack.lanes[myCar.piecePosition.lane.startLaneIndex].distanceFromCenter;
+							}else{
+								totalradius = currentTrack.pieces[myCar.piecePosition.pieceIndex].radius + currentTrack.lanes[myCar.piecePosition.lane.startLaneIndex].distanceFromCenter;
+							}
+				if(myCar.speed > 0){
+           					file.WriteLine(myCar.angle+" , "+GuessSlipAngle()+" , "+current.angle+" , "+totalradius+" , "+myCar.speed);
+							Console.WriteLine(myCar.angle+" , "+GuessSlipAngle()+" , "+current.angle+" , "+totalradius+" , "+myCar.speed);
+				}
+        				}
+		}*/
+		//Console.WriteLine(GetMaxSpeed()+" , "+GetMaxEntrySpeed()+" "+GetDistanceUntilPiece(currentTrack.pieces[GetNextTurn(myCar)]));
+		if (currentTrack.pieces [myCar.piecePosition.pieceIndex].angle != 0) {
+			//return new Throttle(0.6);
+			return new Throttle(GetMaxSpeed()/10);
+		} else {
+			Double entryspeed = GetMaxEntrySpeed();
+			if(myCar.speed - (deceleration * GetDistanceUntilPiece(currentTrack.pieces[GetNextTurn(myCar)])) > entryspeed){
+				if(entryspeed < 0){
+					return new Throttle(1.0);
+				}
+				return new Throttle(0.0);
+			}else{
+				return new Throttle(1.0);
+			}
+		}
+
+
+
+	}
+
+	Bot(StreamReader reader, StreamWriter writer, SendMsg join) {
 		this.writer = writer;
 		string line;

@@ -286,7 +370,7 @@
 				case "carPositions":
 					CarPositions carPositions = JsonConvert.DeserializeObject<CarPositions>(line);
 					UpdateCarPositions(carPositions.data);
-					//Console.WriteLine("Car startlaneindex:"+myCar.piecePosition.lane.startLaneIndex+" Car endlaneIndex:"+myCar.piecePosition.lane.endLaneIndex+" Current tick: "+carPositions.gameTick);
+					Console.WriteLine("Car startlaneindex:"+myCar.piecePosition.lane.startLaneIndex+" Car endlaneIndex:"+myCar.piecePosition.lane.endLaneIndex+" Current tick: "+carPositions.gameTick+ " Speed: "+myCar.speed);
 					if(deceleration == 0){
 						send(GetDeceleration());
 					}else{
@@ -341,6 +425,7 @@
 					send(new Ping());
 					break;
 				default:
+					Console.WriteLine(line);
 					send(new Ping());
 					break;
 			}
@@ -572,6 +657,7 @@
 {
 	public Car(){
 		this.speed = 0.0;
+		this.angularForce = 0.0;
 	}

     public Id id { get; set; }
@@ -579,6 +665,7 @@
     public PiecePosition piecePosition { get; set; }
 	public Dimensions dimensions { get; set; }
 	public double speed { get; set; }
+	public double angularForce { get; set; }

 	public bool EqualsWithCar(Car car){
 		if(car.id.name == this.id.name && car.id.color == this.id.color){
@@ -594,7 +681,18 @@
 	}

 	private void calculateSpeed(Car newspeed, Track currentTrack){
+
+
+
 		if(this.piecePosition != null){
+			double totalradius = 0;
+			if(currentTrack.pieces[this.piecePosition.pieceIndex].angle > 0){
+				totalradius = currentTrack.pieces[this.piecePosition.pieceIndex].radius - currentTrack.lanes[this.piecePosition.lane.startLaneIndex].distanceFromCenter;
+			}else if(currentTrack.pieces[this.piecePosition.pieceIndex].angle < 0){
+				totalradius = currentTrack.pieces[this.piecePosition.pieceIndex].radius + currentTrack.lanes[this.piecePosition.lane.startLaneIndex].distanceFromCenter;
+			}
+
+
 			if(this.piecePosition.pieceIndex == newspeed.piecePosition.pieceIndex){
 				this.speed = newspeed.piecePosition.inPieceDistance - this.piecePosition.inPieceDistance;
 			}else{
@@ -602,19 +700,20 @@
 				if(currentTrack.pieces[this.piecePosition.pieceIndex].length > 0){
 					previouslength = currentTrack.pieces[this.piecePosition.pieceIndex].length;
 				}else{
-					double totalradius;
-					if(currentTrack.pieces[this.piecePosition.pieceIndex].angle > 0){
-						totalradius = currentTrack.pieces[this.piecePosition.pieceIndex].radius - currentTrack.lanes[this.piecePosition.lane.startLaneIndex].distanceFromCenter;
-					}else{
-						totalradius = currentTrack.pieces[this.piecePosition.pieceIndex].radius + currentTrack.lanes[this.piecePosition.lane.startLaneIndex].distanceFromCenter;
-					}
 					previouslength = (currentTrack.pieces[this.piecePosition.pieceIndex].angle / 360) * 2 * Math.PI * totalradius;
 				}

 				this.speed = previouslength - this.piecePosition.inPieceDistance + newspeed.piecePosition.inPieceDistance;

 			}
-		}
+			if(totalradius == 0){
+				this.angularForce = 0;
+			}else{
+				this.angularForce = Math.Pow(this.speed, 2) / totalradius;
+			}
+
+		}
+
 	}

 	public void updateCarPosition(Car car, Track currentTrack){


Skip showing alert on initial application start

--- CERTified/Form1.cs
+++ CERTified/Form1.cs
@@ -12,6 +12,7 @@
     {
         private SystemCertCheck _scc;
         private readonly int _settimer2 = 21600;     //for CTL / CRL update (6 hours)
+        private bool _initalLoad = true;
         private int _usetimer1;
         private int _usetimer2;
         private readonly List<string> _filter = new List<string>();
@@ -357,6 +358,11 @@

         private void certs_CollectionChanged()
         {
+            if (_initalLoad) { // -- Skip showing the alert the first time the cert stores are loaded.
+                _initalLoad = false;
+                return;
+            }
+
             trayIcon.BalloonTipTitle = @"CERTified";
             trayIcon.BalloonTipText = @"A change in the certificate store has been detected";
             trayIcon.ShowBalloonTip(1000);


Prefix temporary filename with original filename

--- osu.Framework/Platform/NativeStorage.cs
+++ osu.Framework/Platform/NativeStorage.cs
@@ -42,7 +42,12 @@

         public override void Move(string from, string to) => File.Move(GetFullPath(from), GetFullPath(to));

-        public override Stream CreateFileSafely(string path) => new SafeWriteStream(Guid.NewGuid().ToString(), path, this);
+        public override Stream CreateFileSafely(string path)
+        {
+            string temporaryPath = Path.Combine(Path.GetDirectoryName(path), $"_{Path.GetFileName(path)}_{Guid.NewGuid()}");
+
+            return new SafeWriteStream(temporaryPath, path, this);
+        }

         public override IEnumerable<string> GetDirectories(string path) => getRelativePaths(Directory.GetDirectories(GetFullPath(path)));


Remove unusable "tests" button from main menu system.

--- osu.Game/GameModes/Menu/ButtonSystem.cs
+++ osu.Game/GameModes/Menu/ButtonSystem.cs
@@ -115,7 +115,6 @@
             buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"solo", @"freeplay", FontAwesome.user, new Color4(102, 68, 204, 255), OnSolo, wedge_width, Key.P)));
             buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"multi", @"multiplayer", FontAwesome.users, new Color4(94, 63, 186, 255), OnMulti, 0, Key.M)));
             buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"chart", @"charts", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), OnChart)));
-            buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"tests", @"tests", FontAwesome.terminal, new Color4(80, 53, 160, 255), OnTest, 0, Key.T)));

             buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"play", @"play", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, wedge_width, Key.P)));
             buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"osu!editor", @"edit", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), OnEdit, 0, Key.E)));


Add missing xmldoc

Add missing xmldoc

--- osu.Game/Rulesets/Edit/PlacementMask.cs
+++ osu.Game/Rulesets/Edit/PlacementMask.cs
@@ -15,6 +15,9 @@

 namespace osu.Game.Rulesets.Edit
 {
+    /// <summary>
+    /// A mask which governs the creation of a new <see cref="HitObject"/> to actualisation.
+    /// </summary>
     public abstract class PlacementMask : CompositeDrawable, IRequireHighFrequencyMousePosition
     {
         /// <summary>


Move QuadBatch to a local variable to stop resharper complaining

--- osu.Game/Rulesets/Mods/ModFlashlight.cs
+++ osu.Game/Rulesets/Mods/ModFlashlight.cs
@@ -155,12 +155,13 @@
                 private Vector2 flashlightSize;
                 private float flashlightDim;

-                private readonly VertexBatch<PositionAndColourVertex> quadBatch = new QuadBatch<PositionAndColourVertex>(1, 1);
                 private readonly Action<TexturedVertex2D> addAction;

                 public FlashlightDrawNode(Flashlight source)
                     : base(source)
                 {
+                    var quadBatch = new QuadBatch<PositionAndColourVertex>(1, 1);
+
                     addAction = v => quadBatch.Add(new PositionAndColourVertex
                     {
                         Position = v.Position,


Add comment for pendingAnimation

Add comment for pendingAnimation

--- osu.Game/Screens/Play/HUD/QuitButton.cs
+++ osu.Game/Screens/Play/HUD/QuitButton.cs
@@ -144,6 +144,8 @@

                 // temporarily unbind as to not look weird during flash animation.
                 Progress.UnbindAll();
+
+                // avoid starting a new confirm call until we finish animating.
                 pendingAnimation = true;

                 innerCircle.ScaleTo(0, 100)


We don't want to have a BOM at all

We don't want to have a BOM at all

--- RestSharp.Portable.Test/SerializerTests.cs
+++ RestSharp.Portable.Test/SerializerTests.cs
@@ -19,11 +19,15 @@
         public void TestXmlSerializerBom()
         {
             var serializer = new RestSharp.Portable.Serializers.XmlDataContractSerializer();
-            var input = new TestData { TestProp = "propValue1" };
+            var input = new TestData { TestProp = "propValue1 öäüß" };
             var output = serializer.Serialize(input);
             var lastThreeBytes = new byte[3];
             Array.Copy(output, output.Length - 3, lastThreeBytes, 0, 3);
             CollectionAssert.AreNotEqual(new byte[] { 0xEF, 0xBB, 0xBF }, lastThreeBytes);
+
+            var firstThreeBytes = new byte[3];
+            Array.Copy(output, 0, firstThreeBytes, 0, 3);
+            CollectionAssert.AreNotEqual(new byte[] { 0xEF, 0xBB, 0xBF }, firstThreeBytes);
         }
     }
 }


Small change to make the Interface more apparent

--- SampleWebApp/ActionProgress/RunnerSetup.cs
+++ SampleWebApp/ActionProgress/RunnerSetup.cs
@@ -40,8 +40,8 @@
             if (_actionInterface == null || !_actionInterface.IsGenericType)
                 throw new InvalidOperationException("The interface must have IActionDefn<TOut,Tin> or IActionDefnAsync<TOut,Tin> as the first sub-interface.");

-            _isAsync = _actionInterface.Name == "IActionAsync`2";
-            if (!_isAsync && _actionInterface.Name != "IActionSync`2")
+            _isAsync = _actionInterface.Name == typeof (IActionAsync<,>).Name;
+            if (!_isAsync && _actionInterface.Name != typeof(IActionSync<,>).Name)
                 throw new InvalidOperationException("The interface must have IActionDefn<TOut,Tin> or IActionDefnAsync<TOut,Tin> as the first sub-interface.");

             _data = data;


[DirectInput] Add Keyboard sample

[DirectInput] Add Keyboard sample

--- Samples/DirectInput/JoystickApp/Program.cs
+++ Samples/DirectInput/JoystickApp/Program.cs
@@ -31,6 +31,12 @@
         //[STAThread]
         static void Main()
         {
+            MainForJoystick();
+            //MainForKeyboard();
+        }
+
+        static void MainForJoystick()
+        {
             // Initialize DirectInput
             var directInput = new DirectInput();

@@ -52,7 +58,7 @@
                 Console.ReadKey();
                 Environment.Exit(1);
             }
-
+
             // Instantiate the joystick
             var joystick = new Joystick(directInput, joystickGuid);

@@ -78,5 +84,33 @@
                     Console.WriteLine(state);
             }
         }
+
+
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        //[STAThread]
+        static void MainForKeyboard()
+        {
+            // Initialize DirectInput
+            var directInput = new DirectInput();
+
+            // Instantiate the joystick
+            var keyboard = new Keyboard(directInput);
+
+            // Acquire the joystick
+            keyboard.Properties.BufferSize = 128;
+            keyboard.Acquire();
+
+            // Poll events from joystick
+            while (true)
+            {
+                keyboard.Poll();
+                var datas = keyboard.GetBufferedData();
+                foreach (var state in datas)
+                    Console.WriteLine(state);
+            }
+        }
+
     }
 }


Added (incomplete) Player.LaunchAtTarget() method.

--- Battleship/Player.cs
+++ Battleship/Player.cs
@@ -1,8 +1,16 @@
-//-----------------------------------------------------
+// TODO:
+// * Document LaunchAtTarget()
+// * Comment LaunchAtTarget() (?)
+// * Fix error in LaunchAtTarget()
+// * Rewrite Squares of sunken ship
+
+
+
+//-----------------------------------------------------
 // <copyright file="Player.cs" company="none">
-//    Copyright (c) Andreas Andersson 2014
+//    Copyright (c) Torbjörn Widström & Andreas Andersson 2014
 // </copyright>
-// <author>Andreas Andersson</author>
+// <author>Torbjörn Widström & Andreas Andersson</author>
 //-----------------------------------------------------

 namespace Battleship
@@ -15,6 +23,31 @@
     {
         public static Square LaunchAtTarget(Square[,] grid, int row, int col)
         {
+            if (grid[row, col] == Square.Hit ||
+                grid[row, col] == Square.Miss ||
+                grid[row, col] == Square.Sunk)
+            {
+                return Square.Forbidden;
+            }
+            else if (grid[row, col] == Square.Ship)
+            {
+                grid[row, col] = Square.Hit;
+
+                // FUNKAR INTE! Använd IsSunk()-metoden nedan istället.
+                if (grid[row, col] == Square.Sunk)
+                {
+                    grid[row, col] = Square.Sunk;
+                    return Square.Sunk;
+                }
+                else
+                {
+                    return Square.Hit;
+                }
+            }
+            else
+            {
+                return Square.Miss;
+            }
         }

         /// <summary>


Display unrecognized symbols in light gray rather than light yellow.

--- Sandra.UI/AppTemplate/JsonStyleSelector.cs
+++ Sandra.UI/AppTemplate/JsonStyleSelector.cs
@@ -35,6 +35,7 @@
         private const int stringStyleIndex = 10;
         private const int errorStringStyleIndex = 11;
         private const int undefinedValueStyleIndex = 12;
+        private const int unknownSymbolStyleIndex = 13;

         private static readonly Color commentForeColor = Color.FromArgb(128, 220, 220);
         private static readonly Font commentFont = new Font("Consolas", 10, FontStyle.Italic);
@@ -45,6 +46,7 @@
         private static readonly Color stringForeColor = Color.FromArgb(255, 192, 144);
         private static readonly Color errorStringForeColor = Color.FromArgb(224, 168, 126);
         private static readonly Color undefinedValueForeColor = Color.FromArgb(192, 192, 40);
+        private static readonly Color unknownSymbolForeColor = Color.FromArgb(204, 204, 204);

         public static readonly JsonStyleSelector<TSyntaxTree, TError> Instance = new JsonStyleSelector<TSyntaxTree, TError>();

@@ -61,6 +63,8 @@

             syntaxEditor.Styles[undefinedValueStyleIndex].ForeColor = undefinedValueForeColor;
             valueFont.CopyTo(syntaxEditor.Styles[undefinedValueStyleIndex]);
+
+            syntaxEditor.Styles[unknownSymbolStyleIndex].ForeColor = unknownSymbolForeColor;
         }

         private JsonStyleSelector() { }
@@ -81,7 +85,7 @@
             => syntaxEditor.Styles[booleanIntegerStyleIndex];

         public override Style VisitRootLevelValueDelimiterSyntax(JsonRootLevelValueDelimiterSyntax node, SyntaxEditor<TSyntaxTree, IJsonSymbol, TError> syntaxEditor)
-            => syntaxEditor.Styles[undefinedValueStyleIndex];
+            => syntaxEditor.Styles[unknownSymbolStyleIndex];

         public override Style VisitStringLiteralSyntax(JsonStringLiteralSyntax node, SyntaxEditor<TSyntaxTree, IJsonSymbol, TError> syntaxEditor)
             => syntaxEditor.Styles[stringStyleIndex];
@@ -90,7 +94,7 @@
             => syntaxEditor.Styles[undefinedValueStyleIndex];

         public override Style VisitUnknownSymbolSyntax(JsonUnknownSymbolSyntax node, SyntaxEditor<TSyntaxTree, IJsonSymbol, TError> syntaxEditor)
-            => syntaxEditor.Styles[undefinedValueStyleIndex];
+            => syntaxEditor.Styles[unknownSymbolStyleIndex];

         public override Style VisitUnterminatedMultiLineCommentSyntax(JsonUnterminatedMultiLineCommentSyntax node, SyntaxEditor<TSyntaxTree, IJsonSymbol, TError> syntaxEditor)
             => syntaxEditor.Styles[commentStyleIndex];


added todo

added todo

--- ServiceRadiusAdjusterTests/ProfileTests.cs
+++ ServiceRadiusAdjusterTests/ProfileTests.cs
@@ -71,7 +71,6 @@
             };

             var expected = new Profile(expectedViewGroups).ViewGroups.SelectMany(vg => vg.OptionItems);
-
             var actual = profile.Combine(newViewGroups).ViewGroups.SelectMany(vg => vg.OptionItems);

             var expectedList = expected.ToList();
@@ -82,6 +81,7 @@
                 var expectedItem = expectedList[i];
                 var actualItem = actualList[i];

+                //TODO find out what the issue with the execution timer is
                 Assert.Equal(expectedItem, actualItem);
             }


Add SplitLines and Repeat strings

Add SplitLines and Repeat strings

--- CSharpEx/StringEx.cs
+++ CSharpEx/StringEx.cs
@@ -18,6 +18,8 @@

 using System;
 using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;

 namespace CSharpEx
 {
@@ -228,5 +230,36 @@
         }

         #endregion
+
+        #region SplitLines
+        /// <summary> Split string into lines </summary>
+        public static string[] SplitLines(this string thisString)
+        {
+            return Regex.Split(thisString, "\r\n|\r|\n");
+        }
+        #endregion
+
+        #region Repeat
+        /// <summary> Repeat a string and concat the results. </summary>
+        public static string Repeat(this string thisString, int times)
+        {
+            if (thisString == null)
+                throw new ArgumentNullException("thisString", "string parameter is null");
+
+            if (times < 0)
+                throw new ArgumentNullException("times", "times parameter negative");
+
+            if ((thisString.Length == 0) || (times == 0))
+                return "";
+
+            StringBuilder sb = new StringBuilder(times * thisString.Length);
+            for (int i = 0; i < times; i++)
+            {
+                sb.Append(thisString);
+            }
+
+            return sb.ToString();
+        }
+        #endregion
     }
 }


Add a link to the related project in blog details.

--- src/CompetitionPlatform/Views/Blog/BlogDetails.cshtml
+++ src/CompetitionPlatform/Views/Blog/BlogDetails.cshtml
@@ -37,7 +37,7 @@

-                                                @Model.ProjectName
+                                                @Model.ProjectName

$@Model.ProjectBudget

@@ -46,11 +46,11 @@

                                                     Category:
-                                                    @Model.ProjectCategory
+
@Model.ProjectCategory

                                                     Creator:
-                                                    @Model.ProjectAuthor
+
@Model.ProjectAuthor

                                                 @*

                                                         Period:


Typo in the exception message that's returned

Typo in the exception message that's returned
Rendererd should be Rendered

--- src/Components/Server/src/Circuits/RemoteJSRuntime.cs
+++ src/Components/Server/src/Circuits/RemoteJSRuntime.cs
@@ -74,7 +74,7 @@
             {
                 throw new InvalidOperationException(
                     "JavaScript interop calls cannot be issued at this time. This is because the component is being " +
-                    $"statically rendererd. When prerendering is enabled, JavaScript interop calls can only be performed " +
+                    $"statically rendered. When prerendering is enabled, JavaScript interop calls can only be performed " +
                     $"during the OnAfterRenderAsync lifecycle method.");
             }


Log drawable auto-unbind failure on a verbose level

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -151,9 +151,9 @@
                         {
                             a(target);
                         }
-                        catch
+                        catch (Exception e)
                         {
-                            // Execution should continue regardless of whether an unbind failed
+                            Logger.Log($"Failed to unbind a local bindable in {type.ReadableName()}: {e}");
                         }
                     }
                 };


Whitespace.

Whitespace.

--- osu.Framework/Platform/GameHost.cs
+++ osu.Framework/Platform/GameHost.cs
@@ -227,7 +227,7 @@
             if (Root == null) return;

             if (Window?.WindowState != WindowState.Minimized)
-                Root.Size = Window != null ? new Vector2(Window.ClientSize.Width, Window.ClientSize.Height) :
+                Root.Size = Window != null ? new Vector2(Window.ClientSize.Width, Window.ClientSize.Height) :
                     new Vector2(config.Get<int>(FrameworkConfig.Width), config.Get<int>(FrameworkConfig.Height));

             Root.UpdateSubTree();


Fix CircularContainer usage.

Fix CircularContainer usage.

--- osu.Game/GameModes/Menu/OsuLogo.cs
+++ osu.Game/GameModes/Menu/OsuLogo.cs
@@ -62,6 +62,7 @@
                     {
                         logoContainer = new CircularContainer
                         {
+                            AutoSizeAxes = Axes.Both,
                             Anchor = Anchor.Centre,
                             Children = new[]
                             {


Forward action in saner way

Forward action in saner way

--- osu.Game/Overlays/Chat/ChatLine.cs
+++ osu.Game/Overlays/Chat/ChatLine.cs
@@ -1,6 +1,7 @@
 // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

+using System;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Game.Graphics;
@@ -11,6 +12,7 @@
 using osu.Framework.Graphics.Effects;
 using osu.Framework.Extensions.Color4Extensions;
 using osu.Framework.Allocation;
+using osu.Game.Users;

 namespace osu.Game.Overlays.Chat
 {
@@ -62,7 +64,8 @@
         private const float message_padding = 200;
         private const float text_size = 20;

-        private UserProfileOverlay profileOverlay;
+        private Action<User> loadProfile;
+
         private Color4 customUsernameColour;

         public ChatLine(Message message)
@@ -76,9 +79,10 @@
         }

         [BackgroundDependencyLoader]
-        private void load(OsuColour colours)
+        private void load(OsuColour colours, UserProfileOverlay profile)
         {
             customUsernameColour = colours.ChatBlue;
+            loadProfile = u => profile?.ShowUser(u);
         }

         protected override void LoadComplete()
@@ -88,8 +92,6 @@
             bool hasBackground = !string.IsNullOrEmpty(Message.Sender.Colour);
             Drawable username = new OsuSpriteText
             {
-                Origin = Anchor.TopRight,
-                Anchor = Anchor.TopRight,
                 Font = @"Exo2.0-BoldItalic",
                 Text = $@"{Message.Sender.Username}" + (hasBackground ? "" : ":"),
                 Colour = hasBackground ? customUsernameColour : username_colours[Message.UserId % username_colours.Length],
@@ -133,7 +135,7 @@
                 new Container
                 {
                     Size = new Vector2(message_padding, text_size),
-                    Children = new[]
+                    Children = new Drawable[]
                     {
                         new OsuSpriteText
                         {
@@ -150,8 +152,8 @@
                             AutoSizeAxes = Axes.Both,
                             Origin = Anchor.TopRight,
                             Anchor = Anchor.TopRight,
-                            Child = username
-                            Action = () => profileOverlay?.ShowUser(Message.Sender),
+                            Child = username,
+                            Action = () => loadProfile(Message.Sender),
                         },
                     }
                 },
@@ -173,11 +175,5 @@
                 }
             };
         }
-
-        [BackgroundDependencyLoader(permitNulls: true)]
-        private void load(UserProfileOverlay profileOverlay)
-        {
-            this.profileOverlay = profileOverlay;
-        }
     }
 }


Remove sorting by rank

Remove sorting by rank

Since it isn't working for any case currently

--- osu.Game/Overlays/SocialOverlay.cs
+++ osu.Game/Overlays/SocialOverlay.cs
@@ -211,22 +211,6 @@
                             break;
                     }
                     break;
-
-                case SocialSortCriteria.Rank:
-                    if (newUsers.FirstOrDefault().Statistics != null)
-                    {
-                        switch (sortDirection)
-                        {
-                            case SortDirection.Ascending:
-                                sortedUsers = newUsers.OrderBy(u => u.Statistics?.Ranks.Global);
-                                break;
-
-                            case SortDirection.Descending:
-                                sortedUsers = newUsers.OrderByDescending(u => u.Statistics?.Ranks.Global);
-                                break;
-                        }
-                    }
-                    break;
             }

             Users = sortedUsers;


Included escapting of values for Team City messages

--- ConDep.Dsl/Logger.cs
+++ ConDep.Dsl/Logger.cs
@@ -1,5 +1,6 @@
 using System.Diagnostics;
 using System.ServiceProcess;
+using System.Text;
 using log4net;
 using log4net.Core;

@@ -30,20 +31,13 @@
             {
                 if(_tcServiceExist == null)
                 {
-                    var log = LogManager.GetLogger("condep-no-time");
                     try
                     {
-                        log.Logger.Log(typeof(Logger), Level.All, "Checking if ConDep is running under Team City", null);
                         var tcService = new ServiceController("TCBuildAgent");
                         _tcServiceExist = tcService.Status == ServiceControllerStatus.Running;
-                        log.Logger.Log(typeof (Logger), Level.All,
-                                       _tcServiceExist.Value
-                                           ? "Running on Team City - using Team City formatting"
-                                           : "Not running on Team City - using default formatting", null);
                     }
                     catch
                     {
-                        log.Logger.Log(typeof(Logger), Level.All, "Not running on Team City - using default formatting", null);
                         _tcServiceExist = false;
                     }
                 }
@@ -96,7 +90,7 @@

         private static void TeamCityError(string message, string errorDetails, params object[] formatArgs)
         {
-            TeamCityMessage(message, errorDetails, TeamCityMessageStatus.WARNING, formatArgs);
+            TeamCityMessage(message, errorDetails, TeamCityMessageStatus.ERROR, formatArgs);
         }

         private static void TeamCityMessage(string message, string errorDetails, TeamCityMessageStatus status, params object[] formatArgs)
@@ -104,7 +98,18 @@
             if (!RunningOnTeamCity) return;

             var formattedMessage = formatArgs != null ? string.Format(message, formatArgs) : "";
-            var tcMessage = string.Format("##teamcity[message text='{0}' errorDetails='{1}' status='{2}']", formattedMessage, errorDetails, status);
+            var sb = new StringBuilder(formattedMessage);
+            sb.Replace("|", "||")
+                .Replace("'", "|'")
+                .Replace("\n", "|n")
+                .Replace("\r", "|r")
+                .Replace("\u0085", "|x")
+                .Replace("\u2028", "|l")
+                .Replace("\u2029", "|p")
+                .Replace("[", "|[")
+                .Replace("]", "|]");
+
+            var tcMessage = string.Format("##teamcity[message text='{0}' errorDetails='{1}' status='{2}']", sb, errorDetails, status);
             _teamCityServiceMessageLog.Logger.Log(typeof(Logger), Level.All, tcMessage, null);
         }


[RoundedFrame] create theme in OnStyleSet

--- src/Libraries/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs
+++ src/Libraries/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs
@@ -49,6 +49,7 @@
         private Cairo.Color fill_color;
         private bool draw_border = true;
         private Pattern fill_pattern;
+        private int frame_width;

         // Ugh, this is to avoid the GLib.MissingIntPtrCtorException seen by some; BGO #552169
         protected RoundedFrame (IntPtr ptr) : base (ptr)
@@ -87,10 +88,11 @@

 #region Gtk.Widget Overrides

-        protected override void OnRealized ()
-        {
-            base.OnRealized ();
+        protected override void OnStyleSet (Style previous_style)
+        {
+            base.OnStyleSet (previous_style);
             theme = Hyena.Gui.Theming.ThemeEngine.CreateTheme (this);
+            frame_width = (int)theme.Context.Radius + 1;
         }

         protected override void OnSizeRequested (ref Requisition requisition)
@@ -106,8 +108,8 @@
             }

             // Add the frame border
-            requisition.Width += ((int)BorderWidth + (int)theme.Context.Radius) * 2;
-            requisition.Height += ((int)BorderWidth + (int)theme.Context.Radius) * 2;
+            requisition.Width += ((int)BorderWidth + frame_width) * 2;
+            requisition.Height += ((int)BorderWidth + frame_width) * 2;
         }

         protected override void OnSizeAllocated (Gdk.Rectangle allocation)
@@ -120,11 +122,11 @@
                 return;
             }

-            child_allocation.X = (int)BorderWidth + (int)theme.Context.Radius;
-            child_allocation.Y = (int)BorderWidth + (int)theme.Context.Radius;
+            child_allocation.X = (int)BorderWidth + frame_width;
+            child_allocation.Y = (int)BorderWidth + frame_width;
             child_allocation.Width = (int)Math.Max (1, Allocation.Width - child_allocation.X * 2);
             child_allocation.Height = (int)Math.Max (1, Allocation.Height - child_allocation.Y -
-                (int)BorderWidth - (int)theme.Context.Radius);
+                (int)BorderWidth - frame_width);

             child_allocation.X += Allocation.X;
             child_allocation.Y += Allocation.Y;
@@ -160,10 +162,10 @@

         private void DrawFrame (Cairo.Context cr, Gdk.Rectangle clip)
         {
-            int x = child_allocation.X - (int)theme.Context.Radius;
-            int y = child_allocation.Y - (int)theme.Context.Radius;
-            int width = child_allocation.Width + 2 * (int)theme.Context.Radius;
-            int height = child_allocation.Height + 2 * (int)theme.Context.Radius;
+            int x = child_allocation.X - frame_width;
+            int y = child_allocation.Y - frame_width;
+            int width = child_allocation.Width + 2 * frame_width;
+            int height = child_allocation.Height + 2 * frame_width;

             Gdk.Rectangle rect = new Gdk.Rectangle (x, y, width, height);


Elaborating error message when no startup is specified

--- src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs
+++ src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs
@@ -43,7 +43,10 @@
             var environmentName = _hostingEnv.EnvironmentName;
             if (string.IsNullOrEmpty(startupAssemblyName))
             {
-                throw new ArgumentException("Value cannot be null or empty.", nameof(startupAssemblyName));
+                throw new ArgumentException(
+                    string.Format("A startup method, startup type or startup assembly is required. If specifying an assembly, '{0}' cannot be null or empty.",
+                    nameof(startupAssemblyName)),
+                    nameof(startupAssemblyName));
             }

             var assembly = Assembly.Load(new AssemblyName(startupAssemblyName));


Remove Additional items in Array. And fix object not set to an instance exception while generate sample json for Array schema. (#1169)

--- src/NJsonSchema/Generation/SampleJsonDataGenerator.cs
+++ src/NJsonSchema/Generation/SampleJsonDataGenerator.cs
@@ -50,7 +50,6 @@
                 {
                     var array = new JArray();
                     array.Add(Generate(schema.Item, usedSchemas));
-                    array.Add(Generate(schema.Item, usedSchemas));
                     return array;
                 }
                 else if (schema.Items.Count > 0)
@@ -73,7 +72,7 @@
                 {
                     return JToken.FromObject(schema.Enumeration.First());
                 }
-                else if (schema.Type.HasFlag(JsonObjectType.Integer))
+                else if (schema.Type.HasFlag(JsonObjectType.Integer) || schema.Type.HasFlag(JsonObjectType.Number))
                 {
                     return JToken.FromObject(0);
                 }
@@ -87,9 +86,13 @@
                     {
                         return JToken.FromObject(DateTimeOffset.UtcNow.ToString("o"));
                     }
+                    else if (property != null)
+                    {
+                        return JToken.FromObject(property.Name);
+                    }
                     else
                     {
-                        return JToken.FromObject(property.Name);
+                        return JToken.FromObject("");
                     }
                 }
                 else if (schema.Type.HasFlag(JsonObjectType.Boolean))


PropertiesDictionary - Skip fast unique validation when only 1 parameter (#4873)

--- src/NLog/Internal/Collections/PropertiesDictionary.cs
+++ src/NLog/Internal/Collections/PropertiesDictionary.cs
@@ -394,15 +394,19 @@
         /// <returns>Are all parameter names unique (true / false)</returns>
         private static bool VerifyUniqueMessageTemplateParametersFast(IList<MessageTemplateParameter> parameterList)
         {
-            if (parameterList is null || parameterList.Count == 0)
+            if (parameterList is null)
                 return true;
-
-            if (parameterList.Count > 10)
+
+            var parameterCount = parameterList.Count;
+            if (parameterCount <= 1)
+                return true;
+
+            if (parameterCount > 10)
                 return false;

-            for (int i = 0; i < parameterList.Count - 1; ++i)
-            {
-                for (int j = i + 1; j < parameterList.Count; ++j)
+            for (int i = 0; i < parameterCount - 1; ++i)
+            {
+                for (int j = i + 1; j < parameterCount; ++j)
                 {
                     if (parameterList[i].Name == parameterList[j].Name)
                         return false;


Added body parameter count check, #992

Added body parameter count check, #992

--- src/NSwag.CodeGeneration/Models/OperationModelBase.cs
+++ src/NSwag.CodeGeneration/Models/OperationModelBase.cs
@@ -6,6 +6,7 @@
 // <author>Rico Suter, mail@rsuter.com</author>
 //-----------------------------------------------------------------------

+using System;
 using System.Collections.Generic;
 using System.Linq;
 using NJsonSchema;
@@ -170,7 +171,17 @@
         public bool HasBody => HasContent || HasFormParameters;

         /// Gets the content parameter.
-        public TParameterModel ContentParameter => Parameters.SingleOrDefault(p => p.Kind == SwaggerParameterKind.Body);
+        /// <exception cref="InvalidOperationException" accessor="get">Multiple body parameters found in operation.</exception>
+        public TParameterModel ContentParameter
+        {
+            get
+            {
+                if (Parameters.Count(p => p.Kind == SwaggerParameterKind.Body) > 1)
+                    throw new InvalidOperationException("Multiple body parameters found in operation '" + Operation.OperationId + "'.");
+
+                return Parameters.SingleOrDefault(p => p.Kind == SwaggerParameterKind.Body);
+            }
+        }

         /// Gets the path parameters.
         public IEnumerable<TParameterModel> PathParameters => Parameters.Where(p => p.Kind == SwaggerParameterKind.Path);


Bug fix: MultiSearch was returning derived types as base type (as specified in generic)

This fix adds the ConcreteTypeConverter when multiple Types are passed in. Due to my lack of intimate knowledge of how all of the code works, my fix may look a little kludgy/hacky - I wanted to avoid breaking existing functionality with the multisearch - please feel free to revise/clean-up as needed.

--- src/Nest/Resolvers/Converters/MultiSearchConverter.cs
+++ src/Nest/Resolvers/Converters/MultiSearchConverter.cs
@@ -71,10 +71,44 @@
 				return multiSearchDescriptor;

 			var withMeta = docsJarray.Zip(this._descriptor._Operations, (doc, desc) => new MultiHitTuple { Hit = doc, Descriptor = desc });
+			var originalConverters = serializer.Converters.ToList();
+			var originalResolver = serializer.ContractResolver;
 			foreach (var m in withMeta)
 			{
+				bool newConverter = false;
+				if (m.Descriptor.Value._Types != null && m.Descriptor.Value._Types.Count() > 0 && m.Descriptor.Value._Types.Count() > m.Descriptor.Value._Types.Where(x => x.Type == m.Descriptor.Value._ClrType).Count())
+				{
+					var typeDict = m.Descriptor.Value._Types.ToDictionary(t => t.Resolve(this._settings), t => t.Type);
+					Func<dynamic, Hit<dynamic>, Type> typeSelector = (o, h) =>
+					{
+						Type t;
+						if (!typeDict.TryGetValue(h.Type, out t))
+							return m.Descriptor.Value._ClrType;
+						return t;
+					};
+					serializer.Converters.Clear();
+					foreach (var orig in originalConverters)
+					{
+						if (!(orig is MultiSearchConverter))
+							serializer.Converters.Add(orig);
+					}
+					var converter = new ConcreteTypeConverter(m.Descriptor.Value._ClrType, typeSelector);
+					serializer.Converters.Add(converter);
+					serializer.ContractResolver = new ElasticContractResolver(this._settings);
+					(serializer.ContractResolver as ElasticContractResolver).ConcreteTypeConverter = converter;
+					newConverter = true;
+				}
+
 				var generic = MakeDelegateMethodInfo.MakeGenericMethod(m.Descriptor.Value._ClrType);
 				generic.Invoke(null, new object[] { m, serializer, response._Responses, this._settings });
+
+				if (newConverter)
+				{
+					serializer.Converters.Clear();
+					serializer.ContractResolver = originalResolver;
+					foreach (var converter in originalConverters)
+						serializer.Converters.Add(converter);
+				}
 			}

 			return response;
@@ -85,4 +119,4 @@
 			return objectType == typeof(MultiSearchResponse);
 		}
 	}
-}+}


入力>最低限のキー定義

入力>最低限のキー定義

--- Core/Input/IInput.cs
+++ Core/Input/IInput.cs
@@ -11,4 +11,15 @@

         bool Update();
     }
+
+    public enum Keys : int
+    {
+        Left = 1,
+        Up = 2,
+        Right = 3,
+        Down = 4,
+        Jump = 5,
+        Attack = 6,
+        Smile = 7,
+    }
 }