MS-WOPI: Add catpure code for R42001, R45001

--- FileSyncandWOPI/Source/MS-WOPI/Adapter/CaptureCode.cs
+++ FileSyncandWOPI/Source/MS-WOPI/Adapter/CaptureCode.cs
@@ -364,6 +364,8 @@
                               @"[In Response Body] UserCanWrite is a Boolean value.");
             }

+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i=0; i< response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "FileExtension")
@@ -391,7 +393,24 @@
                         292007,
                         @"[In Response Body] FileNameMaxLength: An integer indicating the maximum length for file names, including the file extension, supported by the WOPI server.");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");

             this.ValidateURL(checkFileInfo.CloseUrl, "CloseUrl");
             this.ValidateURL(checkFileInfo.DownloadUrl, "DownloadUrl");
@@ -427,6 +446,8 @@
             this.ValidateURL(putRelativeFile.HostViewUrl, "HostViewUrl");
             this.ValidateURL(putRelativeFile.HostEditUrl, "HostEditUrl");

+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-ValidRelativeTarget")
@@ -456,7 +477,25 @@
                         370013,
                         @"[In PutRelativeFile] X-WOPI-LockFailureReason is a string.");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
+
         }

         /// <summary>
@@ -465,6 +504,8 @@
         /// <param name="response">A parameter represents the response from server.</param>
         private void ValidateLockResponse(WOPIHttpResponse response)
         {
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-Lock")
@@ -485,7 +526,26 @@
                         401008,
                         @"[In Lock] X-WOPI-LockFailureReason is a string.");
                 }
-            }
+
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
+
         }

         /// <summary>
@@ -494,6 +554,8 @@
         /// <param name="response">A parameter represents the response from server.</param>
         private void ValidateUnLockResponse(WOPIHttpResponse response)
         {
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-Lock")
@@ -514,7 +576,24 @@
                         422010,
                         @"[In Unlock] X-WOPI-LockFailureReason is a string.");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
         }

         /// <summary>
@@ -523,6 +602,8 @@
         /// <param name="response">A parameter represents the response from server.</param>
         private void ValidateRefreshLockResponse(WOPIHttpResponse response)
         {
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count;i++ )
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-Lock")
@@ -543,7 +624,24 @@
                         439010,
                         @"[In RefreshLock] X-WOPI-LockFailureReason is a string.");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
         }

         /// <summary>
@@ -552,6 +650,8 @@
         /// <param name="response">A parameter represents the response from server.</param>
         private void ValidatePutFileResponse(WOPIHttpResponse response)
         {
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-Lock")
@@ -572,7 +672,24 @@
                         685010,
                         @"[In PutFile] X-WOPI-LockFailureReason is a string.");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
         }

         /// <summary>
@@ -581,6 +698,8 @@
         /// <param name="response">A parameter represents the response from server.</param>
         private void ValidateUnlockAndRelockResponse(WOPIHttpResponse response)
         {
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-Lock")
@@ -601,7 +720,24 @@
                         460010,
                         @"[In UnlockAndRelock] X-WOPI-LockFailureReason is a string.");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                isR42001Verified,
+                42001,
+                @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                isR45001Verified,
+                45001,
+                @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
         }

         /// <summary>
@@ -610,6 +746,8 @@
         /// <param name="response">A parameter represents the response from server.</param>
         private void ValidateGetLockResponse(WOPIHttpResponse response)
         {
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-Lock")
@@ -630,7 +768,24 @@
                         469016,
                         @"[In GetLock]  X-WOPI-LockFailureReason is a string");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
         }

         /// <summary>
@@ -639,6 +794,8 @@
         /// <param name="response">A parameter represents the response from server.</param>
         private void ValidateRenameFileResponse(WOPIHttpResponse response)
         {
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
             for (int i = 0; i < response.Headers.Count; i++)
             {
                 if (response.Headers.AllKeys[i] == "X-WOPI-InvalidFileNameError")
@@ -668,7 +825,24 @@
                         592027,
                         @"[In RenameFile] X-WOPI-LockFailureReason is a string");
                 }
-            }
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
         }

         /// <summary>
@@ -693,6 +867,29 @@
                           ""IsWindowsCredentials"":{""type"":""bool"",""default"":""false"",""optional"":true},
                           ""IsGroup"":{""type"":""bool"",""default"":""false"",""optional"":true},
                           }");
+
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
+            for (int i = 0; i < response.Headers.Count; i++)
+            {
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
         }

         /// <summary>
@@ -753,6 +950,30 @@
             this.ValidateURL(checkFolderInfo.HostEmbeddedViewUrl, "HostEmbeddedViewUrl");
             this.ValidateURL(checkFolderInfo.PrivacyUrl, "PrivacyUrl");
             this.ValidateURL(checkFolderInfo.SignoutUrl, "SignoutUrl");
+
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
+            for (int i = 0; i < response.Headers.Count; i++)
+            {
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
+
         }

         /// <summary>
@@ -794,6 +1015,30 @@
                               ""Version"":""<version>""
                              }],
                           }");
+
+            Boolean isR42001Verified = false;
+            Boolean isR45001Verified = false;
+            for (int i = 0; i < response.Headers.Count; i++)
+            {
+                if (response.Headers.AllKeys[i] == "X-WOPI-ServerVersion")
+                {
+                    isR42001Verified = true;
+                }
+                if (response.Headers.AllKeys[i] == "X-WOPI-MachineName")
+                {
+                    isR45001Verified = true;
+                }
+            }
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR42001Verified,
+                    42001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-ServerVersion [is a string specifying the version of the WOPI server and] MUST be included with all WOPI responses.");
+
+            this.Site.CaptureRequirementIfIsTrue(
+                    isR45001Verified,
+                    45001,
+                    @"[In Custom HTTP Headers] Header X-WOPI-MachineName [is a string specifying the name of the WOPI server and] MUST be included with all WOPI responses, which MUST NOT be used for anything other than logging.");
+
         }

         /// <summary>


Corrected author field for AdapterTests

Corrected author field for AdapterTests

--- FlipperDotNet.AdapterTests/Properties/AssemblyInfo.cs
+++ FlipperDotNet.AdapterTests/Properties/AssemblyInfo.cs
@@ -8,7 +8,7 @@
 [assembly: AssemblyTitle("FlipperDotNet.AdapterTests")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("PayByPhone Technologies")]
 [assembly: AssemblyProduct("FlipperDotNet.AdapterTests")]
 [assembly: AssemblyCopyright("Copyright ©  2015")]
 [assembly: AssemblyTrademark("")]


Refactored for new extract parameters

Refactored for new extract parameters

--- JabbR/ContentProviders/CollegeHumorContentProvider.cs
+++ JabbR/ContentProviders/CollegeHumorContentProvider.cs
@@ -7,7 +7,7 @@
     {
         private static readonly Regex _videoIdRegex = new Regex(@".*video/(\d+).*");

-        protected override Regex ParameterMatchRegex
+        protected override Regex ParameterExtractionRegex
         {
             get
             {


Print interface layers at first layer speed

--- fffProcessor.cs
+++ fffProcessor.cs
@@ -486,7 +486,7 @@
                     bridgConfig.SetData(config.BridgeSpeed, config.ExtrusionWidth_um, "BRIDGE");

 					supportNormalConfig.SetData(config.SupportMaterialSpeed, config.SupportExtrusionWidth_um, "SUPPORT");
-					supportInterfaceConfig.SetData(config.SupportMaterialSpeed - 1, config.ExtrusionWidth_um, "SUPPORT-INTERFACE");
+					supportInterfaceConfig.SetData(config.FirstLayerSpeed - 1, config.ExtrusionWidth_um, "SUPPORT-INTERFACE");
 				}

 				gcode.WriteComment("LAYER:{0}".FormatWith(layerIndex));


This regressed on a previous merge

This regressed on a previous merge

--- Kerberos.NET/Entities/SpNego/NegotiateContextToken.cs
+++ Kerberos.NET/Entities/SpNego/NegotiateContextToken.cs
@@ -11,8 +11,6 @@
 {
     public sealed class NegotiateContextToken : ContextToken
     {
-        private readonly NegotiationToken token;
-
         public NegotiateContextToken(GssApiToken gssToken)
         {
             if (gssToken == null)
@@ -23,12 +21,14 @@
             // SPNego tokens optimistically include a token of the first MechType
             // so if mechType[0] == Ntlm process as ntlm, == kerb process as kerb, etc.

-            this.token = NegotiationToken.Decode(gssToken.Token);
+            this.Token = NegotiationToken.Decode(gssToken.Token);
         }
+
+        public NegotiationToken Token { get; }

         public override DecryptedKrbApReq DecryptApReq(KeyTable keys)
         {
-            var mechToken = this.token.InitialToken.MechToken;
+            var mechToken = this.Token.InitialToken.MechToken;

             var apReq = MessageParser.Parse<ContextToken>(mechToken.Value);

@@ -44,15 +44,15 @@

         public override string ToString()
         {
-            if (this.token.InitialToken != null)
+            if (this.Token.InitialToken != null)
             {
-                var init = this.token.InitialToken;
+                var init = this.Token.InitialToken;
                 return $"NegTokenInit Oid: {init.MechTypes?.FirstOrDefault()?.FriendlyName};";
             }

-            if (this.token.ResponseToken != null)
+            if (this.Token.ResponseToken != null)
             {
-                var resp = this.token.ResponseToken;
+                var resp = this.Token.ResponseToken;

                 return $"NegTokenResp Oid: {resp.SupportedMech.FriendlyName};";
             }


Only move to the start of the first island when there is only one.

--- fffProcessor.cs
+++ fffProcessor.cs
@@ -573,7 +573,7 @@
 					// Figure out where the seam hiding start point is for inset 0 and move to that spot so
 					// we have the minimum travel while starting inset 0 after printing the rest of the insets
 					SliceLayer layer = slicingData?.Extruders?[0]?.Layers?[layerIndex + 1];
-					if (layer.Islands.Count > 0)
+					if (layer.Islands.Count == 1)
 					{
 						LayerIsland island = layer?.Islands?[0];
 						if (island?.InsetToolPaths?[0]?[0]?.Count > 0)


Fixed test cases

Fixed test cases

--- King.Azure.Integration.Test/Data/TableStorageTests.cs
+++ King.Azure.Integration.Test/Data/TableStorageTests.cs
@@ -295,7 +295,7 @@

             await storage.Insert(entities);

-            var returned = storage.QueryByPartitionAndRow<Helper>(z.PartitionKey, z.RowKey);
+            var returned = await storage.QueryByPartitionAndRow<Helper>(z.PartitionKey, z.RowKey);
             Assert.IsNotNull(returned);
             Assert.AreEqual(z.Id, returned.Id);
         }
@@ -345,7 +345,7 @@
             await storage.InsertOrReplace(h);
             await storage.DeleteByPartitionAndRow(h.PartitionKey, h.RowKey);

-            var returned = storage.QueryByPartitionAndRow<Helper>(h.PartitionKey, h.RowKey);
+            var returned = await storage.QueryByPartitionAndRow<Helper>(h.PartitionKey, h.RowKey);
             Assert.IsNull(returned);
         }

@@ -366,9 +366,9 @@
         }

         [Test]
-        public void QueryByPartitionAndRowPartitionNullRowNull()
-        {
-            var returned = storage.QueryByPartitionAndRow<Helper>(null, null);
+        public async Task QueryByPartitionAndRowPartitionNullRowNull()
+        {
+            var returned = await storage.QueryByPartitionAndRow<Helper>(null, null);
             Assert.IsNull(returned);
         }


Make trimming work for shared framework apps

Don't require RID to be specified.

--- Microsoft.Packaging.Tools/tasks/Trimming/TrimFiles.cs
+++ Microsoft.Packaging.Tools/tasks/Trimming/TrimFiles.cs
@@ -55,7 +55,6 @@
         /// <summary>
         /// RuntimeIdentifier to use when determining package dependencies.
         /// </summary>
-        [Required]
         public string RuntimeIdentifier { get; set; }

         /// <summary>


Add test to illustrate the ease of expanding the range of roman numals in FromRomanNumeral.

--- VasysRomanNumeralsKataTest/FromRomanNumeralsTest.cs
+++ VasysRomanNumeralsKataTest/FromRomanNumeralsTest.cs
@@ -77,5 +77,27 @@
             FromRomanNumeral nineteenEightyNine = new FromRomanNumeral("GEGDCCCAC", alternateNumeralValueLookup);
             Assert.IsTrue(1989 == nineteenEightyNine.GenerateArabicRepresentation());
         }
+
+        [TestMethod]
+        public void WhenFromRomanNumeralIsInitializedToUseExpandedRomanNumeralsItReturnsArabic()
+        {
+            // The real numerals over 1000 are letters with bars over them.  Since that isn't easy to
+            //  re-create, I'm substituting alternate letters
+            Dictionary<string, long> expandedNumeralValueLookup = new Dictionary<string, long>(StringComparer.CurrentCultureIgnoreCase)
+            {
+                {"I", 1},
+                {"V", 5},
+                {"X", 10},
+                {"L", 50},
+                {"C", 100},
+                {"D", 500},
+                {"M", 1000},
+                {"B", 5000},
+                {"A", 10000}
+            };
+
+            FromRomanNumeral fourteenThousandTwoHundredSixtyFour = new FromRomanNumeral("AMBCCLXIV", expandedNumeralValueLookup);
+            Assert.IsTrue(14264 == fourteenThousandTwoHundredSixtyFour.GenerateArabicRepresentation());
+        }
     }
 }


Fix charging session identification bug

Fix charging session identification bug

--- WWCP_Core/Entities/RoamingNetwork/RoamingNetwork.cs
+++ WWCP_Core/Entities/RoamingNetwork/RoamingNetwork.cs
@@ -349,44 +349,59 @@
                     switch (elements[1])
                     {

-                        case "Add":
-
-                                // 0: Timestamp
-                                // 1: "Add"
-                                // 2: OperatorId
-                                // 3: EVSEId
-                                // 4: ChargingProduct
-                                // 5: AuthIdentification?.AuthToken
-                                // 6: eMA Id
-                                // 7: result.AuthorizatorId
-                                // 8: result.ProviderId
-                                // 9: result.SessionId
-
-                                var NewChargingSession = new ChargingSession(ChargingSession_Id.Parse(elements[9]),
-                                                                             elements[0] != "" ? DateTime.Parse(elements[0]) : DateTime.UtcNow) {
-                                                             AuthorizatorId       = elements[7] != "" ? CSORoamingProvider_Id.     Parse(elements[7]) : null,
-                                                             //AuthService          = result.ISendAuthorizeStartStop,
-                                                             ChargingStationOperatorId           = elements[2] != "" ? ChargingStationOperator_Id.Parse(elements[2]) : new ChargingStationOperator_Id?(),
-                                                             EVSEId               = EVSE_Id.Parse(elements[3]),
-                                                             IdentificationStart  = elements[5] != "" ? AuthIdentification.FromAuthToken           (Auth_Token.Parse(elements[5]))
-                                                                                : elements[6] != "" ? AuthIdentification.FromRemoteIdentification(eMobilityAccount_Id.Parse(elements[6]))
-                                                                                : null,
-                                                             ChargingProduct      = elements[4] != "" ? ChargingProduct.           Parse(elements[4]) : null
-                                                         };
-
-                                if (_ChargingSessions.ContainsKey(NewChargingSession.Id))
-                                    _ChargingSessions.TryRemove(NewChargingSession.Id, out ChargingSession CS);
-
-                                _ChargingSessions.TryAdd(NewChargingSession.Id, NewChargingSession);
+                        case "Start":
+
+                            // 0: Timestamp
+                            // 1: "Start"
+                            // 2: OperatorId
+                            // 3: EVSEId
+                            // 4: ChargingProduct
+                            // 5: AuthIdentification?.AuthToken
+                            // 6: eMA Id
+                            // 7: result.AuthorizatorId
+                            // 8: result.ProviderId
+                            // 9: result.SessionId
+
+                            var NewChargingSession = new ChargingSession(ChargingSession_Id.Parse(elements[9]),
+                                                                         elements[0] != "" ? DateTime.Parse(elements[0]) : DateTime.UtcNow) {
+                                                         AuthorizatorId       = elements[7] != "" ? CSORoamingProvider_Id.     Parse(elements[7]) : null,
+                                                         //AuthService          = result.ISendAuthorizeStartStop,
+                                                         ChargingStationOperatorId           = elements[2] != "" ? ChargingStationOperator_Id.Parse(elements[2]) : new ChargingStationOperator_Id?(),
+                                                         EVSEId               = EVSE_Id.Parse(elements[3]),
+                                                         IdentificationStart  = elements[5] != "" ? AuthIdentification.FromAuthToken           (Auth_Token.Parse(elements[5]))
+                                                                              : elements[6] != "" ? AuthIdentification.FromRemoteIdentification(eMobilityAccount_Id.Parse(elements[6]))
+                                                                              : null,
+                                                         ChargingProduct      = elements[4] != "" ? ChargingProduct.           Parse(elements[4]) : null
+                                                     };
+
+                            if (_ChargingSessions.ContainsKey(NewChargingSession.Id))
+                                _ChargingSessions.TryRemove(NewChargingSession.Id, out ChargingSession CS);
+
+                            _ChargingSessions.TryAdd(NewChargingSession.Id, NewChargingSession);

                             break;

-                        case "Remove":
+
+                        case "Stop":

                             // 0: Timestamp
-                            // 1: "Remove"
+                            // 1: "Stop"
                             // 2: EVSEId
                             // 3: SessionId
+                            // 4: RFID UID
+                            // 5: eMAId
+
+                            break;
+
+
+                        case "SendCDR":
+
+                            // 0: Timestamp
+                            // 1: "SendCDR"
+                            // 2: EVSEId
+                            // 3: SessionId
+                            // 4: SendCDRResult
+                            // 5: Warnings, aggregatedWith "/"

                             var EVSEId     = elements[2] != "" ? EVSE_Id.           Parse(elements[2]) : new EVSE_Id?();
                             var SessionId  =                     ChargingSession_Id.Parse(elements[3]);
@@ -4447,7 +4462,7 @@
                             //                                    this,
                             //                                    NewChargingSession);

-                            // 0: "Add"
+                            // 0: "Start"
                             // 1: OperatorId
                             // 2: EVSEId
                             // 3: ChargingProduct
@@ -4458,7 +4473,7 @@
                             // 8: result.SessionId

                             var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(),    ",",
-                                                        "Add,",
+                                                        "Start,",
                                                         EVSEId.OperatorId,              ",",
                                                         EVSEId,                         ",",
                                                         ChargingProduct,                ",",
@@ -4535,7 +4550,7 @@

                                 var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(),    ",",
-                                                            "Add,",
+                                                            "Start,",
                                                             EVSEId.OperatorId,              ",",
                                                             EVSEId,                         ",",
                                                             ChargingProduct,                ",",
@@ -4942,9 +4957,11 @@
                     {

                         var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(), ",",
-                                                    "Remove,",
+                                                    "Stop,",
                                                     ",",
-                                                    SessionId);
+                                                    SessionId, ",",
+                                                    ",",
+                                                    eMAId);

                         File.AppendAllText(SessionLogFileName,
                                            LogLine + Environment.NewLine);
@@ -5245,9 +5262,11 @@
                 {

                     var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(), ",",
-                                                "Remove,",
+                                                "Stop,",
                                                 EVSEId, ",",
-                                                SessionId);
+                                                SessionId, ",",
+                                                ",",
+                                                eMAId);

                     File.AppendAllText(SessionLogFileName,
                                        LogLine + Environment.NewLine);
@@ -5414,9 +5433,11 @@
                     {

                         var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(), ",",
-                                                    "Remove,",
+                                                    "Stop,",
                                                     ",",
-                                                    SessionId);
+                                                    SessionId, ",",
+                                                    ",",
+                                                    eMAId);

                         File.AppendAllText(SessionLogFileName,
                                            LogLine + Environment.NewLine);
@@ -5852,7 +5873,7 @@
                             //                                    NewChargingSession);

                             var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(),    ",",
-                                                        "Add,",
+                                                        "Start,",
                                                         OperatorId,                     ",",
                                                         EVSEId,                         ",",
                                                         ChargingProduct,                ",",
@@ -6617,9 +6638,10 @@
                 {

                     var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(), ",",
-                                                "Remove,",
+                                                "Stop,",
                                                 EVSEId, ",",
-                                                SessionId);
+                                                SessionId, ",",
+                                                AuthIdentification);

                     File.AppendAllText(SessionLogFileName,
                                        LogLine + Environment.NewLine);
@@ -7706,6 +7728,47 @@
                                               null,
                                               Runtime);

+
+                #region Store "SendCDR"-information within
+
+                var success = await SessionLogSemaphore.WaitAsync(TimeSpan.FromSeconds(5));
+
+                if (success)
+                {
+                    try
+                    {
+
+                        foreach (var sendCDRResult in resultMap)
+                        {
+
+                            _ChargingSessions.TryRemove(sendCDRResult.ChargeDetailRecord.SessionId, out ChargingSession CS);
+
+                            var LogLine = String.Concat(DateTime.UtcNow.ToIso8601(), ",",
+                                                        "SendCDR,",
+                                                        ",",
+                                                        sendCDRResult.ChargeDetailRecord.SessionId, ",",
+                                                        sendCDRResult.Result, ",",
+                                                        sendCDRResult.Warnings.AggregateWith("/"));
+
+                            File.AppendAllText(SessionLogFileName,
+                                               LogLine + Environment.NewLine);
+
+                        }
+
+                    }
+                    catch (Exception e)
+                    {
+                        Console.WriteLine(e.Message);
+                    }
+                    finally
+                    {
+                        SessionLogSemaphore.Release();
+                    }
+
+                }
+
+                #endregion
+
             }


MT MF.GetStream

MT MF.GetStream

--- MonoTouch/Xamarin.Mobile/Media/MediaPickerDelegate.cs
+++ MonoTouch/Xamarin.Mobile/Media/MediaPickerDelegate.cs
@@ -116,24 +116,24 @@
 //					});
 //			}

-			//Func<Stream> streamGetter = () =>
-			//{
-			//    return File.OpenRead (path);
-//				switch (this.options.Location)
-//				{
-//					case MediaFileStoreLocation.CameraRoll:
-//						return new NSDataStream (image.AsJPEG());
-//
-//					case MediaFileStoreLocation.Local:
-//						return File.OpenRead (path);
-//						break;
-//
-//					default:
-//						throw new NotSupportedException();
-//				}
-			//};
-
-			return new MediaFile (path);
+			Func<Stream> streamGetter = () =>
+			{
+				return File.OpenRead (path);
+				//switch (this.options.Location)
+				//{
+				//    case MediaFileStoreLocation.CameraRoll:
+				//        return new NSDataStream (image.AsJPEG());
+
+				//    case MediaFileStoreLocation.Local:
+				//        return File.OpenRead (path);
+				//        break;
+
+				//    default:
+				//        throw new NotSupportedException();
+				//}
+			};
+
+			return new MediaFile (path, streamGetter);
 		}

 		private MediaFile GetMovieMediaFile (NSDictionary info, out Task<NSUrl> saveCompleted)
@@ -179,21 +179,21 @@
 //				});
 //			}

-			//Func<Stream> streamGetter = () =>
-			//{
-			//    return File.OpenRead (path);
-//				switch (this.options.Location)
-//				{
-//					case MediaFileStoreLocation.CameraRoll:
-//					case MediaFileStoreLocation.Local:
-//						return File.OpenRead (path);
-//
-//					default:
-//						throw new NotSupportedException();
-//				}
-			//};
+			Func<Stream> streamGetter = () =>
+			{
+			    return File.OpenRead (path);
+				//switch (this.options.Location)
+				//{
+				//    case MediaFileStoreLocation.CameraRoll:
+				//    case MediaFileStoreLocation.Local:
+				//        return File.OpenRead (path);
+
+				//    default:
+				//        throw new NotSupportedException();
+				//}
+			};

-			return new MediaFile (path);
+			return new MediaFile (path, streamGetter);
 		}

 		private static string GetUniquePath (string type, string path, string name)


Refactoring.

Refactoring.


Fix csharp version

Fix csharp version

--- csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs
+++ csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs
@@ -64,4 +64,4 @@

 [assembly: AssemblyVersion("3.0.0.0")]
 [assembly: AssemblyFileVersion("3.0.0.0")]
-[assembly: AssemblyInformationalVersion("3.0.0-alpha4")]
+[assembly: AssemblyInformationalVersion("3.0.0-beta3")]


EMP refactorings

EMP refactorings

--- WWCP_Core/Entities/RoamingNetwork/RoamingNetwork.cs
+++ WWCP_Core/Entities/RoamingNetwork/RoamingNetwork.cs
@@ -446,12 +446,12 @@
     }

-    public class ChargeDetailRecordStore : IEnumerable<ChargeDetailRecord>
+    public class ChargeDetailRecordStore : IEnumerable<IEnumerable<ChargeDetailRecord>>
     {

         #region Data

-        private readonly         Dictionary<ChargingSession_Id, ChargeDetailRecord> _ChargeDetailRecords;
+        private readonly         Dictionary<ChargingSession_Id, List<ChargeDetailRecord>> _ChargeDetailRecords;

         private static readonly  Char                                               RS  = (Char) 30;

@@ -487,7 +487,7 @@

             this.RoamingNetwork        = RoamingNetwork ?? throw new ArgumentNullException(nameof(RoamingNetwork), "The given roaming network must not be null or empty!");

-            this._ChargeDetailRecords  = new Dictionary<ChargingSession_Id, ChargeDetailRecord>();
+            this._ChargeDetailRecords  = new Dictionary<ChargingSession_Id, List<ChargeDetailRecord>>();
             this.CDRLogFileName        = "ChargeDetailRecords-" + RoamingNetwork.Id + ".log";

         }
@@ -505,7 +505,10 @@

                 var Now = DateTime.UtcNow;

-                _ChargeDetailRecords.Add(ChargeDetailRecord.SessionId, ChargeDetailRecord);
+                if (!_ChargeDetailRecords.ContainsKey(ChargeDetailRecord.SessionId))
+                    _ChargeDetailRecords.Add(ChargeDetailRecord.SessionId, new List<ChargeDetailRecord>());
+
+                _ChargeDetailRecords[ChargeDetailRecord.SessionId].Add(ChargeDetailRecord);

                 //if (_ChargingSessions.TryAdd(NewChargingSession.Id, NewChargingSession))
                 //    RegisterExternalChargingSession(DateTime.UtcNow,
@@ -542,17 +545,17 @@

         #endregion

-        #region TryGet(SessionId, out ChargeDetailRecord)
-
-        public Boolean TryGet(ChargingSession_Id SessionId, out ChargeDetailRecord ChargeDetailRecord)
-            => _ChargeDetailRecords.TryGetValue(SessionId, out ChargeDetailRecord);
+        #region TryGet(SessionId, out ChargeDetailRecords)
+
+        public Boolean TryGet(ChargingSession_Id SessionId, out List<ChargeDetailRecord> ChargeDetailRecords)
+            => _ChargeDetailRecords.TryGetValue(SessionId, out ChargeDetailRecords);

         #endregion

         #region IEnumerable<ChargeDetailRecord>

-        public IEnumerator<ChargeDetailRecord> GetEnumerator()
+        public IEnumerator<IEnumerable<ChargeDetailRecord>> GetEnumerator()
             => _ChargeDetailRecords.Values.GetEnumerator();

         IEnumerator IEnumerable.GetEnumerator()
@@ -816,8 +819,8 @@
             //this._PushEVSEDataToOperatorRoamingServices             = new ConcurrentDictionary<UInt32, IPushData>();
             //this._PushEVSEStatusToOperatorRoamingServices           = new ConcurrentDictionary<UInt32, IPushStatus>();

-            this._ChargeDetailRecords                               = new ChargeDetailRecordStore(this);
-            this._ChargingSessionStore                              = new ChargingSessionStore   (this, _ChargeDetailRecords.Add);
+            this._ChargeDetailRecordStore                               = new ChargeDetailRecordStore(this);
+            this._ChargingSessionStore                              = new ChargingSessionStore   (this, _ChargeDetailRecordStore.Add);

             this._AdminStatusSchedule                               = new StatusSchedule<RoamingNetworkAdminStatusTypes>(MaxAdminStatusListSize);
             this._AdminStatusSchedule.Insert(AdminStatus);
@@ -866,11 +869,11 @@
         #endregion

-        private readonly PriorityList<ISendData>                       _ISendData                       = new PriorityList<ISendData>();
-        private readonly PriorityList<ISendAdminStatus>                _ISendAdminStatus                = new PriorityList<ISendAdminStatus>();
-        private readonly PriorityList<ISendStatus>                     _ISendStatus                     = new PriorityList<ISendStatus>();
-        private readonly PriorityList<ISendAuthorizeStartStop>         _ISend2RemoteAuthorizeStartStop  = new PriorityList<ISendAuthorizeStartStop>();
-        private readonly PriorityList<ISendChargeDetailRecords>        _IRemoteSendChargeDetailRecord   = new PriorityList<ISendChargeDetailRecords>();
+        private readonly PriorityList<ISendData>                 _ISendData                        = new PriorityList<ISendData>();
+        private readonly PriorityList<ISendAdminStatus>          _ISendAdminStatus                 = new PriorityList<ISendAdminStatus>();
+        private readonly PriorityList<ISendStatus>               _ISendStatus                      = new PriorityList<ISendStatus>();
+        private readonly PriorityList<ISendAuthorizeStartStop>   _ISend2RemoteAuthorizeStartStop   = new PriorityList<ISendAuthorizeStartStop>();
+        private readonly PriorityList<ISendChargeDetailRecords>  _IRemoteSendChargeDetailRecord    = new PriorityList<ISendChargeDetailRecords>();

         #region Data/(Admin-)Status management
@@ -7494,13 +7497,13 @@

         #region ChargeDetailRecords

-        private readonly ChargeDetailRecordStore _ChargeDetailRecords;
+        private readonly ChargeDetailRecordStore _ChargeDetailRecordStore;

         /// <summary>
         /// Return all current charge detail records.
         /// </summary>
-        public IEnumerable<ChargeDetailRecord> ChargeDetailRecords
-            => _ChargeDetailRecords;
+        public IEnumerable<IEnumerable<ChargeDetailRecord>> ChargeDetailRecords
+            => _ChargeDetailRecordStore;

         #endregion

@@ -7527,11 +7530,11 @@
         {
             add
             {
-                _ChargeDetailRecords.OnNewChargeDetailRecord += value;
+                _ChargeDetailRecordStore.OnNewChargeDetailRecord += value;
             }
             remove
             {
-                _ChargeDetailRecords.OnNewChargeDetailRecord -= value;
+                _ChargeDetailRecordStore.OnNewChargeDetailRecord -= value;
             }
         }

@@ -7705,7 +7708,7 @@

                 #region Store all CDRs...

-                _ChargeDetailRecords.Add(ChargeDetailRecords);
+                _ChargeDetailRecordStore.Add(ChargeDetailRecords);

                 #endregion

@@ -7783,6 +7786,11 @@
                 foreach (var isendcdr in _IRemoteSendChargeDetailRecord)
                     _ISendChargeDetailRecords.Add(isendcdr, new List<ChargeDetailRecord>());

+                #endregion
+
+
+                #region Try to send the CDRs to their target based on their SessionId...
+
                 foreach (var cdr in ChargeDetailRecordsToProcess.ToArray())
                 {

@@ -7806,14 +7814,313 @@

                 #endregion

+                #region Any CDRs left? => Ask all e-mobility providers!
+
+                foreach (var _cdr in ChargeDetailRecordsToProcess)
+                {
+
+                    #region We have a valid (start) provider identification
+
+                    if (_cdr.ProviderIdStart.HasValue && _eMobilityProviders.TryGet(_cdr.ProviderIdStart.Value, out eMobilityProvider eMobPro))
+                    {
+                        _ISendChargeDetailRecords[eMobPro].Add(_cdr);
+                        ChargeDetailRecordsToProcess.Remove(_cdr);
+                    }
+
+                    #endregion
+
+                    #region We have a valid (stop)  provider identification
+
+                    else if (_cdr.ProviderIdStop.HasValue && _eMobilityProviders.TryGet(_cdr.ProviderIdStop.Value, out eMobPro))
+                    {
+                        _ISendChargeDetailRecords[eMobPro].Add(_cdr);
+                        ChargeDetailRecordsToProcess.Remove(_cdr);
+                    }
+
+                    #endregion
+
+
+                    #region We have a valid (start) AuthToken/RFID identification
+
+                    else if (_cdr.IdentificationStart?.AuthToken != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStart);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (stop)  AuthToken/RFID identification
+
+                    else if (_cdr.IdentificationStop?.AuthToken != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStop);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (start) QR-Code identification
+
+                    else if (_cdr.IdentificationStart?.QRCodeIdentification != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStart);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (stop)  QR-Code identification
+
+                    else if (_cdr.IdentificationStop?.QRCodeIdentification != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStop);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (start) Plug'n'Charge identification
+
+                    else if (_cdr.IdentificationStart?.PlugAndChargeIdentification != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStart);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (stop)  Plug'n'Charge identification
+
+                    else if (_cdr.IdentificationStop?.PlugAndChargeIdentification != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStop);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (start) remote identification
+
+                    else if (_cdr.IdentificationStart?.RemoteIdentification != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStart);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (stop)  remote identification
+
+                    else if (_cdr.IdentificationStop?.RemoteIdentification != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStop);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (start) public key
+
+                    else if (_cdr.IdentificationStart?.PublicKey != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStart);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                    #region We have a valid (stop)  public key
+
+                    else if (_cdr.IdentificationStop?.PublicKey != null)
+                    {
+
+                        // Use a lookup...
+
+                        // Ask all e-mobility providers...
+                        foreach (var eMob in _eMobilityProviders)
+                        {
+
+                            var authStartResult = await eMob.AuthorizeStart(_cdr.IdentificationStop);
+
+                            if (authStartResult.Result == AuthStartResultType.Authorized ||
+                                authStartResult.Result == AuthStartResultType.Blocked)
+                            {
+                                _ISendChargeDetailRecords[eMob].Add(_cdr);
+                                ChargeDetailRecordsToProcess.Remove(_cdr);
+                                break;
+                            }
+
+                        }
+
+                    }
+
+                    #endregion
+
+                }
+
+                #endregion
+
                 #region Any CDRs left? => bad!

-                if (ChargeDetailRecordsToProcess.Count > 0)
+                foreach (var unknownCDR in ChargeDetailRecordsToProcess)
                 {

-                    foreach (var _cdr in ChargeDetailRecordsToProcess)
-                        resultMap.Add(new SendCDRResult(_cdr,
-                                                        SendCDRResultTypes.UnknownSessionId));
+                    resultMap.Add(new SendCDRResult(unknownCDR,
+                                                    SendCDRResultTypes.UnknownSessionId));

                     ChargeDetailRecordsToProcess.Clear();

@@ -7858,6 +8165,7 @@
                 }

                 #endregion
+

                 #region Check if we really received a response for every charge detail record!

@@ -7918,8 +8226,8 @@

                 //if (success)
                 //{
-                //    try
-                //    {
+                    try
+                    {

                         foreach (var sendCDRResult in resultMap)
                         {
@@ -7942,11 +8250,11 @@

                         }

-                //    }
-                //    catch (Exception e)
-                //    {
-                //        Console.WriteLine(e.Message);
-                //    }
+                    }
+                    catch (Exception e)
+                    {
+                        Console.WriteLine(e.Message);
+                    }
                 //    finally
                 //    {
                 //        SessionLogSemaphore.Release();


Update backwards-compatibility stuff.

Update backwards-compatibility stuff.

--- game/server/base/compat.cs
+++ game/server/base/compat.cs
@@ -56,3 +56,93 @@
 {
 	textureName	= "share/textures/rotc/screen.damage";
 };
+
+datablock ParticleData(TextureDummy_3)
+{
+	textureName	= "share/textures/rotc/bounce.blue.hit.png";
+};
+
+datablock ParticleData(TextureDummy_4)
+{
+	textureName	= "share/textures/rotc/bounce.blue.miss.png";
+};
+
+datablock ParticleData(TextureDummy_5)
+{
+	textureName	= "share/textures/rotc/bounce.red.hit.png";
+};
+
+datablock ParticleData(TextureDummy_6)
+{
+	textureName	= "share/textures/rotc/bounce.red.miss.png";
+};
+
+datablock ParticleData(TextureDummy_7)
+{
+	textureName	= "share/textures/rotc/laser1.blue.png";
+};
+
+datablock ParticleData(TextureDummy_8)
+{
+	textureName	= "share/textures/rotc/laser1.cyan.png";
+};
+
+datablock ParticleData(TextureDummy_9)
+{
+	textureName	= "share/textures/rotc/laser1.green.png";
+};
+
+datablock ParticleData(TextureDummy_10)
+{
+	textureName	= "share/textures/rotc/laser1.orange.png";
+};
+
+datablock ParticleData(TextureDummy_11)
+{
+	textureName	= "share/textures/rotc/laser1.red.png";
+};
+
+datablock ParticleData(TextureDummy_12)
+{
+	textureName	= "share/textures/rotc/laser1.violet.png";
+};
+
+datablock ParticleData(TextureDummy_13)
+{
+	textureName	= "share/textures/rotc/laser1.white.png";
+};
+
+datablock ParticleData(TextureDummy_14)
+{
+	textureName	= "share/textures/rotc/lasertrail2.blue.png";
+};
+
+datablock ParticleData(TextureDummy_15)
+{
+	textureName	= "share/textures/rotc/lasertrail2.red.png";
+};
+
+datablock ParticleData(TextureDummy_16)
+{
+	textureName	= "share/textures/rotc/smoke3.green.png";
+};
+
+datablock ParticleData(TextureDummy_17)
+{
+	textureName	= "share/textures/rotc/smoke3.orange.png";
+};
+
+datablock ParticleData(TextureDummy_18)
+{
+	textureName	= "share/textures/rotc/smoke3.png";
+};
+
+datablock ParticleData(TextureDummy_19)
+{
+	textureName	= "share/textures/rotc/smoke4.blue.png";
+};
+
+datablock ParticleData(TextureDummy_20)
+{
+	textureName	= "share/textures/rotc/smoke4.red.png";
+};


Refactored code for GalleryLinks to reuse code

--- LinkedData/ContentManager/GalleryLinksForm.cs
+++ LinkedData/ContentManager/GalleryLinksForm.cs
@@ -91,27 +91,7 @@

             foreach (var triple in references.ToSitecoreTriples())
             {
-                if (IsHidden(triple.ObjectItem) && !UserOptions.View.ShowHiddenItems)
-                {
-                    return;
-                }
-
-                if (triple.ObjectItem == null)
-                {
-                    result.Append(string.Format("
{0} {1}: {2}, {3}
",
-                        (object)Images.GetImage("Applications/16x16/error.png", 16, 16, "absmiddle", "0px 4px 0px 0px"),
-                        (object)Translate.Text("Not found"), "TODO: Target database for link",
-                        triple.ObjectNode.ToString()));
-                }
-                else
-                {
-                    result.Append(
-                        "" +
-                        Images.GetImage(triple.ObjectItem.Appearance.Icon, 16, 16, "absmiddle", "0px 4px 0px 0px") +
-                        triple.ObjectItem.DisplayName + " - [" + triple.ObjectItem.Paths.Path + "]");
-                }
+                RenderLink(result, triple, true);
             }
         }

@@ -121,46 +101,65 @@

             foreach (var triple in referrers.ToSitecoreTriples())
             {
-                if (IsHidden(triple.SubjectItem) && !UserOptions.View.ShowHiddenItems)
+                RenderLink(result, triple, false);
+            }
+        }
+
+        private void RenderLink(StringBuilder result, SitecoreTriple triple, bool refferences)
+        {
+            Item item;
+
+            if (refferences)
+            {
+                item = triple.ObjectItem;
+            }
+            else
+            {
+                item = triple.SubjectItem;
+            }
+
+            if (IsHidden(item) && !UserOptions.View.ShowHiddenItems)
+            {
+                return;
+            }
+
+            if (item == null)
+            {
+                result.Append(string.Format("
{0} {1}: {2}, {3}
",
+                    (object)Images.GetImage("Applications/16x16/error.png", 16, 16, "absmiddle", "0px 4px 0px 0px"),
+                    (object)Translate.Text("Not found"), "TODO: Target database for link",
+                    item.ToString()));
+            }
+            else
+            {
+                result.Append("" +
+                            Images.GetImage(item.Appearance.Icon, 16, 16, "absmiddle", "0px 4px 0px 0px") +
+                            item.DisplayName);
+
+
+                if (!SitecoreTripleHelper.GetFieldIdFromPredicate(triple.PredicateNode).IsNull)
                 {
-                    return;
-                }
+                    var linkField = triple.SubjectItem.Fields[SitecoreTripleHelper.GetFieldIdFromPredicate(triple.PredicateNode)];

-                if (triple.SubjectItem == null)
-                {
-                    result.Append(string.Format("
{0} {1}: {2}, {3}
",
-                        (object)Images.GetImage("Applications/16x16/error.png", 16, 16, "absmiddle", "0px 4px 0px 0px"),
-                        (object)Translate.Text("Not found"), "TODO: Target database for link",
-                        triple.SubjectItem.ToString()));
-                }
-                else
-                {
-                    result.Append(
-                        "" +
-                        Images.GetImage(triple.SubjectItem.Appearance.Icon, 16, 16, "absmiddle", "0px 4px 0px 0px") +
-                        triple.SubjectItem.DisplayName);
-                    if (triple.SubjectItem != null && !SitecoreTripleHelper.GetFieldIdFromPredicate(triple.PredicateNode).IsNull)
+                    if (linkField != null)
                     {
-                        Field field1 = triple.SubjectItem.Fields[SitecoreTripleHelper.GetFieldIdFromPredicate(triple.PredicateNode)];
-                        if (!string.IsNullOrEmpty(field1.DisplayName))
+                        if (!string.IsNullOrEmpty(linkField.DisplayName))
                         {
                             result.Append(" - ");
-                            result.Append(field1.DisplayName);
-                            if (triple.SubjectItem != null)
+                            result.Append(linkField.DisplayName);
+
+                            if (!linkField.HasValue)
                             {
-                                Field field2 = triple.SubjectItem.Fields[SitecoreTripleHelper.GetFieldIdFromPredicate(triple.PredicateNode)];
-                                if (field2 != null && !field2.HasValue)
-                                {
-                                    result.Append(" ");
-                                    result.Append(Translate.Text("[inherited]"));
-                                    result.Append("");
-                                }
+                                result.Append(" ");
+                                result.Append(Translate.Text("[inherited]"));
+                                result.Append("");
                             }
                         }
                     }
-                    result.Append(" - [" + triple.SubjectItem.Paths.Path + "]");
                 }
+
+                result.Append(" - [" + item.Paths.Path + "]");
             }
         }


Change the PacketQueue to use the stored size as well

--- OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -345,9 +345,8 @@
                         LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue();

                         SendQueue.Enqueue(qpack);
-                        int qpackSize = qpack.Packet.ToBytes().Length;
-                        TotalThrottle.AddBytes(qpackSize);
-                        ResendThrottle.AddBytes(qpackSize);
+                        TotalThrottle.AddBytes(qpack.Length);
+                        ResendThrottle.AddBytes(qpack.Length);

                         qchanged = true;
                     }
@@ -357,9 +356,8 @@
                         LLQueItem qpack = LandOutgoingPacketQueue.Dequeue();

                         SendQueue.Enqueue(qpack);
-                        int qpackSize = qpack.Packet.ToBytes().Length;
-                        TotalThrottle.AddBytes(qpackSize);
-                        LandThrottle.AddBytes(qpackSize);
+                        TotalThrottle.AddBytes(qpack.Length);
+                        LandThrottle.AddBytes(qpack.Length);
                         qchanged = true;
                     }

@@ -368,9 +366,8 @@
                         LLQueItem qpack = WindOutgoingPacketQueue.Dequeue();

                         SendQueue.Enqueue(qpack);
-                        int qpackSize = qpack.Packet.ToBytes().Length;
-                        TotalThrottle.AddBytes(qpackSize);
-                        WindThrottle.AddBytes(qpackSize);
+                        TotalThrottle.AddBytes(qpack.Length);
+                        WindThrottle.AddBytes(qpack.Length);
                         qchanged = true;
                     }

@@ -379,9 +376,8 @@
                         LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue();

                         SendQueue.Enqueue(qpack);
-                        int qpackSize = qpack.Packet.ToBytes().Length;
-                        TotalThrottle.AddBytes(qpackSize);
-                        CloudThrottle.AddBytes(qpackSize);
+                        TotalThrottle.AddBytes(qpack.Length);
+                        CloudThrottle.AddBytes(qpack.Length);
                         qchanged = true;
                     }

@@ -399,9 +395,8 @@
                             SendQueue.Enqueue(qpack);
                         }

-                        int qpackSize = qpack.Packet.ToBytes().Length;
-                        TotalThrottle.AddBytes(qpackSize);
-                        TaskThrottle.AddBytes(qpackSize);
+                        TotalThrottle.AddBytes(qpack.Length);
+                        TaskThrottle.AddBytes(qpack.Length);
                         qchanged = true;
                     }

@@ -410,9 +405,8 @@
                         LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue();

                         SendQueue.Enqueue(qpack);
-                        int qpackSize = qpack.Packet.ToBytes().Length;
-                        TotalThrottle.AddBytes(qpackSize);
-                        TextureThrottle.AddBytes(qpackSize);
+                        TotalThrottle.AddBytes(qpack.Length);
+                        TextureThrottle.AddBytes(qpack.Length);
                         qchanged = true;
                     }

@@ -421,9 +415,8 @@
                         LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue();

                         SendQueue.Enqueue(qpack);
-                        int qpackSize = qpack.Packet.ToBytes().Length;
-                        TotalThrottle.AddBytes(qpackSize);
-                        AssetThrottle.AddBytes(qpackSize);
+                        TotalThrottle.AddBytes(qpack.Length);
+                        AssetThrottle.AddBytes(qpack.Length);
                         qchanged = true;
                     }
                 }
@@ -451,8 +444,8 @@
                 try
                 {
                     Monitor.Enter(this);
-                    throttle.AddBytes(item.Packet.ToBytes().Length);
-                    TotalThrottle.AddBytes(item.Packet.ToBytes().Length);
+                    throttle.AddBytes(item.Length);
+                    TotalThrottle.AddBytes(item.Length);
                     SendQueue.Enqueue(item);
                 }
                 catch (Exception e)


Fix the failed test

Fix the failed test

--- Web/Areas/EarlyWarning/Controllers/HRDController.cs
+++ Web/Areas/EarlyWarning/Controllers/HRDController.cs
@@ -110,7 +110,7 @@
         [EarlyWarningAuthorize(operation = EarlyWarningConstants.Operation.View_HRD_list)]
         public ActionResult HRD_Read([DataSourceRequest] DataSourceRequest request)
         {
-            var hrds = _hrdService.FindBy(m => m.Status == 1).OrderByDescending(m => m.HRDID);
+            var hrds = _hrdService.Get(m => m.Status == 1).OrderByDescending(m => m.HRDID);
             var hrdsToDisplay = GetHrds(hrds).ToList();
             return Json(hrdsToDisplay.ToDataSourceResult(request));
         }


Being an idgit I forgot to crrect the API call for file retrival.

--- MakerFarm/Controllers/ClientsAPIController.cs
+++ MakerFarm/Controllers/ClientsAPIController.cs
@@ -217,9 +217,9 @@
             int JobId = (int)parameters["JobId"];
             string MachineName = (string)parameters["MachineName"];
             try{
-                //Machine PrinterUsed = Client.ClientPermissions.FirstOrDefault(p => p.Machine.AssignedJob.JobId == JobId && p.Machine.MachineName.Equals(MachineName)).Machine;
-                //string fileLocation = PrinterUsed.AssignedJob.AffiliatedPrint.GetPath();
-                string fileLocation = db.Prints.Find(53).GetPath();
+                Machine PrinterUsed = Client.ClientPermissions.FirstOrDefault(p => p.Machine.AssignedJob.JobId == JobId && p.Machine.MachineName.Equals(MachineName)).Machine;
+                string fileLocation = PrinterUsed.AssignedJob.AffiliatedPrint.GetPath();
+                //string fileLocation = db.Prints.Find(53).GetPath();
                 HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
                 System.IO.FileStream stream = new System.IO.FileStream(fileLocation, System.IO.FileMode.Open);
                 result.Content = new StreamContent(stream);


Fix asset usages for field, when script component is assigned to field in Inspector

--- resharper/resharper-unity/src/Yaml/Psi/DeferredCaches/AssetHierarchy/Elements/IScriptComponentHierarchy.cs
+++ resharper/resharper-unity/src/Yaml/Psi/DeferredCaches/AssetHierarchy/Elements/IScriptComponentHierarchy.cs
@@ -2,7 +2,7 @@

 namespace JetBrains.ReSharper.Plugins.Unity.Yaml.Psi.DeferredCaches.AssetHierarchy.Elements
 {
-    public interface IScriptComponentHierarchy : IHierarchyElement
+    public interface IScriptComponentHierarchy : IComponentHierarchy
     {
         ExternalReference ScriptReference { get; }
     }


use 2.12 for nuspec minClientVersion.  this may not be the best answer, but it's better than the previous one, and it's the value that most projects seem to use.

--- gen_nuspecs/gen_nuspecs.cs
+++ gen_nuspecs/gen_nuspecs.cs
@@ -275,7 +275,7 @@
         XmlWriter f
         )
     {
-        f.WriteAttributeString("minClientVersion", "2.8.1"); // TODO this is wrong
+        f.WriteAttributeString("minClientVersion", "2.12"); // TODO not sure this is right

         f.WriteElementString("id", id);
         f.WriteElementString("title", id);


Bumped version of myre.Graphics

Bumped version of myre.Graphics

Signed-off-by: Martin Evans <fbe68550a3878a44ead7fa06f7b29f9942900ad3@gmail.com>


dnd style $roll (for example: 3d5)

dnd style $roll (for example: 3d5)

--- NadekoBot/Modules/Gambling/DiceRollCommand.cs
+++ NadekoBot/Modules/Gambling/DiceRollCommand.cs
@@ -6,6 +6,7 @@
 using System.Drawing;
 using System.Drawing.Imaging;
 using System.Linq;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;

 namespace NadekoBot.Modules.Gambling
@@ -19,13 +20,14 @@
         internal override void Init(CommandGroupBuilder cgb)
         {
             cgb.CreateCommand(Module.Prefix + "roll")
-                .Description("Rolls 0-100. If you supply a number [x] it rolls up to 30 normal dice.\n**Usage**: $roll [x]")
+                .Description("Rolls 0-100. If you supply a number [x] it rolls up to 30 normal dice." +
+                             " If you split 2 numbers with letter d (xdy) it will roll x dice from 1 to y.\n**Usage**: $roll or $roll 7 or $roll 3d5")
                 .Parameter("num", ParameterType.Optional)
-                .Do(Roll0to10Func());
+                .Do(RollFunc());
             cgb.CreateCommand(Module.Prefix + "nroll")
                 .Description("Rolls in a given range.\n**Usage**: `$nroll 5` (rolls 0-5) or `$nroll 5-15`")
                 .Parameter("range", ParameterType.Required)
-                .Do(Roll0to5Func());
+                .Do(NRollFunc());
         }

         private Image GetDice(int num) => num != 10
@@ -36,12 +38,15 @@
                                               (Properties.Resources.ResourceManager.GetObject("_" + 0) as Image),
                                             }.Merge();

-        private Func<CommandEventArgs, Task> Roll0to10Func()
+
+        Regex dndRegex = new Regex(@"(?<n1>\d+)d(?<n2>\d+)", RegexOptions.Compiled);
+        private Func<CommandEventArgs, Task> RollFunc()
         {
             var r = new Random();
             return async e =>
             {
-                if (e.Args[0] == "")
+                var arg = e.Args[0]?.Trim();
+                if (string.IsNullOrWhiteSpace(arg))
                 {
                     var gen = r.Next(0, 101);

@@ -51,53 +56,68 @@
                     var imageStream = new Image[2] { GetDice(num1), GetDice(num2) }.Merge().ToStream(ImageFormat.Png);

                     await e.Channel.SendFile("dice.png", imageStream);
+                    return;
                 }
-                else
+                Match m;
+                if ((m = dndRegex.Match(arg)).Length != 0)
                 {
-                    try
+                    int n1;
+                    int n2;
+                    if (int.TryParse(m.Groups["n1"].ToString(), out n1) &&
+                        int.TryParse(m.Groups["n2"].ToString(), out n2) &&
+                        n1 <= 50 && n2 <= 100000 && n1 > 0 && n2 > 0)
                     {
-                        var num = int.Parse(e.Args[0]);
-                        if (num < 1) num = 1;
-                        if (num > 30)
+                        var arr = new int[n1];
+                        for (int i = 0; i < n1; i++)
                         {
-                            await e.Channel.SendMessage("You can roll up to 30 dice at a time.");
-                            num = 30;
+                            arr[i] = r.Next(1, n2 + 1);
                         }
-                        var dices = new List<Image>(num);
-                        var values = new List<int>(num);
-                        for (var i = 0; i < num; i++)
-                        {
-                            var randomNumber = r.Next(1, 7);
-                            var toInsert = dices.Count;
-                            if (randomNumber == 6 || dices.Count == 0)
-                                toInsert = 0;
-                            else if (randomNumber != 1)
-                                for (var j = 0; j < dices.Count; j++)
+                        await e.Channel.SendMessage($"`Rolled {n1} {(n1 == 1 ? "die" : "dice")} 1-{n2}.`\n`Result:`" + string.Join(", ", arr.OrderBy(x => x)));
+                    }
+                }
+                try
+                {
+                    var num = int.Parse(e.Args[0]);
+                    if (num < 1) num = 1;
+                    if (num > 30)
+                    {
+                        await e.Channel.SendMessage("You can roll up to 30 dice at a time.");
+                        num = 30;
+                    }
+                    var dices = new List<Image>(num);
+                    var values = new List<int>(num);
+                    for (var i = 0; i < num; i++)
+                    {
+                        var randomNumber = r.Next(1, 7);
+                        var toInsert = dices.Count;
+                        if (randomNumber == 6 || dices.Count == 0)
+                            toInsert = 0;
+                        else if (randomNumber != 1)
+                            for (var j = 0; j < dices.Count; j++)
+                            {
+                                if (values[j] < randomNumber)
                                 {
-                                    if (values[j] < randomNumber)
-                                    {
-                                        toInsert = j;
-                                        break;
-                                    }
+                                    toInsert = j;
+                                    break;
                                 }
-                            dices.Insert(toInsert, GetDice(randomNumber));
-                            values.Insert(toInsert, randomNumber);
-                        }
+                            }
+                        dices.Insert(toInsert, GetDice(randomNumber));
+                        values.Insert(toInsert, randomNumber);
+                    }

-                        var bitmap = dices.Merge();
-                        await e.Channel.SendMessage(values.Count + " Dice rolled. Total: **" + values.Sum() + "** Average: **" + (values.Sum() / (1.0f * values.Count)).ToString("N2") + "**");
-                        await e.Channel.SendFile("dice.png", bitmap.ToStream(ImageFormat.Png));
-                    }
-                    catch
-                    {
-                        await e.Channel.SendMessage("Please enter a number of dice to roll.");
-                    }
+                    var bitmap = dices.Merge();
+                    await e.Channel.SendMessage(values.Count + " Dice rolled. Total: **" + values.Sum() + "** Average: **" + (values.Sum() / (1.0f * values.Count)).ToString("N2") + "**");
+                    await e.Channel.SendFile("dice.png", bitmap.ToStream(ImageFormat.Png));
+                }
+                catch
+                {
+                    await e.Channel.SendMessage("Please enter a number of dice to roll.");
                 }
             };
         }

-        private Func<CommandEventArgs, Task> Roll0to5Func() =>
+        private Func<CommandEventArgs, Task> NRollFunc() =>
             async e =>
             {
                 try


- Missed a file for last SquaredLength changes

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@1993 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Projects/AxiomDemos/Source/Demos/VolumetricTexture.cs
+++ Projects/AxiomDemos/Source/Demos/VolumetricTexture.cs
@@ -303,7 +303,7 @@
             max = BoundingBox.Maximum;
             mid = ( ( min - max ) * 0.5f ) + min;
             dist = camera.DerivedPosition - mid;
-            return dist.SquaredLength;
+            return dist.LengthSquared;
         }
         public override void GetWorldTransforms( Axiom.Math.Matrix4[] matrices )
         {
@@ -324,7 +324,7 @@
             base.NotifyCurrentCamera( camera );

             Vector3 zVec = ParentNode.DerivedPosition - camera.DerivedPosition;
-            float sqdist = zVec.SquaredLength;
+            float sqdist = zVec.LengthSquared;
             zVec.Normalize();
             Vector3 fixedAxis = camera.DerivedOrientation * Vector3.UnitY;
             Vector3 xVec = fixedAxis.Cross( zVec );


clean-up

clean-up

--- Neutronium.Core/Binding/GlueObject/JSArray.cs
+++ Neutronium.Core/Binding/GlueObject/JSArray.cs
@@ -51,7 +51,6 @@
             foreach (var item in Items)
                 visit(item);
         }
-

         public void RequestBuildInstruction(IJavascriptObjectBuilder builder)
         {


should not add parentheses for classes that are not being instantiated

--- OmniSharp/AutoComplete/AutoCompleteHandler.cs
+++ OmniSharp/AutoComplete/AutoCompleteHandler.cs
@@ -71,8 +71,7 @@

             if (nodeUnderCursor != null
                 && nodeUnderCursor.Parent != null
-                && nodeUnderCursor.Parent.Parent != null
-                && nodeUnderCursor.Parent.PrevSibling != null)
+                && nodeUnderCursor.Parent.Parent != null)
             {
                 instantiating =
                     nodeUnderCursor.Parent.Parent.Children.Any(child => child.Role.ToString() == "new");


let ode also finish internal representation  of prim actors, before simulation

--- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
+++ OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
@@ -2918,6 +2918,46 @@
                 }
             }
         }
+
+        // does all pending changes generated during region load process
+        public override void ProcessPreSimulation()
+        {
+            lock (OdeLock)
+            {
+                if (world == IntPtr.Zero)
+                {
+                    _taintedPrims.Clear();;
+                    return;
+                }
+
+                int donechanges = 0;
+                if (_taintedPrims.Count > 0)
+                {
+                    m_log.InfoFormat("[Ode] start processing pending actor operations");
+                    int tstart = Util.EnvironmentTickCount();
+
+                    lock (_taintedPrims)
+                    {
+                        foreach (OdePrim prim in _taintedPrims)
+                        {
+                            if (prim.m_taintremove)
+                                RemovePrimThreadLocked(prim);
+                            else
+                                prim.ProcessTaints();
+
+                            prim.m_collisionscore = 0;
+                            donechanges++;
+                        }
+                        _taintedPrims.Clear();
+                    }
+
+                    int time = Util.EnvironmentTickCountSubtract(tstart);
+                    m_log.InfoFormat("[Ode] finished {0} operations in {1}ms", donechanges, time);
+                }
+                m_log.InfoFormat("[Ode] {0} prim actors loaded",_prims.Count);
+            }
+        }
+

         /// <summary>
         /// This is our main simulate loop


mvk106 & mvk108 full Image Statistics saved

--- Schneedetektion/Schneedetektion.GatherData/Program.cs
+++ Schneedetektion/Schneedetektion.GatherData/Program.cs
@@ -44,13 +44,13 @@

         private static void CalculateImageStatistics()
         {
-            IEnumerable<Image> images = from i in dataContext.Images
-                                        where i.Place == "mvk021"
+            IEnumerable<Image> images = (from i in dataContext.Images
+                                        where i.Place == "mvk108"
                                         where i.Day == true
                                         where i.Entity_Statistics.Count == 0
-                                        select i;
+                                        select i).Take(take);

-            foreach (var image in images.Take(take))
+            foreach (var image in images)
             {
                 ManualResetEvent resetEvent = new ManualResetEvent(false);
                 ThreadPool.QueueUserWorkItem(arg =>
@@ -72,7 +72,7 @@
             dataContext.SubmitChanges();
             Console.WriteLine("Saved!");

-            if (images.Count() > take)
+            if (images.Count() > 0)
             {
                 resetEvents.Clear();
                 CalculateImageStatistics();


Make sure shrink is the default

Make sure shrink is the default

--- Pablo/Graphics/BaseTypes/DimensionBehavior.cs
+++ Pablo/Graphics/BaseTypes/DimensionBehavior.cs
@@ -13,11 +13,6 @@
     /// </summary>
     public enum DimensionBehavior
     {
-        /// <summary>
-        /// Statically measure the dimension.
-        /// </summary>
-        Static,
-
         /// <summary>
         /// Shrink to minimum possible value.
         /// </summary>
@@ -37,5 +32,10 @@
         /// Measure proportional to maximum possible value,
         /// </summary>
         Proportional,
+
+        /// <summary>
+        /// Statically measure the dimension.
+        /// </summary>
+        Static,
     }
 }


Better comment

Better comment

--- src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs
+++ src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs
@@ -25,8 +25,8 @@

             public void Do(IOleUndoManager pUndoManager)
             {
-                // FirstOrDefault is okay because that's how the rename would have been
-                // done in the forward direction as well.
+                // Using FirstOrDefault because we only need to rename one document, as that will get
+                // applied to linked files.
                 var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(_filePath).FirstOrDefault();
                 if (documentId != null)
                 {


GetAllClients is now IReadOnlyList. Guess it's better

--- PokeD.Server/Services/ModuleManagerService.cs
+++ PokeD.Server/Services/ModuleManagerService.cs
@@ -237,7 +237,7 @@

         public IReadOnlyList<IServerModuleBaseSettings> GetModuleSettings() => Modules;

-        public IEnumerable<Client> GetAllClients() => Modules.Where(module => module.ClientsVisible).SelectMany(module => module.GetClients().Where(client => !client.Permissions.HasFlag(PermissionFlags.UnVerified)));
+        public IReadOnlyList<Client> GetAllClients() => Modules.Where(module => module.ClientsVisible).SelectMany(module => module.GetClients().Where(client => !client.Permissions.HasFlag(PermissionFlags.UnVerified))).ToList();
         public Client GetClient(int id) => GetAllClients().FirstOrDefault(client => client.ID == id);
         public Client GetClient(string name) => GetAllClients().FirstOrDefault(client => client.Name == name || client.Nickname == name);
         public int GetClientID(string name) => GetClient(name)?.ID ?? -1;


Adapted the process SignupANotEnabledAccount to accept 'subscriber' users too (with adapted language), fixes #730

--- web/App_Code/LcAuthHelper.cs
+++ web/App_Code/LcAuthHelper.cs
@@ -219,18 +219,34 @@
     /// Is true when the user exist at database but the account is not enabled (never accepted TOU or created a password).
     /// That happens when:
     /// - Has a status of 'serviceProfessionalClient'
+    /// - Has a status of 'subscriber'
     /// </summary>
     /// <param name="user"></param>
     /// <returns></returns>
     private static bool IsUserButNotEnabledAccount(LcRest.UserProfile user)
     {
-        return user.accountStatusID == (int)LcEnum.AccountStatus.serviceProfessionalClient;
-    }
+        return (
+            user.accountStatusID == (int)LcEnum.AccountStatus.serviceProfessionalClient ||
+            user.accountStatusID == (int)LcEnum.AccountStatus.subscriber
+        );
+    }
+    const string UserIsServiceProfessionalClientMessage = @"
+        We see one of our service professionals has already scheduled services for you in the past.
+        We've just sent an invitation to create your account to {0}.
+        Please follow its instructions. We can't wait to get you on board!
+    ";
+    const string UserIsSubscriberMessage = @"
+        We see you have subscribed previously to our newsletter or referrenced a service professional.
+        We've just sent an invitation to create your account to {0}.
+        Please follow its instructions. We can't wait to get you on board!
+    ";
     /// <summary>
-    /// Convert a user record with 'Not Enabled Account' into a standard enabled account. This doesn't validate the user
-    /// record fits that case, so call IsUserButNotEnabledAccount before this (and see it's docs)
+    /// Convert a user record with 'Not Enabled Account' into a standard enabled account. See IsUserButNotEnabledAccount
+    /// for more info, and check that value before call this to prevent an error when user has an enabled account.
     /// This supports the cases
     /// - User with status of 'serviceProfessionalClient': the user has an account created as client by a service professional.
+    /// - User with status of 'subscriber': the user submitted it's email through a Lead Generation API to get in touch with newsletters or
+    ///   to reference a service professional.
     ///
     /// For the conversion, we need support next actions/requests:
     /// - A: We need to communicate that specific situation (error message), generate a confirmation code
@@ -244,18 +260,30 @@
     /// <param name="password"></param>
     /// <param name="returnProfile"></param>
     /// <returns></returns>
-    private static LoginResult SignupANotEnabledAccount(int userID, string email, string password, bool returnProfile)
-    {
+    private static LoginResult SignupANotEnabledAccount(int userID, string email, string password, bool returnProfile, int accountStatusID)
+    {
+        // Get confirmation code, if any
         var confirmationCode = Request["confirmationCode"];
-        var errMsg = String.Format(@"
-            We see one of our service professionals has already scheduled services for you in the past.
-            We've just sent an invitation to create your account to {0}.
-            Please follow its instructions. We can't wait to get you on board!", email
-        );
+        // Prepare error message
+        var errTpl = "";
+        if (accountStatusID == (int)LcEnum.AccountStatus.serviceProfessionalClient)
+        {
+            errTpl = UserIsServiceProfessionalClientMessage;
+        }
+        else if (accountStatusID == (int)LcEnum.AccountStatus.subscriber)
+        {
+            errTpl = UserIsSubscriberMessage;
+        }
+        else
+        {
+            throw new Exception("Not allowed");
+        }
+        var errMsg = String.Format(errTpl, email);
+
         // Action/Request A: Create confirmation code
         if (String.IsNullOrEmpty(confirmationCode))
         {
-            // To generate a confirmation code (creates the Membership record, that does not exists still since is as just a client)
+            // To generate a confirmation code (creates the Membership record, that does not exists still)
             // this needs a random password (we still didn't verified the user, so do NOT trust on the given password).
             // NOTE: since this can be attempted several time by the user, and next attempts will fail because the Membership
             // record will exists already, just double check and try creation only if record don't exists:
@@ -275,7 +303,7 @@
             // If confirmation token is valid, enable account and reset password
             if (LcAuth.GetConfirmationToken(userID) == confirmationCode)
             {
-                // We know is valid, we can update the accountStatus to not be any more a "service professional's client"
+                // We know is valid, we can update the accountStatus to be an standard/enabled account
                 // and that will allow to set the account as confirmed
                 using (var db = new LcDatabase())
                 {
@@ -394,7 +422,7 @@
                 // and is possible for that user to become an regular/enabled account.
                 if (IsUserButNotEnabledAccount(user))
                 {
-                    logged = SignupANotEnabledAccount(userID, email, password, returnProfile);
+                    logged = SignupANotEnabledAccount(userID, email, password, returnProfile, user.accountStatusID);
                 }
                 else
                 {


fix a bug in AbstractApiService.

fix a bug in AbstractApiService.

Signed-off-by: robertzml <321e7786a406a136366094c578d0f1193a3468e1@126.com>

--- Poseidon.Base/Framework/AbstractApiService.cs
+++ Poseidon.Base/Framework/AbstractApiService.cs
@@ -185,13 +185,13 @@
             throw new NotImplementedException();
         }

-        public IEnumerable<T> FindAllNormal()
-        {
-            throw new NotImplementedException();
-        }
-
-
-        public IEnumerable<T> FindListByField<Tvalue>(string field, Tvalue value)
+        public virtual IEnumerable<T> FindAllNormal()
+        {
+            throw new NotImplementedException();
+        }
+
+
+        public virtual IEnumerable<T> FindListByField<Tvalue>(string field, Tvalue value)
         {
             throw new NotImplementedException();
         }
@@ -206,42 +206,42 @@
             throw new NotImplementedException();
         }

-        public T FindOneByField<Tvalue>(string field, Tvalue value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public long Count()
-        {
-            throw new NotImplementedException();
-        }
-
-        public long Count<Tvalue>(string field, Tvalue value)
-        {
-            throw new NotImplementedException();
-        }
-
-        public T Create(T entity)
-        {
-            throw new NotImplementedException();
-        }
-
-        public T Create(T entity, bool generateKey)
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool Update(T entity)
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool Delete(Tkey id)
-        {
-            throw new NotImplementedException();
-        }
-
-        public bool Delete(T entity)
+        public virtual T FindOneByField<Tvalue>(string field, Tvalue value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual long Count()
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual long Count<Tvalue>(string field, Tvalue value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual T Create(T entity)
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual T Create(T entity, bool generateKey)
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual bool Update(T entity)
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual bool Delete(Tkey id)
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual bool Delete(T entity)
         {
             throw new NotImplementedException();
         }