Fix build errors in authentication tests.

--- Source/Tests/TraktApiSharp.Tests/Authentication/TraktAuthenticationTests.cs
+++ Source/Tests/TraktApiSharp.Tests/Authentication/TraktAuthenticationTests.cs
@@ -196,7 +196,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -283,7 +283,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -303,7 +303,7 @@
             response.Should().NotBeNull();
             response.AccessToken.Should().Be(accessToken.AccessToken);
             response.TokenType.Should().Be(accessToken.TokenType);
-            response.ExpiresInSeconds.Should().Be(accessToken.ExpiresInSeconds);
+            response.ExpiresIn.Should().Be(accessToken.ExpiresIn);
             response.RefreshToken.Should().Be(accessToken.RefreshToken);
             response.AccessScope.Should().Be(accessToken.AccessScope);
             response.Created.Should().BeCloseTo(DateTime.UtcNow, 1800 * 1000);
@@ -314,7 +314,7 @@
             clientAccessToken.Should().NotBeNull();
             clientAccessToken.AccessToken.Should().Be(response.AccessToken);
             clientAccessToken.TokenType.Should().Be(response.TokenType);
-            clientAccessToken.ExpiresInSeconds.Should().Be(response.ExpiresInSeconds);
+            clientAccessToken.ExpiresIn.Should().Be(response.ExpiresIn);
             clientAccessToken.RefreshToken.Should().Be(response.RefreshToken);
             clientAccessToken.AccessScope.Should().Be(response.AccessScope);
             clientAccessToken.Created.Should().Be(response.Created);
@@ -333,7 +333,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -445,7 +445,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -460,22 +460,22 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
-
-            act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
-            act.ShouldThrow<TraktAuthorizationException>();
-
-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
-
-            act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
-            act.ShouldThrow<TraktAuthorizationException>();
-
-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
-
-            act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
-            act.ShouldThrow<TraktAuthorizationException>();
-
-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };
+
+            act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
+            act.ShouldThrow<TraktAuthorizationException>();
+
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };
+
+            act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
+            act.ShouldThrow<TraktAuthorizationException>();
+
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };
+
+            act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
+            act.ShouldThrow<TraktAuthorizationException>();
+
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync();
             act.ShouldThrow<TraktAuthorizationException>();
@@ -541,7 +541,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -560,7 +560,7 @@
             response.Should().NotBeNull();
             response.AccessToken.Should().Be(accessToken.AccessToken);
             response.TokenType.Should().Be(accessToken.TokenType);
-            response.ExpiresInSeconds.Should().Be(accessToken.ExpiresInSeconds);
+            response.ExpiresIn.Should().Be(accessToken.ExpiresIn);
             response.RefreshToken.Should().Be(accessToken.RefreshToken);
             response.AccessScope.Should().Be(accessToken.AccessScope);
             response.Created.Should().BeCloseTo(DateTime.UtcNow, 1800 * 1000);
@@ -571,7 +571,7 @@
             clientAccessToken.Should().NotBeNull();
             clientAccessToken.AccessToken.Should().Be(response.AccessToken);
             clientAccessToken.TokenType.Should().Be(response.TokenType);
-            clientAccessToken.ExpiresInSeconds.Should().Be(response.ExpiresInSeconds);
+            clientAccessToken.ExpiresIn.Should().Be(response.ExpiresIn);
             clientAccessToken.RefreshToken.Should().Be(response.RefreshToken);
             clientAccessToken.AccessScope.Should().Be(response.AccessScope);
             clientAccessToken.Created.Should().Be(response.Created);
@@ -590,7 +590,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -702,7 +702,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -726,7 +726,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -737,7 +737,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -748,7 +748,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -759,7 +759,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -841,7 +841,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -860,7 +860,7 @@
             response.Should().NotBeNull();
             response.AccessToken.Should().Be(accessToken.AccessToken);
             response.TokenType.Should().Be(accessToken.TokenType);
-            response.ExpiresInSeconds.Should().Be(accessToken.ExpiresInSeconds);
+            response.ExpiresIn.Should().Be(accessToken.ExpiresIn);
             response.RefreshToken.Should().Be(accessToken.RefreshToken);
             response.AccessScope.Should().Be(accessToken.AccessScope);
             response.Created.Should().BeCloseTo(DateTime.UtcNow, 1800 * 1000);
@@ -871,7 +871,7 @@
             clientAccessToken.Should().NotBeNull();
             clientAccessToken.AccessToken.Should().Be(response.AccessToken);
             clientAccessToken.TokenType.Should().Be(response.TokenType);
-            clientAccessToken.ExpiresInSeconds.Should().Be(response.ExpiresInSeconds);
+            clientAccessToken.ExpiresIn.Should().Be(response.ExpiresIn);
             clientAccessToken.RefreshToken.Should().Be(response.RefreshToken);
             clientAccessToken.AccessScope.Should().Be(response.AccessScope);
             clientAccessToken.Created.Should().Be(response.Created);
@@ -890,7 +890,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1002,7 +1002,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1028,7 +1028,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1039,7 +1039,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1050,7 +1050,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1061,7 +1061,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1136,7 +1136,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1156,7 +1156,7 @@
             response.Should().NotBeNull();
             response.AccessToken.Should().Be(accessToken.AccessToken);
             response.TokenType.Should().Be(accessToken.TokenType);
-            response.ExpiresInSeconds.Should().Be(accessToken.ExpiresInSeconds);
+            response.ExpiresIn.Should().Be(accessToken.ExpiresIn);
             response.RefreshToken.Should().Be(accessToken.RefreshToken);
             response.AccessScope.Should().Be(accessToken.AccessScope);
             response.Created.Should().BeCloseTo(DateTime.UtcNow, 1800 * 1000);
@@ -1167,7 +1167,7 @@
             clientAccessToken.Should().NotBeNull();
             clientAccessToken.AccessToken.Should().Be(response.AccessToken);
             clientAccessToken.TokenType.Should().Be(response.TokenType);
-            clientAccessToken.ExpiresInSeconds.Should().Be(response.ExpiresInSeconds);
+            clientAccessToken.ExpiresIn.Should().Be(response.ExpiresIn);
             clientAccessToken.RefreshToken.Should().Be(response.RefreshToken);
             clientAccessToken.AccessScope.Should().Be(response.AccessScope);
             clientAccessToken.Created.Should().Be(response.Created);
@@ -1186,7 +1186,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1298,7 +1298,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1325,7 +1325,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1336,7 +1336,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1347,7 +1347,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1358,7 +1358,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1426,7 +1426,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1447,7 +1447,7 @@
             response.Should().NotBeNull();
             response.AccessToken.Should().Be(accessToken.AccessToken);
             response.TokenType.Should().Be(accessToken.TokenType);
-            response.ExpiresInSeconds.Should().Be(accessToken.ExpiresInSeconds);
+            response.ExpiresIn.Should().Be(accessToken.ExpiresIn);
             response.RefreshToken.Should().Be(accessToken.RefreshToken);
             response.AccessScope.Should().Be(accessToken.AccessScope);
             response.Created.Should().BeCloseTo(DateTime.UtcNow, 1800 * 1000);
@@ -1458,7 +1458,7 @@
             clientAccessToken.Should().NotBeNull();
             clientAccessToken.AccessToken.Should().Be(response.AccessToken);
             clientAccessToken.TokenType.Should().Be(response.TokenType);
-            clientAccessToken.ExpiresInSeconds.Should().Be(response.ExpiresInSeconds);
+            clientAccessToken.ExpiresIn.Should().Be(response.ExpiresIn);
             clientAccessToken.RefreshToken.Should().Be(response.RefreshToken);
             clientAccessToken.AccessScope.Should().Be(response.AccessScope);
             clientAccessToken.Created.Should().Be(response.Created);
@@ -1477,7 +1477,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1589,7 +1589,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1617,7 +1617,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1628,7 +1628,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1639,7 +1639,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1650,7 +1650,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync("mock refresh token", clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RefreshAuthorizationAsync(null, clientId, clientSecret, redirectUri);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1714,7 +1714,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1743,7 +1743,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1840,7 +1840,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1855,22 +1855,22 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync();
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync();
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync();
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync();
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync();
             act.ShouldThrow<TraktAuthorizationException>();
@@ -1899,7 +1899,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -1928,7 +1928,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -2025,7 +2025,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -2049,7 +2049,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -2060,7 +2060,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -2071,7 +2071,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -2082,7 +2082,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token");
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -2129,7 +2129,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -2160,7 +2160,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -2257,7 +2257,7 @@
             {
                 AccessToken = "mockAccessToken",
                 TokenType = TraktAccessTokenType.Bearer,
-                ExpiresInSeconds = 7200,
+                ExpiresIn = 7200,
                 RefreshToken = "mockRefreshToken",
                 AccessScope = TraktAccessScope.Public
             };
@@ -2283,7 +2283,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = null, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -2294,7 +2294,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = string.Empty, ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -2305,7 +2305,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 7200 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 7200 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();
@@ -2316,7 +2316,7 @@
             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync("mock refresh token", clientId);
             act.ShouldThrow<TraktAuthorizationException>();

-            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresInSeconds = 0 };
+            TestUtility.MOCK_TEST_CLIENT.Authentication.Authorization = new TraktAuthorization { RefreshToken = "mock refresh token", ExpiresIn = 0 };

             act = async () => await TestUtility.MOCK_TEST_CLIENT.Authentication.RevokeAuthorizationAsync(null, clientId);
             act.ShouldThrow<TraktAuthorizationException>();


Don't want to throw a BlogDoesNotExistException when trying to get to the HostAdmin site.

--- SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs
+++ SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs
@@ -129,7 +129,10 @@

 						// When going thru the install for MultiBlogs there will be no blogs in the system,
 						// so just return null... there must be a better way.
-						if(InstallationManager.IsOnLoginPage || (!anyBlogsExist && InstallationManager.IsInInstallDirectory))
+						// The same is true for requests to the HostAdmin directory.
+						if(InstallationManager.IsOnLoginPage
+							|| (!anyBlogsExist && InstallationManager.IsInInstallDirectory) // may not need the anyBlogsExist check
+							|| InstallationManager.IsInHostAdminDirectory)
 						{
 							return null;
 						}


Adding the photo in WSP Active Directory users. part 3

--- WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs
+++ WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs
@@ -781,12 +781,14 @@
         [WebMethod]
         public ResultObject SetPicture(string accountName, byte[] picture)
         {
+            return null;
             // return ExchangeServerController.SetPicture(accountName, picture);
         }

         [WebMethod]
         public BytesResult GetPicture(string accountName)
         {
+            return null;
             // return ExchangeServerController.GetPicture(accountName);
         }


Only use the rare or unique name when the item is identified because it doesn't exist otherwise

--- Yeena/PathOfExile/PoEItem.cs
+++ Yeena/PathOfExile/PoEItem.cs
@@ -306,7 +306,7 @@
         /// </summary>
         /// <returns>A string representation of this item.</returns>
         public override string ToString() {
-            if (FrameType == PoEItemFrameType.Rare || FrameType == PoEItemFrameType.Unique) return Name;
+            if ((FrameType == PoEItemFrameType.Rare || FrameType == PoEItemFrameType.Unique) && IsIdentified) return Name;
             return TypeLine;
         }
     }


adding missing documentation

adding missing documentation

--- ZUGFeRD/InvoiceDescriptor.cs
+++ ZUGFeRD/InvoiceDescriptor.cs
@@ -88,7 +88,18 @@
         /// Currency of the invoice
         /// </summary>
         public CurrencyCodes Currency { get; set; }
+
+
+        /// <summary>
+        /// Information about the buyer
+        /// </summary>
         public Party Buyer { get; set; }
+
+        /// <summary>
+        /// Buyer contact information
+        ///
+        /// A group of business terms providing contact information relevant for the buyer.
+        /// </summary>
         public Contact BuyerContact { get; set; }
         public List<TaxRegistration> BuyerTaxRegistration { get; set; } = new List<TaxRegistration>();
         public Party Seller { get; set; }
@@ -115,6 +126,9 @@
         /// </summary>
         public Party ShipFrom { get; set; }

+        /// <summary>
+        /// Free text on header level
+        /// </summary>
         public List<Note> Notes { get; set; } = new List<Note>();

         /// <summary>
@@ -212,17 +226,72 @@
         /// The amount may be negative; in that case the seller owes the amount to the buyer.
         /// </summary>
         public decimal? DuePayableAmount { get; set; } = null;
+
+        /// <summary>
+        /// A group of business terms providing information about VAT breakdown by different categories, rates and exemption reasons
+        /// </summary>
         public List<Tax> Taxes { get; set; } = new List<Tax>();
+
+        /// <summary>
+        /// Transport and packaging costs
+        /// </summary>
         public List<ServiceCharge> ServiceCharges { get; set; } = new List<ServiceCharge>();
+
+        /// <summary>
+        /// Detailed information on discounts and charges
+        /// </summary>
         public List<TradeAllowanceCharge> TradeAllowanceCharges { get; set; } = new List<TradeAllowanceCharge>();
-        public PaymentTerms PaymentTerms { get; set; }
+
+        /// <summary>
+        /// Detailed information about payment terms
+        /// </summary>
+        public PaymentTerms PaymentTerms { get; set; }
+
+        /// <summary>
+        /// A group of business terms providing information about a preceding invoices.
+        ///
+        /// To be used in case:
+        /// — a preceding invoice is corrected;
+        /// — preceding partial invoices are referred to from a final invoice;
+        /// — preceding pre-payment invoices are referred to from a final invoice.
+        /// </summary>
         public InvoiceReferencedDocument InvoiceReferencedDocument { get; set; }
+
+        /// <summary>
+        /// Detailed information about the accounting reference
+        /// </summary>
         public List<ReceivableSpecifiedTradeAccountingAccount> ReceivableSpecifiedTradeAccountingAccounts { get; internal set; } = new List<ReceivableSpecifiedTradeAccountingAccount>();
+
+        /// <summary>
+        /// Credit Transfer
+        ///
+        /// A group of business terms to specify credit transfer payments
+        /// </summary>
         public List<BankAccount> CreditorBankAccounts { get; set; } = new List<BankAccount>();
+
+        /// <summary>
+        /// Buyer bank information
+        /// </summary>
         public List<BankAccount> DebitorBankAccounts { get; set; } = new List<BankAccount>();
+
+        /// <summary>
+        /// Payment instructions
+        ///
+        /// /// If various accounts for credit transfers shall be transferred, the element
+        /// SpecifiedTradeSettlementPaymentMeans can be repeated for each account. The code
+        /// for the type of payment within the element typecode (BT-81) should therefore not
+        /// differ within the repetitions.
+        /// </summary>
         public PaymentMeans PaymentMeans { get; set; }

+        /// <summary>
+        /// Detailed information about the invoicing period, start date
+        /// </summary>
         public DateTime? BillingPeriodStart { get; set; }
+
+        /// <summary>
+        /// Detailed information about the invoicing period, end date
+        /// </summary>
         public DateTime? BillingPeriodEnd { get; set; }


code tidyups

code tidyups

--- FTAnalyser/Forms/Census.cs
+++ FTAnalyser/Forms/Census.cs
@@ -93,8 +93,7 @@
             int numIndividuals = (from x in individuals select x.IndividualID).Distinct().Count();
             int numFamilies = (from x in individuals select x.FamilyID).Distinct().Count();

-            tsRecords.Text = individuals.Count + " Rows containing " + numIndividuals + " Individuals and " +
-                             numFamilies + " Families. " + CensusProviderText();
+            tsRecords.Text = $"{individuals.Count} Rows containing {numIndividuals} Individuals and {numFamilies} Families. {CensusProviderText()}";
         }

         void ResetTable()


Fix typo _conneIdleTimeout => _connIdleTimeout

--- Neo4j.Driver/Neo4j.Driver/Internal/ConnectionPool.cs
+++ Neo4j.Driver/Neo4j.Driver/Internal/ConnectionPool.cs
@@ -34,7 +34,7 @@
         private int _poolSize = 0;
         private readonly int _maxPoolSize;
         private readonly int _idlePoolSize;
-        private readonly TimeSpan _conneIdleTimeout;
+        private readonly TimeSpan _connIdleTimeout;
         private readonly TimeSpan _connAcquisitionTimeout;

         private readonly ConnectionSettings _connectionSettings;
@@ -70,7 +70,7 @@
             _connectionSettings = connectionSettings;
             _maxPoolSize = connectionPoolSettings.MaxConnectionPoolSize;
             _idlePoolSize = connectionPoolSettings.MaxIdleConnectionPoolSize;
-            _conneIdleTimeout = connectionPoolSettings.ConnectionIdleTimeout;
+            _connIdleTimeout = connectionPoolSettings.ConnectionIdleTimeout;
             _connAcquisitionTimeout = connectionPoolSettings.ConnectionAcquisitionTimeout;

             _logger = logger;
@@ -269,7 +269,7 @@

         private bool IsConnectionIdleDetectionEnabled()
         {
-            return _conneIdleTimeout.TotalMilliseconds >= 0;
+            return _connIdleTimeout.TotalMilliseconds >= 0;
         }

         private bool HasBeenIdleForTooLong(IPooledConnection connection)
@@ -278,7 +278,7 @@
             {
                 return false;
             }
-            if (connection.IdleTimer.ElapsedMilliseconds > _conneIdleTimeout.TotalMilliseconds)
+            if (connection.IdleTimer.ElapsedMilliseconds > _connIdleTimeout.TotalMilliseconds)
             {
                 return true;
             }


do not throw exceptions and check for nulls

--- Neo4j.Driver/Neo4j.Driver/Internal/ConnectionPool.cs
+++ Neo4j.Driver/Neo4j.Driver/Internal/ConnectionPool.cs
@@ -108,13 +108,17 @@
             PooledConnection conn = null;
             try
             {
-                _statistics?.IncrementConnectionToCreate();
-
                 conn = NewPooledConnection();
-                conn.Init();
-
-                _statistics?.IncrementConnectionCreated();
-                return conn;
+                if (conn != null)
+                {
+                    _statistics?.IncrementConnectionToCreate();
+
+                    conn.Init();
+
+                    _statistics?.IncrementConnectionCreated();
+
+                    return conn;
+                }
             }
             catch
             {
@@ -124,6 +128,8 @@
                 DestroyConnection(conn);
                 throw;
             }
+
+            return null;
         }

         private async Task<IPooledConnection> CreateNewPooledConnectionAsync()
@@ -131,13 +137,17 @@
             PooledConnection conn = null;
             try
             {
-                _statistics?.IncrementConnectionToCreate();
-
                 conn = NewPooledConnection();
-                await conn.InitAsync().ConfigureAwait(false);
-
-                _statistics?.IncrementConnectionCreated();
-                return conn;
+                if (conn != null)
+                {
+                    _statistics?.IncrementConnectionToCreate();
+
+                    await conn.InitAsync().ConfigureAwait(false);
+
+                    _statistics?.IncrementConnectionCreated();
+
+                    return conn;
+                }
             }
             catch
             {
@@ -147,24 +157,28 @@
                 await DestroyConnectionAsync(conn).ConfigureAwait(false);
                 throw;
             }
+
+            return null;
         }

         private PooledConnection NewPooledConnection()
         {
-            var currentPoolSize = Interlocked.Increment(ref _poolSize);
-            if (_maxPoolSize != Config.Infinite && currentPoolSize > _maxPoolSize)
-            {
-                throw new InvalidOperationException();
-            }
-
-            return _fakeConnection != null
-                ? new PooledConnection(_fakeConnection, this)
-                : new PooledConnection(new SocketConnection(_uri, _connectionSettings, _bufferSettings, Logger), this);
+            if (IncrementAndCheckPoolSize())
+            {
+                return _fakeConnection != null
+                    ? new PooledConnection(_fakeConnection, this)
+                    : new PooledConnection(new SocketConnection(_uri, _connectionSettings, _bufferSettings, Logger),
+                        this);
+            }
+
+            DecrementPoolSize();
+
+            return null;
         }

         private void DestroyConnection(IPooledConnection conn)
         {
-            Interlocked.Decrement(ref _poolSize);
+            DecrementPoolSize();
             if (conn == null)
             {
                 return;
@@ -175,9 +189,25 @@
             _statistics?.IncrementConnectionClosed();
         }

+        private bool IncrementAndCheckPoolSize()
+        {
+            var currentPoolSize = Interlocked.Increment(ref _poolSize);
+            if (_maxPoolSize != Config.Infinite && currentPoolSize > _maxPoolSize)
+            {
+                return false;
+            }
+
+            return true;
+        }
+
+        private void DecrementPoolSize()
+        {
+            Interlocked.Decrement(ref _poolSize);
+        }
+
         private async Task DestroyConnectionAsync(IPooledConnection conn)
         {
-            Interlocked.Decrement(ref _poolSize);
+            DecrementPoolSize();
             if (conn == null)
             {
                 return;
@@ -222,14 +252,10 @@
                             {
                                 if (!IsConnectionPoolFull())
                                 {
-                                    try
+                                    connection = CreateNewPooledConnection();
+                                    if (connection != null)
                                     {
-                                        connection = CreateNewPooledConnection();
                                         break;
-                                    }
-                                    catch (InvalidOperationException)
-                                    {
-                                        // we have exceeded MaxConnectionPoolSize, so continue looping...
                                     }
                                 }

@@ -308,14 +334,10 @@
                             {
                                 if (!IsConnectionPoolFull())
                                 {
-                                    try
+                                    connection = await CreateNewPooledConnectionAsync().ConfigureAwait(false);
+                                    if (connection != null)
                                     {
-                                        connection = await CreateNewPooledConnectionAsync().ConfigureAwait(false);
                                         break;
-                                    }
-                                    catch (InvalidOperationException)
-                                    {
-                                        // we have exceeded MaxConnectionPoolSize, so continue looping...
                                     }
                                 }


Add a compile time option for a case insensitive console.

--- OpenSim/Framework/ConsoleFramework/CommandConsole.cs
+++ OpenSim/Framework/ConsoleFramework/CommandConsole.cs
@@ -43,6 +43,8 @@
 {
     public class Commands
     {
+        public const bool _ConsoleIsCaseSensitive = false;
+
         /// <summary>
         /// Encapsulates a command that can be invoked from the console
         /// </summary>
@@ -88,6 +90,9 @@

             public void AddCommand (CommandInfo info)
             {
+                if (!_ConsoleIsCaseSensitive) //Force to all lowercase
+                    info.command = info.command.ToLower ();
+
                 //If our path is "", we can't replace, otherwise we just get ""
                 string innerPath = info.command;
                 if (ourPath != "")
@@ -120,6 +125,8 @@
                 if (command.Length != 0)
                 {
                     string innerPath = string.Join (" ", command);
+                    if (!_ConsoleIsCaseSensitive)
+                        innerPath = innerPath.ToLower ();
                     if (ourPath != "")
                         innerPath = innerPath.Replace (ourPath, "");
                     if (innerPath.StartsWith (" "))
@@ -188,6 +195,8 @@
                         string cmdToExecute = commandPath[0];
                         if (cmdToExecute == "help")
                             cmdToExecute = commandPath[1];
+                        if (!_ConsoleIsCaseSensitive)
+                            cmdToExecute = cmdToExecute.ToLower ();
                         //Its down the tree somewhere
                         CommandSet downTheTree;
                         if (commandsets.TryGetValue(cmdToExecute, out downTheTree))
@@ -218,6 +227,8 @@
                 if (command.Length != 0)
                 {
                     string innerPath = string.Join (" ", command);
+                    if (!_ConsoleIsCaseSensitive)
+                        innerPath = innerPath.ToLower ();
                     if (ourPath != "")
                         innerPath = innerPath.Replace (ourPath, "");
                     if (innerPath.StartsWith (" "))
@@ -236,8 +247,13 @@
                         }
                         if (commandPath.Length != 0)
                         {
+                            string cmdToExecute = commandPath[0];
+                            if (cmdToExecute == "help")
+                                cmdToExecute = commandPath[1];
+                            if (!_ConsoleIsCaseSensitive)
+                                cmdToExecute = cmdToExecute.ToLower ();
                             CommandSet downTheTree;
-                            if (commandsets.TryGetValue (commandPath[0], out downTheTree))
+                            if (commandsets.TryGetValue (cmdToExecute, out downTheTree))
                             {
                                 values.AddRange(downTheTree.FindCommands (commandPath));
                             }
@@ -247,7 +263,7 @@
                                 foreach (KeyValuePair<string, CommandSet> cmd in commandsets)
                                 {
                                     //If it starts with it, execute it (eg. q for quit)
-                                    if (cmd.Key.StartsWith (commandPath[0]))
+                                    if (cmd.Key.StartsWith (cmdToExecute))
                                     {
                                         values.AddRange (cmd.Value.FindCommands (commandPath));
                                     }
@@ -257,9 +273,14 @@
                     }
                     else if(commandPath.Length != 0)
                     {
+                        string cmdToExecute = commandPath[0];
+                        if (cmdToExecute == "help")
+                            cmdToExecute = commandPath[1];
+                        if (!_ConsoleIsCaseSensitive)
+                            cmdToExecute = cmdToExecute.ToLower ();
                         //Its down the tree somewhere
                         CommandSet downTheTree;
-                        if (commandsets.TryGetValue (commandPath[0], out downTheTree))
+                        if (commandsets.TryGetValue (cmdToExecute, out downTheTree))
                         {
                             return downTheTree.FindCommands (commandPath);
                         }
@@ -269,7 +290,7 @@
                             foreach (KeyValuePair<string, CommandSet> cmd in commandsets)
                             {
                                 //If it starts with it, execute it (eg. q for quit)
-                                if (cmd.Key.StartsWith (commandPath[0]))
+                                if (cmd.Key.StartsWith (cmdToExecute))
                                 {
                                     return cmd.Value.FindCommands (commandPath);
                                 }


do not use a blind expire of m_pendingCache. Entries must be valid while  respective HandleUseCircuitCode, no matter how long it takes, so a viewer  retry doesnt start a overlapping one. It HandleUseCircuitCode  responsability to always remove entries, even on fails. Remove a client  even if m_scene.CloseAgent fails.

--- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -308,8 +308,8 @@

-        private ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>> m_pendingCache = new ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>>();
-
+//        private ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>> m_pendingCache = new ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>>();
+        private Dictionary<IPEndPoint, Queue<UDPPacketBuffer>> m_pendingCache = new Dictionary<IPEndPoint, Queue<UDPPacketBuffer>>();
         /// <summary>
         /// Event used to signal when queued packets are available for sending.
         /// </summary>
@@ -1416,10 +1416,12 @@
                     // And if there is a UseCircuitCode pending, also drop it
                     lock (m_pendingCache)
                     {
-                        if (m_pendingCache.Contains(endPoint))
+//                        if (m_pendingCache.Contains(endPoint))
+                        if (m_pendingCache.ContainsKey(endPoint))
                             return;

-                        m_pendingCache.AddOrUpdate(endPoint, new Queue<UDPPacketBuffer>(), 60);
+//                        m_pendingCache.AddOrUpdate(endPoint, new Queue<UDPPacketBuffer>(), 60);
+                        m_pendingCache.Add(endPoint, new Queue<UDPPacketBuffer>());
                     }

                     // We need to copy the endpoint so that it doesn't get changed when another thread reuses the
@@ -1765,10 +1767,7 @@
                             uccp.CircuitCode.SessionID,
                             endPoint,
                             sessionInfo);
-
-                    // Now we know we can handle more data
-                    Thread.Sleep(200);
-
+
                     // Obtain the pending queue and remove it from the cache
                     Queue<UDPPacketBuffer> queue = null;

@@ -1786,13 +1785,16 @@
                     m_log.DebugFormat("[LLUDPSERVER]: Client created, processing pending queue, {0} entries", queue.Count);

                     // Reinject queued packets
-                    while (queue.Count > 0)
+                    if (queue != null)
                     {
-                        UDPPacketBuffer buf = queue.Dequeue();
-                        PacketReceived(buf);
+                        while (queue.Count > 0)
+                        {
+                            UDPPacketBuffer buf = queue.Dequeue();
+                            PacketReceived(buf);
+                        }
+
+                        queue = null;
                     }
-
-                    queue = null;

                     // Send ack straight away to let the viewer know that the connection is active.
                     // The client will be null if it already exists (e.g. if on a region crossing the client sends a use
@@ -1815,6 +1817,7 @@
                     m_log.WarnFormat(
                         "[LLUDPSERVER]: Ignoring connection request for {0} to {1} with unknown circuit code {2} from IP {3}",
                         uccp.CircuitCode.ID, m_scene.RegionInfo.RegionName, uccp.CircuitCode.Code, endPoint);
+
                     lock (m_pendingCache)
                         m_pendingCache.Remove(endPoint);
                 }
@@ -1825,6 +1828,10 @@
             }
             catch (Exception e)
             {
+                // this may already be done.. or not..
+                lock (m_pendingCache)
+                    m_pendingCache.Remove(endPoint);
+
                 m_log.ErrorFormat(
                     "[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed.  Exception {3}{4}",
                     endPoint != null ? endPoint.ToString() : "n/a",
@@ -2058,11 +2065,12 @@
                     "[LLUDPSERVER]: No packets received from {0} agent of {1} for {2}ms in {3}.  Disconnecting.",
                     client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, timeoutTicks, m_scene.Name);

-                if (!client.SceneAgent.IsChildAgent)
+                if (client.SceneAgent != null && !client.SceneAgent.IsChildAgent)
                      client.Kick("Simulator logged you out due to connection timeout.");
             }

-            m_scene.CloseAgent(client.AgentId, true);
+            if (!m_scene.CloseAgent(client.AgentId, true))
+                client.Close(true,true);
         }

         private void IncomingPacketHandler()


* Moved 13 more packet type handlers to PacketHandler Delegates..   and out of of that giant 5000 line switch, ProcessInPacket.

--- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4300,6 +4300,21 @@
             AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest);
             AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
             AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate);
+            AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply);
+            AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage);
+            AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship);
+            AddLocalPacketHandler(PacketType.DeclineFriendship, HandlerDeclineFriendship);
+            AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFrendship);
+            AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject);
+            AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
+            AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
+            AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply);
+            AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest);
+            AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance);
+            AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing);
+            //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
+            //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
+            //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
             //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
             //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
         }
@@ -4609,6 +4624,356 @@
             return true;
         }

+        private bool HandlerScriptDialogReply(IClientAPI sender, Packet Pack)
+        {
+            ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (rdialog.AgentData.SessionID != SessionId ||
+                    rdialog.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            int ch = rdialog.Data.ChatChannel;
+            byte[] msg = rdialog.Data.ButtonLabel;
+            if (OnChatFromClient != null)
+            {
+                OSChatMessage args = new OSChatMessage();
+                args.Channel = ch;
+                args.From = String.Empty;
+                args.Message = Utils.BytesToString(msg);
+                args.Type = ChatTypeEnum.Shout;
+                args.Position = new Vector3();
+                args.Scene = Scene;
+                args.Sender = this;
+                ChatMessage handlerChatFromClient2 = OnChatFromClient;
+                if (handlerChatFromClient2 != null)
+                    handlerChatFromClient2(this, args);
+            }
+
+            return true;
+        }
+
+        private bool HandlerImprovedInstantMessage(IClientAPI sender, Packet Pack)
+        {
+            ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (msgpack.AgentData.SessionID != SessionId ||
+                    msgpack.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
+            string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message);
+            ImprovedInstantMessage handlerInstantMessage = OnInstantMessage;
+
+            if (handlerInstantMessage != null)
+            {
+                GridInstantMessage im = new GridInstantMessage(Scene,
+                        msgpack.AgentData.AgentID,
+                        IMfromName,
+                        msgpack.MessageBlock.ToAgentID,
+                        msgpack.MessageBlock.Dialog,
+                        msgpack.MessageBlock.FromGroup,
+                        IMmessage,
+                        msgpack.MessageBlock.ID,
+                        msgpack.MessageBlock.Offline != 0 ? true : false,
+                        msgpack.MessageBlock.Position,
+                        msgpack.MessageBlock.BinaryBucket);
+
+                handlerInstantMessage(this, im);
+            }
+            return true;
+
+        }
+
+        private bool HandlerAcceptFriendship(IClientAPI sender, Packet Pack)
+        {
+            AcceptFriendshipPacket afriendpack = (AcceptFriendshipPacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (afriendpack.AgentData.SessionID != SessionId ||
+                    afriendpack.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            // My guess is this is the folder to stick the calling card into
+            List<UUID> callingCardFolders = new List<UUID>();
+
+            UUID agentID = afriendpack.AgentData.AgentID;
+            UUID transactionID = afriendpack.TransactionBlock.TransactionID;
+
+            for (int fi = 0; fi < afriendpack.FolderData.Length; fi++)
+            {
+                callingCardFolders.Add(afriendpack.FolderData[fi].FolderID);
+            }
+
+            FriendActionDelegate handlerApproveFriendRequest = OnApproveFriendRequest;
+            if (handlerApproveFriendRequest != null)
+            {
+                handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders);
+            }
+            return true;
+
+        }
+
+        private bool HandlerDeclineFriendship(IClientAPI sender, Packet Pack)
+        {
+            DeclineFriendshipPacket dfriendpack = (DeclineFriendshipPacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (dfriendpack.AgentData.SessionID != SessionId ||
+                    dfriendpack.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            if (OnDenyFriendRequest != null)
+            {
+                OnDenyFriendRequest(this,
+                                    dfriendpack.AgentData.AgentID,
+                                    dfriendpack.TransactionBlock.TransactionID,
+                                    null);
+            }
+            return true;
+        }
+
+        private bool HandlerTerminateFrendship(IClientAPI sender, Packet Pack)
+        {
+            TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (tfriendpack.AgentData.SessionID != SessionId ||
+                    tfriendpack.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            UUID listOwnerAgentID = tfriendpack.AgentData.AgentID;
+            UUID exFriendID = tfriendpack.ExBlock.OtherID;
+
+            FriendshipTermination handlerTerminateFriendship = OnTerminateFriendship;
+            if (handlerTerminateFriendship != null)
+            {
+                handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
+            }
+            return true;
+        }
+
+        private bool HandlerRezObject(IClientAPI sender, Packet Pack)
+        {
+            RezObjectPacket rezPacket = (RezObjectPacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (rezPacket.AgentData.SessionID != SessionId ||
+                    rezPacket.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            RezObject handlerRezObject = OnRezObject;
+            if (handlerRezObject != null)
+            {
+                handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
+                                 rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID,
+                                 rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection,
+                                 rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem,
+                                 rezPacket.RezData.FromTaskID);
+            }
+            return true;
+        }
+
+        private bool HandlerDeRezObject(IClientAPI sender, Packet Pack)
+        {
+            DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (DeRezPacket.AgentData.SessionID != SessionId ||
+                    DeRezPacket.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            DeRezObject handlerDeRezObject = OnDeRezObject;
+            if (handlerDeRezObject != null)
+            {
+                List<uint> deRezIDs = new List<uint>();
+
+                foreach (DeRezObjectPacket.ObjectDataBlock data in
+                    DeRezPacket.ObjectData)
+                {
+                    deRezIDs.Add(data.ObjectLocalID);
+                }
+                // It just so happens that the values on the DeRezAction enumerator match the Destination
+                // values given by a Second Life client
+                handlerDeRezObject(this, deRezIDs,
+                                   DeRezPacket.AgentBlock.GroupID,
+                                   (DeRezAction)DeRezPacket.AgentBlock.Destination,
+                                   DeRezPacket.AgentBlock.DestinationID);
+
+            }
+            return true;
+        }
+
+        private bool HandlerModifyLand(IClientAPI sender, Packet Pack)
+        {
+            ModifyLandPacket modify = (ModifyLandPacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (modify.AgentData.SessionID != SessionId ||
+                    modify.AgentData.AgentID != AgentId)
+                    return true;
+            }
+
+            #endregion
+            //m_log.Info("[LAND]: LAND:" + modify.ToString());
+            if (modify.ParcelData.Length > 0)
+            {
+                if (OnModifyTerrain != null)
+                {
+                    for (int i = 0; i < modify.ParcelData.Length; i++)
+                    {
+                        ModifyTerrain handlerModifyTerrain = OnModifyTerrain;
+                        if (handlerModifyTerrain != null)
+                        {
+                            handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
+                                                 modify.ModifyBlock.BrushSize,
+                                                 modify.ModifyBlock.Action, modify.ParcelData[i].North,
+                                                 modify.ParcelData[i].West, modify.ParcelData[i].South,
+                                                 modify.ParcelData[i].East, AgentId);
+                        }
+                    }
+                }
+            }
+
+            return true;
+        }
+
+        private bool HandlerRegionHandshakeReply(IClientAPI sender, Packet Pack)
+        {
+            Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
+            if (handlerRegionHandShakeReply != null)
+            {
+                handlerRegionHandShakeReply(this);
+            }
+
+            return true;
+        }
+
+        private bool HandlerAgentWearablesRequest(IClientAPI sender, Packet Pack)
+        {
+            GenericCall2 handlerRequestWearables = OnRequestWearables;
+
+            if (handlerRequestWearables != null)
+            {
+                handlerRequestWearables();
+            }
+
+            Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData;
+
+            if (handlerRequestAvatarsData != null)
+            {
+                handlerRequestAvatarsData(this);
+            }
+
+            return true;
+        }
+
+        private bool HandlerAgentSetAppearance(IClientAPI sender, Packet Pack)
+        {
+            AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
+
+            #region Packet Session and User Check
+            if (m_checkPackets)
+            {
+                if (appear.AgentData.SessionID != SessionId ||
+                    appear.AgentData.AgentID != AgentId)
+                    return true;
+            }
+            #endregion
+
+            SetAppearance handlerSetAppearance = OnSetAppearance;
+            if (handlerSetAppearance != null)
+            {
+                // Temporarily protect ourselves from the mantis #951 failure.
+                // However, we could do this for several other handlers where a failure isn't terminal
+                // for the client session anyway, in order to protect ourselves against bad code in plugins
+                try
+                {
+                    byte[] visualparams = new byte[appear.VisualParam.Length];
+                    for (int i = 0; i < appear.VisualParam.Length; i++)
+                        visualparams[i] = appear.VisualParam[i].ParamValue;
+
+                    Primitive.TextureEntry te = null;
+                    if (appear.ObjectData.TextureEntry.Length > 1)
+                        te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length);
+
+                    handlerSetAppearance(te, visualparams);
+                }
+                catch (Exception e)
+                {
+                    m_log.ErrorFormat(
+                        "[CLIENT VIEW]: AgentSetApperance packet handler threw an exception, {0}",
+                        e);
+                }
+            }
+
+            return true;
+        }
+
+        private bool HandlerAgentIsNowWearing(IClientAPI sender, Packet Pack)
+        {
+            if (OnAvatarNowWearing != null)
+            {
+                AgentIsNowWearingPacket nowWearing = (AgentIsNowWearingPacket)Pack;
+
+                #region Packet Session and User Check
+                if (m_checkPackets)
+                {
+                    if (nowWearing.AgentData.SessionID != SessionId ||
+                        nowWearing.AgentData.AgentID != AgentId)
+                        return true;
+                }
+                #endregion
+
+                AvatarWearingArgs wearingArgs = new AvatarWearingArgs();
+                for (int i = 0; i < nowWearing.WearableData.Length; i++)
+                {
+                    AvatarWearingArgs.Wearable wearable =
+                        new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID,
+                                                       nowWearing.WearableData[i].WearableType);
+                    wearingArgs.NowWearing.Add(wearable);
+                }
+
+                AvatarNowWearing handlerAvatarNowWearing = OnAvatarNowWearing;
+                if (handlerAvatarNowWearing != null)
+                {
+                    handlerAvatarNowWearing(this, wearingArgs);
+                }
+            }
+            return true;
+        }
+
         #endregion Packet Handlers

         public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
@@ -5106,6 +5471,7 @@
             switch (Pack.Type)
             {
                 #region Scene/Avatar
+                #region CommentedOut
                 /*
                 case PacketType.AvatarPropertiesRequest:
                     AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
@@ -5193,7 +5559,7 @@
                         handlerUpdateAvatarProperties(this, UserProfile);
                     }
                     break;
-                */
+
                 case PacketType.ScriptDialogReply:
                     ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;

@@ -5224,7 +5590,7 @@
                     }

                     break;
-
+
                 case PacketType.ImprovedInstantMessage:
                     ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;

@@ -5258,7 +5624,7 @@
                         handlerInstantMessage(this, im);
                     }
                     break;
-
+
                 case PacketType.AcceptFriendship:
                     AcceptFriendshipPacket afriendpack = (AcceptFriendshipPacket)Pack;

@@ -5331,7 +5697,7 @@
                         handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
                     }
                     break;
-
+
                 case PacketType.RezObject:
                     RezObjectPacket rezPacket = (RezObjectPacket)Pack;

@@ -5386,7 +5752,7 @@

                     }
                     break;
-
+
                 case PacketType.ModifyLand:
                     ModifyLandPacket modify = (ModifyLandPacket)Pack;

@@ -5518,7 +5884,8 @@
                         }
                     }
                     break;
-
+*/
+                #endregion
                 case PacketType.RezSingleAttachmentFromInv:
                     RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv;
                     if (handlerRezSingleAttachment != null)


make ubitODE ignore X and Y rotation components on avatar rotations

--- OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
+++ OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
@@ -80,6 +80,7 @@
         private Vector3 m_rotationalVelocity;
         private Vector3 m_size;
         private Quaternion m_orientation;
+        private Quaternion m_orientation2D;
         private float m_mass = 80f;
         public float m_density = 60f;
         private bool m_pidControllerActive = true;
@@ -207,6 +208,7 @@

             m_feetOffset = pfeetOffset;
             m_orientation = Quaternion.Identity;
+            m_orientation2D = Quaternion.Identity;
             m_density = density;

             // force lower density for testing
@@ -649,7 +651,6 @@
             {
 //                fakeori = value;
 //                givefakeori++;
-
                 value.Normalize();
                 AddChange(changes.Orientation, value);
             }
@@ -977,7 +978,7 @@
                 // force a full inelastic collision
                 m_collisionException = true;

-                offset = m_size * m_orientation;
+                offset = m_size * m_orientation2D;

                 offset.X = (float)Math.Abs(offset.X) * 0.5f + contact.depth;
                 offset.Y = (float)Math.Abs(offset.Y) * 0.5f + contact.depth;
@@ -1143,10 +1144,10 @@
             // so force it back to identity

             d.Quaternion qtmp;
-            qtmp.W = m_orientation.W;
-            qtmp.X = m_orientation.X;
-            qtmp.Y = m_orientation.Y;
-            qtmp.Z = m_orientation.Z;
+            qtmp.W = m_orientation2D.W;
+            qtmp.X = m_orientation2D.X;
+            qtmp.Y = m_orientation2D.Y;
+            qtmp.Z = m_orientation2D.Z;
             d.BodySetQuaternion(Body, ref qtmp);

             if (m_pidControllerActive == false)
@@ -1679,14 +1680,36 @@

         private void changeOrientation(Quaternion newOri)
         {
-            d.Quaternion myrot = new d.Quaternion();
-            myrot.X = newOri.X;
-            myrot.Y = newOri.Y;
-            myrot.Z = newOri.Z;
-            myrot.W = newOri.W;
-            float t = d.JointGetAMotorAngle(Amotor, 2);
-            d.BodySetQuaternion(Body,ref myrot);
-            m_orientation = newOri;
+            if (m_orientation != newOri)
+            {
+                m_orientation = newOri; // keep a copy for core use
+                // but only use rotations around Z
+
+                m_orientation2D.W = newOri.W;
+                m_orientation2D.Z = newOri.Z;
+
+                float t = m_orientation2D.W * m_orientation2D.W + m_orientation2D.Z * m_orientation2D.Z;
+                if (t > 0)
+                {
+                    t = 1.0f / (float)Math.Sqrt(t);
+                    m_orientation2D.W *= t;
+                    m_orientation2D.Z *= t;
+                }
+                else
+                {
+                    m_orientation2D.W = 1.0f;
+                    m_orientation2D.Z = 0f;
+                }
+                m_orientation2D.Y = 0f;
+                m_orientation2D.X = 0f;
+
+                d.Quaternion myrot = new d.Quaternion();
+                myrot.X = m_orientation2D.X;
+                myrot.Y = m_orientation2D.Y;
+                myrot.Z = m_orientation2D.Z;
+                myrot.W = m_orientation2D.W;
+                d.BodySetQuaternion(Body, ref myrot);
+            }
         }

         private void changeVelocity(Vector3 newVel)


* Enabled hydraulic erosion command.

* Enabled hydraulic erosion command.

--- OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -262,6 +262,7 @@
                         resultText += "terrain rescale <min> <max> - rescales a terrain to be between <min> and <max> meters high\n";
                         resultText += "terrain erode aerobic <windspeed> <pickupmin> <dropmin> <carry> <rounds> <lowest>\n";
                         resultText += "terrain erode thermal <talus> <rounds> <carry>\n";
+                        resultText += "terrain erode hydraulic <rain> <evaporation> <solubility> <frequency> <rounds>\n";
                         resultText += "terrain multiply <val> - multiplies a terrain by <val>\n";
                         resultText += "terrain revert - reverts the terrain to the stored original\n";
                         resultText += "terrain bake - saves the current terrain into the revert map\n";
@@ -412,6 +413,11 @@
                     break;
                 case "thermal":
                     heightmap.thermalWeathering(Convert.ToDouble(args[2]), Convert.ToInt32(args[3]), Convert.ToDouble(args[4]));
+                    break;
+                case "hydraulic":
+                    Channel rainMap = new Channel(w, h);
+                    rainMap.fill(Convert.ToDouble(args[2]));
+                    heightmap.hydraulicErosion(rainMap, Convert.ToDouble(args[3]), Convert.ToDouble(args[4]), Convert.ToInt32(args[5]), Convert.ToInt32(args[6]));
                     break;
                 default:
                     resultText = "Unknown erosion type";


重複コードを削除

重複コードを削除

--- Unity/GestureDemo2/Assets/App/Scripts/Manipulation.cs
+++ Unity/GestureDemo2/Assets/App/Scripts/Manipulation.cs
@@ -7,8 +7,6 @@
 public class Manipulation : MonoBehaviour, IManipulationReciever {

     Vector3 oldPosition = Vector3.zero;
-
-    bool isHold = false;

     // Use this for initialization
     void Start () {
@@ -22,34 +20,24 @@

     public void OnManipulationStarted(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headRay)
     {
-        if (GestureManager.Instance.FocusedObject == gameObject)
-        {
-            //Debug.Log("Manipulation Started : " + string.Format("{0},{1},{2}", cumulativeDelta.x, cumulativeDelta.y, cumulativeDelta.z));
+        //Debug.Log("Manipulation Started : " + string.Format("{0},{1},{2}", cumulativeDelta.x, cumulativeDelta.y, cumulativeDelta.z));

-            isHold = true;
-
-            oldPosition = cumulativeDelta;
-        }
+        oldPosition = cumulativeDelta;
     }

     public void OnManipulationUpdated(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headRay)
     {
-        if (isHold)
-        {
-            //Debug.Log("Manipulation Updated : " + string.Format("{0},{1},{2}", cumulativeDelta.x, cumulativeDelta.y, cumulativeDelta.z ));
-            transform.Translate(cumulativeDelta - oldPosition);
+        //Debug.Log("Manipulation Updated : " + string.Format("{0},{1},{2}", cumulativeDelta.x, cumulativeDelta.y, cumulativeDelta.z ));

-            oldPosition = cumulativeDelta;
-        }
+        transform.Translate(cumulativeDelta - oldPosition);
+        oldPosition = cumulativeDelta;
     }

     public void OnManipulationCompleted(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headRay)
     {
-        isHold = false;
     }

     public void OnManipulationCanceled(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headRay)
     {
-        isHold = false;
     }
 }


better menu colors

better menu colors

--- Voxalia/ClientGame/ClientMainSystem/MainMenuScreen.cs
+++ Voxalia/ClientGame/ClientMainSystem/MainMenuScreen.cs
@@ -14,10 +14,10 @@
         public override void Init()
         {
             Menus = new UIMenu(TheClient);
-            Menus.Add(new UITextLink("^5S^7ingleplayer", "^!^e^5S^7ingleplayer", "^7^e^5S^!ingleplayer", () => {
+            Menus.Add(new UITextLink("^%S^7ingleplayer", "^%S^e^7ingleplayer", "^7^e^%S^0ingleplayer", () => {
                 TheClient.ShowSingleplayer();
             }, 10, 300, TheClient.FontSets.SlightlyBigger));
-            Menus.Add(new UITextLink("^5M^7ultiplayer", "^!^e^5M^7ultiplayer", "^7^e^5M^!ultiplayer", () => {
+            Menus.Add(new UITextLink("^%M^7ultiplayer", "^%M^e^7ultiplayer", "^7^e^%M^0ultiplayer", () => {
                 UIConsole.WriteLine("Multiplayer menu coming soon!");
             }, 10, 400, TheClient.FontSets.SlightlyBigger));
             Backg = TheClient.Textures.GetTexture("ui/menus/menuback");


Rework special case for strong hits

Rework special case for strong hits

--- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
+++ osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
@@ -270,16 +270,12 @@

             if (characterDrawable.Drawable is DrawableTaikoMascot mascot)
             {
-                var isFailing = result.Type == HitResult.Miss;
-
-                // Only take combo in consideration when it's not a strong hit (it's always false)
-                if (!(judgedObject.HitObject is StrongHitObject))
-                {
-                    if (isFailing)
-                        isFailing = result.Judgement.AffectsCombo;
-                }
-
-                mascot.PlayfieldState.Value = isFailing ? TaikoMascotAnimationState.Fail : TaikoMascotAnimationState.Idle;
+                var miss = result.Type == HitResult.Miss;
+
+                if (miss && judgedObject.HitObject is StrongHitObject)
+                    miss = result.Judgement.AffectsCombo;
+
+                mascot.PlayfieldState.Value = miss ? TaikoMascotAnimationState.Fail : TaikoMascotAnimationState.Idle;
             }
         }


Add test coverage of potential deeadlock scenario with nested realm context fetching

--- osu.Game.Tests/Database/GeneralUsageTests.cs
+++ osu.Game.Tests/Database/GeneralUsageTests.cs
@@ -5,6 +5,9 @@
 using System.Threading;
 using System.Threading.Tasks;
 using NUnit.Framework;
+using osu.Game.Database;
+using osu.Game.Models;
+using Realms;

 #nullable enable

@@ -30,6 +33,37 @@
                 using (realmFactory.BlockAllOperations())
                 {
                 }
+            });
+        }
+
+        [Test]
+        public void TestNestedContextCreation()
+        {
+            RunTestWithRealm((realmFactory, _) =>
+            {
+                var mainContext = realmFactory.Context;
+                bool callbackRan = false;
+
+                var subscription = mainContext.All<RealmBeatmap>().SubscribeForNotifications((sender, changes, error) =>
+                {
+                    realmFactory.CreateContext();
+                    callbackRan = true;
+                });
+
+                Task.Factory.StartNew(() =>
+                {
+                    using (var threadContext = realmFactory.CreateContext())
+                    {
+                        threadContext.Write(r => r.Add(new RealmBeatmap(CreateRuleset(), new RealmBeatmapDifficulty(), new RealmBeatmapMetadata())));
+                    }
+                }, TaskCreationOptions.LongRunning | TaskCreationOptions.HideScheduler).Wait();
+
+                // will create a context but also run the callback above (Refresh is implicitly run when getting a new context).
+                realmFactory.CreateContext();
+
+                Assert.IsTrue(callbackRan);
+
+                subscription.Dispose();
             });
         }


Mark OsuButton as abstract

Mark OsuButton as abstract

Not being used directly, so we probably shouldn't support it for now.

--- osu.Game/Graphics/UserInterface/OsuButton.cs
+++ osu.Game/Graphics/UserInterface/OsuButton.cs
@@ -17,11 +17,11 @@
     /// <summary>
     /// A button with added default sound effects.
     /// </summary>
-    public class OsuButton : Button
+    public abstract class OsuButton : Button
     {
         private Box hover;

-        public OsuButton()
+        protected OsuButton()
         {
             Height = 40;


Fix bindable binding to make the editor load a screen by default again

--- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs
+++ osu.Game/Screens/Edit/Menus/EditorMenuBar.cs
@@ -20,8 +20,6 @@
     {
         public readonly Bindable<EditorScreenMode> Mode = new Bindable<EditorScreenMode>();

-        private readonly ScreenSelectionTabControl tabControl;
-
         public EditorMenuBar()
             : base(Direction.Horizontal, true)
         {
@@ -31,6 +29,7 @@
             ItemsContainer.Padding = new MarginPadding { Left = 100 };
             BackgroundColour = OsuColour.FromHex("111");

+            ScreenSelectionTabControl tabControl;
             AddRangeInternal(new Drawable[]
             {
                 tabControl = new ScreenSelectionTabControl
@@ -41,13 +40,13 @@
                 }
             });

-            tabControl.Current.BindTo(Mode);
+            Mode.BindTo(tabControl.Current);
         }

         protected override void LoadComplete()
         {
             base.LoadComplete();
-            tabControl.Current.TriggerChange();
+            Mode.TriggerChange();
         }

         protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu();


Adjust carousel radius slightly (flyte wanted it).

--- osu.Game/Screens/Select/CarouselContainer.cs
+++ osu.Game/Screens/Select/CarouselContainer.cs
@@ -186,7 +186,7 @@
         private static float offsetX(float dist, float halfHeight)
         {
             // The radius of the circle the carousel moves on.
-            const float CIRCLE_RADIUS = 4;
+            const float CIRCLE_RADIUS = 3;
             double discriminant = Math.Max(0, CIRCLE_RADIUS * CIRCLE_RADIUS - dist * dist);
             float x = (CIRCLE_RADIUS - (float)Math.Sqrt(discriminant)) * halfHeight;


Template selector related crashes fixed

Template selector related crashes fixed

--- Xamarin.Forms.DataGrid/DataGridRowTemplateSelector.cs
+++ Xamarin.Forms.DataGrid/DataGridRowTemplateSelector.cs
@@ -10,8 +10,11 @@
 {
     internal class DataGridRowTemplateSelector : DataTemplateSelector
     {
+        private static DataTemplate _dataGridRowTemplate;
+
         public DataGridRowTemplateSelector()
         {
+            _dataGridRowTemplate = new DataTemplate(typeof(DataGridViewCell));
         }

         protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
@@ -19,11 +22,10 @@
             var listView = container as ListView;
             var dataGrid = listView.Parent as DataGrid;

-            DataTemplate template = new DataTemplate(typeof(DataGridViewCell));
-            template.SetValue(DataGridViewCell.DataGridProperty, dataGrid);
-            template.SetValue(DataGridViewCell.IndexProperty, dataGrid.ItemsSource.Cast<object>().ToList().IndexOf(item));
+            _dataGridRowTemplate.SetValue(DataGridViewCell.DataGridProperty, dataGrid);
+            _dataGridRowTemplate.SetValue(DataGridViewCell.IndexProperty, dataGrid.ItemsSource.Cast<object>().ToList().IndexOf(item));

-            return template;
+            return _dataGridRowTemplate;
         }
     }
 }


Add log output when a model is undeleted

--- osu.Game/Stores/RealmArchiveModelImporter.cs
+++ osu.Game/Stores/RealmArchiveModelImporter.cs
@@ -389,7 +389,10 @@
                                 LogForModel(item, @$"Found existing {HumanisedModelName} for {item} (ID {existing.ID}) – skipping import.");

                                 if (existing.DeletePending)
+                                {
+                                    LogForModel(item, $@"Existing {HumanisedModelName}'s deletion flag has been removed");
                                     UndeleteForReuse(existing);
+                                }

                                 transaction.Commit();


Fixed redirect URL problem with facebook logon

--- otr-project/Controllers/AccountController.cs
+++ otr-project/Controllers/AccountController.cs
@@ -50,7 +50,7 @@
         // URL: /Account/LogOn
         // **************************************

-        public ActionResult LogOn()
+        public ActionResult LogOn(string ReturnUrl)
         {
             if (FacebookWebContext.Current.IsAuthenticated() && FacebookWebContext.Current.IsAuthorized())
             {
@@ -137,7 +137,14 @@
                 FormsAuthentication.SetAuthCookie((string)me.email, false);
                 Session["USER_F_NAME"] = (string)me.first_name;
                 log.Info("Account - User logged in (" + (string)me.email + ")");
-                return RedirectToAction("Index", "Home");
+                if (Url.IsLocalUrl(ReturnUrl))
+                {
+                    return Redirect(ReturnUrl);
+                }
+                else
+                {
+                    return RedirectToAction("Index", "Home");
+                }
             }
             return View();
         }


Don't run MyGet task for Pull Requests.

Don't run MyGet task for Pull Requests.

--- build/Tasks/PublishMyGet.cs
+++ build/Tasks/PublishMyGet.cs
@@ -7,6 +7,12 @@
 [Dependency(typeof(Package))]
 public class PublishMyGet : FrostingTask<BuildContext>
 {
+    public override bool ShouldRun(BuildContext context)
+    {
+        return !context.IsLocalBuild && !context.IsPullRequest && context.IsOriginalRepo
+            && (context.IsTagged || !context.IsMasterBranch);
+    }
+
     public override void Run(BuildContext context)
     {
         if(context.MyGetSource == null)


I hate function overloads.

I hate function overloads.

--- Schyntax/Schedule.cs
+++ Schyntax/Schedule.cs
@@ -34,7 +34,7 @@

         public DateTime Previous()
         {
-            return Next(DateTime.UtcNow);
+            return Previous(DateTime.UtcNow);
         }

         public DateTime Previous(DateTime atOrBefore)


コメント修正しました

コメント修正しました

--- Sdx/Db/Sql/Select.cs
+++ Sdx/Db/Sql/Select.cs
@@ -376,7 +376,7 @@
         throw new InvalidOperationException("Missing adapter, Set before Build.");
       }

-      //Group Byに無いカラムは自動的にOrderから取り除かれます。
+      //カラムリストに無いカラムは自動的にOrderから取り除かれます。
       //SELECT句はからは取り除きません。DBベンダーによっては取得できますし、意味がないわけではないので。
       if (groups.Count > 0)
       {


Exposed tox_get_keys in the Tox class

Exposed tox_get_keys in the Tox class

--- SharpTox/Core/Tox.cs
+++ SharpTox/Core/Tox.cs
@@ -1050,6 +1050,17 @@
             ToxFunctions.SetSendsReceipts(tox, friendnumber, send_receipts);
         }

+        public ToxKeyPair GetKeys()
+        {
+            lock (obj)
+            {
+                if (tox == IntPtr.Zero)
+                    throw null;
+
+                return ToxFunctions.GetKeys(tox);
+            }
+        }
+
         private void callbacks()
         {
             ToxFunctions.CallbackFriendRequest(tox, friendrequestdelegate = new ToxDelegates.CallbackFriendRequestDelegate((IntPtr t, byte[] id, byte[] message, ushort length, IntPtr userdata) =>


Fixed XML comment warning.

Fixed XML comment warning.

--- Simple.Web/Status.cs
+++ Simple.Web/Status.cs
@@ -109,6 +109,7 @@
         /// </summary>
         /// <param name="httpStatusCode">The HTTP status code.</param>
         /// <param name="httpStatusDescription">The HTTP status description.</param>
+        /// <param name="redirectLocation">Redirection Url</param>
         public Status(int httpStatusCode, string httpStatusDescription, string redirectLocation) : this()
         {
             _httpStatusCode = httpStatusCode;


static random to avoid duplicate random sequences

git-svn-id: d6bffa57a36fe0f3c7d18ef52cc0c4d4ff653ca6@96 66c3f25c-543c-0410-ae2e-6f2ca0bd8c61

--- SolrNet/Utils/RNG.cs
+++ SolrNet/Utils/RNG.cs
@@ -2,7 +2,7 @@

 namespace SolrNet.Utils {
 	public class RNG : IRNG {
-		private readonly Random r = new Random();
+		private static readonly Random r = new Random();

 		public int Next() {
 			return r.Next();


Trivial removal of unneeded source file

Trivial removal of unneeded source file

--- Test.CSF.Zpt/Test.cs
+++ Test.CSF.Zpt/Test.cs
@@ -1,15 +0,0 @@
-using NUnit.Framework;
-using System;
-
-namespace Test.CSF.ZPT
-{
-  [TestFixture()]
-  public class Test
-  {
-    [Test()]
-    public void TestCase()
-    {
-    }
-  }
-}
-