Export drawcall times with proper summation over regions. Refs #468

--- renderdocui/Windows/EventBrowser.cs
+++ renderdocui/Windows/EventBrowser.cs
@@ -1234,6 +1234,29 @@
                 GetMaxNameLength(ref maxNameLength, indent + 1, i == 0, drawcall.children[i]);
         }

+        private double GetDrawTime(FetchDrawcall drawcall)
+        {
+            if (drawcall.children.Length > 0)
+            {
+                double total = 0.0;
+
+                foreach (FetchDrawcall c in drawcall.children)
+                {
+                    double f = GetDrawTime(c);
+                    if(f >= 0)
+                        total += f;
+                }
+
+                return total;
+            }
+            else if (m_Times.ContainsKey(drawcall.eventID))
+            {
+                return m_Times[drawcall.eventID][0].value.d;
+            }
+
+            return -1.0;
+        }
+
         private void ExportDrawcall(StreamWriter sw, int maxNameLength, int indent, bool firstchild, FetchDrawcall drawcall)
         {
             string eidString = drawcall.children.Length > 0 ? "" : drawcall.eventID.ToString();
@@ -1247,10 +1270,10 @@
                 if (m_Core.Config.EventBrowser_TimeUnit != m_TimeUnit)
                     UpdateDurationColumn();

-                if(m_Times.ContainsKey(drawcall.eventID))
-                {
-                    double f = m_Times[drawcall.eventID][0].value.d;
-
+                double f = GetDrawTime(drawcall);
+
+                if (f >= 0)
+                {
                     if (m_Core.Config.EventBrowser_TimeUnit == PersistantConfig.TimeUnit.Milliseconds)
                         f *= 1000.0;
                     else if (m_Core.Config.EventBrowser_TimeUnit == PersistantConfig.TimeUnit.Microseconds)
@@ -1259,6 +1282,10 @@
                         f *= 1000000000.0;

                     line += String.Format(" | {0}", Formatter.Format(f));
+                }
+                else
+                {
+                    line += " |";
                 }
             }


Fix infinite loop toggling breakpoint

Fix infinite loop toggling breakpoint

* Also we don't set the custom assembly context menu when there is no
  trace to debug.

--- renderdocui/Windows/ShaderViewer.cs
+++ renderdocui/Windows/ShaderViewer.cs
@@ -287,7 +287,7 @@
         {
             var line = sc.Lines.FromPosition(position);

-            while (line != null)
+            while (line != null && line.StartPosition >= 0)
             {
                 var trimmed = line.Text.Trim();

@@ -445,8 +445,11 @@
                 BreakpointMarkers.Add(BREAKPOINT_MARKER);
                 BreakpointMarkers.Add(BREAKPOINT_MARKER + 1);

-                m_DisassemblyView.ContextMenu = AssemblyContextMenu();
-                m_DisassemblyView.MouseDown += new MouseEventHandler(contextMouseDown);
+                if (trace != null)
+                {
+                    m_DisassemblyView.ContextMenu = AssemblyContextMenu();
+                    m_DisassemblyView.MouseDown += new MouseEventHandler(contextMouseDown);
+                }

                 m_Scintillas.Add(m_DisassemblyView);


Improved error handling of parse nodes

Improved error handling of parse nodes

--- src/OpenApi/Nodes/ParseNodes.cs
+++ src/OpenApi/Nodes/ParseNodes.cs
@@ -69,28 +69,29 @@

         public virtual string GetScalarValue()
         {
-            throw new Exception();
+            throw new DomainParseException("Cannot get scalar value");
         }

         public virtual Dictionary<string, T> CreateMap<T>(Func<MapNode, T> map)
         {
-            throw new Exception();
+            throw new DomainParseException("Cannot create map");
         }
         public virtual Dictionary<string, T> CreateMapWithReference<T>(string refpointer, Func<MapNode, T> map) where T : class, IReference
         {
-            throw new Exception();
+            throw new DomainParseException("Cannot create map from reference");
         }
         public virtual Dictionary<string, T> CreateSimpleMap<T>(Func<ValueNode, T> map)
         {
-            throw new Exception();
+            throw new DomainParseException("Cannot create simple map");
         }
         public virtual List<T> CreateList<T>(Func<MapNode, T> map)
         {
-            throw new Exception();
+            throw new DomainParseException("Cannot create list");
+
         }
         public virtual List<T> CreateSimpleList<T>(Func<ValueNode, T> map)
         {
-            throw new Exception();
+            throw new DomainParseException("Cannot create simple list");
         }

         internal string CheckRegex(string value, Regex versionRegex, string defaultValue)


Added doc comment on top of the ICacheRepo interface.

--- src/RedisRepo.Src/ICacheRepo.cs
+++ src/RedisRepo.Src/ICacheRepo.cs
@@ -5,6 +5,7 @@
 namespace RedisRepo.Src
 {
 	/// <summary>
+	/// 	Wrapper for a typed instance to interact with Redis Cache
 	/// </summary>
 	public interface ICacheRepo<T> where T : class
 	{


Added uncountable staff in Inflector

Added uncountable staff in Inflector

--- src/RestfulRouting/Inflector.cs
+++ src/RestfulRouting/Inflector.cs
@@ -93,6 +93,7 @@
             AddUncountable("series");
             AddUncountable("fish");
             AddUncountable("sheep");
+            AddUncountable("staff");
         }

         private class Rule


Throw instead of Debug.Asserting on error-code check

This caused test hangs when Debug.Assert put up a dialog, instead of quickly-failing tests.

--- src/Shared/TaskLoggingHelper.cs
+++ src/Shared/TaskLoggingHelper.cs
@@ -298,7 +298,7 @@
             // should have error codes.
             string errorCode;
             ResourceUtilities.ExtractMessageCode(true /* only msbuild codes */, message, out errorCode);
-            Debug.Assert(errorCode == null, errorCode, "This message contains an error code (" + errorCode + "), yet it was logged as a regular message: " + message);
+            ErrorUtilities.VerifyThrow(errorCode == null, errorCode, "This message contains an error code (" + errorCode + "), yet it was logged as a regular message: " + message);
 #endif
         }

@@ -469,7 +469,7 @@
             // should have error codes.
             string errorCode;
             ResourceUtilities.ExtractMessageCode(true /* only msbuild codes */, FormatResourceString(messageResourceName, messageArgs), out errorCode);
-            Debug.Assert(errorCode == null, errorCode, FormatResourceString(messageResourceName, messageArgs));
+            ErrorUtilities.VerifyThrow(errorCode == null, errorCode, FormatResourceString(messageResourceName, messageArgs));
 #endif
         }

@@ -701,7 +701,8 @@
             // message code when there probably isn't one.
             string messageCode;
             string throwAwayMessageBody = ResourceUtilities.ExtractMessageCode(true /* only msbuild codes */, FormatResourceString(messageResourceName, messageArgs), out messageCode);
-            Debug.Assert(messageCode == null || messageCode.Length == 0, "Called LogErrorFromResources instead of LogErrorWithCodeFromResources, but message '" + throwAwayMessageBody + "' does have an error code '" + messageCode + "'");
+
+            ErrorUtilities.VerifyThrow(messageCode == null || messageCode.Length == 0, "Called LogErrorFromResources instead of LogErrorWithCodeFromResources, but message '" + throwAwayMessageBody + "' does have an error code '" + messageCode + "'");
 #endif

             LogError
@@ -1017,7 +1018,7 @@
             // Check this only in debug, to avoid the cost of attempting to extract a
             // message code when there probably isn't one.
             string throwAwayMessageBody = ResourceUtilities.ExtractMessageCode(true /* only msbuild codes */, FormatResourceString(messageResourceName, messageArgs), out string messageCode);
-            Debug.Assert(string.IsNullOrEmpty(messageCode), "Called LogWarningFromResources instead of LogWarningWithCodeFromResources, but message '" + throwAwayMessageBody + "' does have an error code '" + messageCode + "'");
+            ErrorUtilities.VerifyThrow(string.IsNullOrEmpty(messageCode), "Called LogWarningFromResources instead of LogWarningWithCodeFromResources, but message '" + throwAwayMessageBody + "' does have an error code '" + messageCode + "'");
 #endif

             LogWarning


StoryEventクラスとAnimateEventクラスを統合

StoryEventクラスとAnimateEventクラスを統合

--- src/Sitrine/Event/StoryEvent.cs
+++ src/Sitrine/Event/StoryEvent.cs
@@ -32,6 +32,7 @@
     public abstract class StoryEvent<T>
     {
         #region -- Private Fields --
+        private DelaySpan delayspan;
         private int? id = null;
         #endregion

@@ -97,6 +98,45 @@

             return this.Subclass;
         }
+
+        /// <summary>
+        /// 指定されたフレーム数だけ動作を遅延させます。
+        /// </summary>
+        /// <param name="frames">遅延させるフレーム数。</param>
+        /// <returns>このイベントのオブジェクトを返します。</returns>
+        public T Delay(int frames)
+        {
+            if (frames < 0)
+                throw new ArgumentOutOfRangeException("frames");
+
+            this.delayspan.Add(frames);
+
+            return this.Subclass;
+        }
+
+        /// <summary>
+        /// 指定された秒数だけ動作を遅延させます。
+        /// </summary>
+        /// <param name="seconds">遅延させる秒数。</param>
+        /// <returns>このイベントのオブジェクトを返します。</returns>
+        public T Delay(double seconds)
+        {
+            if (seconds < 0.0)
+                throw new ArgumentOutOfRangeException("seconds");
+
+            this.delayspan.Add(seconds);
+
+            return this.Subclass;
+        }
+        #endregion
+
+        #region -- Protected Methods --
+        protected DelaySpan PopDelaySpan()
+        {
+            DelaySpan ds = this.delayspan;
+            this.delayspan = new DelaySpan();
+            return ds;
+        }
         #endregion
     }
 }


Changed memory bus handler store strategy

--- src/Take.Elephant/Memory/Bus.cs
+++ src/Take.Elephant/Memory/Bus.cs
@@ -13,27 +13,22 @@
     /// <typeparam name="TMessage"></typeparam>
     public class Bus<TChannel, TMessage> : IBus<TChannel, TMessage>
     {
-        private readonly string _busName;
-        private static readonly ConcurrentDictionary<string, ConcurrentDictionary<TChannel, ConcurrentBag<Func<TChannel, TMessage, CancellationToken, Task>>>> _busChannelHandlerDictionary;
+        private readonly BusHandlerStore<TChannel, TMessage> _handlerStore;

-        static Bus()
+        public Bus()
+            : this(BusHandlerStore<TChannel, TMessage>.Default)
         {
-            _busChannelHandlerDictionary = new ConcurrentDictionary<string, ConcurrentDictionary<TChannel, ConcurrentBag<Func<TChannel, TMessage, CancellationToken, Task>>>>();
+
+        }
+
+        public Bus(BusHandlerStore<TChannel, TMessage> handlerStore)
+        {
+            _handlerStore = handlerStore ?? throw new ArgumentNullException(nameof(handlerStore));
         }

-        public Bus(string busName = "default")
-        {
-            _busName = busName ?? throw new ArgumentNullException(nameof(busName));
-        }
-
-        private ConcurrentDictionary<TChannel, ConcurrentBag<Func<TChannel, TMessage, CancellationToken, Task>>> ChannelHandlerDictionary =>
-            _busChannelHandlerDictionary.GetOrAdd(
-                _busName,
-                _ => new ConcurrentDictionary<TChannel, ConcurrentBag<Func<TChannel, TMessage, CancellationToken, Task>>>());
-
         public virtual Task SubscribeAsync(TChannel channel, Func<TChannel, TMessage, CancellationToken, Task> handler, CancellationToken cancellationToken)
         {
-            ChannelHandlerDictionary.AddOrUpdate(
+            _handlerStore.ChannelHandlerDictionary.AddOrUpdate(
                 channel,
                 new ConcurrentBag<Func<TChannel, TMessage, CancellationToken, Task>>()
                 {
@@ -50,15 +45,32 @@

         public virtual Task UnsubscribeAsync(TChannel channel, CancellationToken cancellationToken)
         {
-            ChannelHandlerDictionary.TryRemove(channel, out _);
+            _handlerStore.ChannelHandlerDictionary.TryRemove(channel, out _);
             return Task.CompletedTask;
         }

         public virtual async Task PublishAsync(TChannel channel, TMessage message, CancellationToken cancellationToken)
         {
-            if (!ChannelHandlerDictionary.TryGetValue(channel, out var handlers)) return;
+            if (!_handlerStore.ChannelHandlerDictionary.TryGetValue(channel, out var handlers)) return;

             await Task.WhenAll(handlers.Select(h => h(channel, message, cancellationToken)));
         }
     }
+
+    /// <summary>
+    /// Implements a store for <see cref="Bus{TChannel,TMessage}"/> handlers.
+    /// </summary>
+    /// <typeparam name="TChannel"></typeparam>
+    /// <typeparam name="TMessage"></typeparam>
+    public sealed class BusHandlerStore<TChannel, TMessage>
+    {
+        public static BusHandlerStore<TChannel, TMessage> Default { get; } = new BusHandlerStore<TChannel, TMessage>();
+
+        public BusHandlerStore()
+        {
+            ChannelHandlerDictionary = new ConcurrentDictionary<TChannel, ConcurrentBag<Func<TChannel, TMessage, CancellationToken, Task>>>();
+        }
+
+        public ConcurrentDictionary<TChannel, ConcurrentBag<Func<TChannel, TMessage, CancellationToken, Task>>> ChannelHandlerDictionary { get; }
+    }
 }


Generator: use uint32 for dbus h type

Generator: use uint32 for dbus h type

--- src/Tmds.DBus.Tool/Generator.cs
+++ src/Tmds.DBus.Tool/Generator.cs
@@ -272,13 +272,15 @@

         private SyntaxNode ParseType(string dbusType, ref int index, List<string> elementNames = null)
         {
-            switch (dbusType[index++])
+            char c;
+            switch (c = dbusType[index++])
             {
                 case 'y': return _generator.TypeExpression(SpecialType.System_Byte);
                 case 'b': return _generator.TypeExpression(SpecialType.System_Boolean);
                 case 'n': return _generator.TypeExpression(SpecialType.System_Int16);
                 case 'q': return _generator.TypeExpression(SpecialType.System_UInt16);
                 case 'i': return _generator.TypeExpression(SpecialType.System_Int32);
+                case 'h': return _generator.TypeExpression(SpecialType.System_UInt32);
                 case 'u': return _generator.TypeExpression(SpecialType.System_UInt32);
                 case 'x': return _generator.TypeExpression(SpecialType.System_Int64);
                 case 't': return _generator.TypeExpression(SpecialType.System_UInt64);
@@ -333,7 +335,7 @@
                 case '}':
                     return null;
                 default:
-                    throw new NotSupportedException($"Unexpected character '{dbusType[index]}' while parsing dbus type '{dbusType}'");
+                    throw new NotSupportedException($"Unexpected character '{c}' while parsing dbus type '{dbusType}'");
             }
         }


core TryAuthorizeAsync

core TryAuthorizeAsync

--- src/Xcst.AspNetCore/XcstPage.cs
+++ src/Xcst.AspNetCore/XcstPage.cs
@@ -12,9 +12,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.

+using System;
 using System.Collections.Generic;
 using System.Security.Principal;
+using System.Threading.Tasks;
 using System.Web.Mvc;
+using Microsoft.AspNetCore.Authentication;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Authorization.Policy;
 using Microsoft.AspNetCore.Http;

 namespace Xcst.Web {
@@ -82,5 +87,74 @@
       CopyState(XcstPage page) {
          page.Context = this.Context;
       }
+
+      public async Task<bool>
+      TryAuthorizeAsync(string? policy = null, string[]? roles = null) {
+
+         PolicyAuthorizationResult authorizeResult =
+            await TryAuthorizeCoreAsync(policy, roles);
+
+         if (authorizeResult.Challenged) {
+            await this.Context.ChallengeAsync();
+            return false;
+         }
+
+         if (authorizeResult.Forbidden) {
+            await this.Context.ForbidAsync();
+            return false;
+         }
+
+         return true;
+      }
+
+      public virtual async Task<PolicyAuthorizationResult>
+      TryAuthorizeCoreAsync(string? policy = null, string[]? roles = null) {
+
+         HttpContext httpContext = this.Context;
+         IPrincipal user = this.User;
+
+         if (user.Identity is null
+            || !user.Identity.IsAuthenticated) {
+
+            return PolicyAuthorizationResult.Challenge();
+         }
+
+         if (policy is null
+            && (roles is null || roles.Length == 0)) {
+
+            return PolicyAuthorizationResult.Success();
+         }
+
+         var policyProvider = (IAuthorizationPolicyProvider)httpContext.RequestServices.GetService(typeof(IAuthorizationPolicyProvider))!;
+         var policyEval = (IPolicyEvaluator)httpContext.RequestServices.GetService(typeof(IPolicyEvaluator))!;
+
+         var authorizeData = new AuthorizeData {
+            Policy = policy,
+            Roles = (roles != null) ? String.Join(',', roles) : null
+         };
+
+         AuthorizationPolicy? authorizationPolicy =
+            await AuthorizationPolicy.CombineAsync(policyProvider, new[] { authorizeData });
+
+         AuthenticateResult authenticateResult =
+            await policyEval.AuthenticateAsync(authorizationPolicy!, httpContext);
+
+         PolicyAuthorizationResult authorizeResult =
+            await policyEval.AuthorizeAsync(authorizationPolicy!, authenticateResult, httpContext, null);
+
+         return authorizeResult;
+      }
+
+      class AuthorizeData : IAuthorizeData {
+
+         public string?
+         Policy { get; set; }
+
+         public string?
+         Roles { get; set; }
+
+         public string?
+         AuthenticationSchemes { get; set; }
+      }
    }
 }


Modify navbar to split up page and file functions

--- src/Yio/Views/Home/Index.cshtml
+++ src/Yio/Views/Home/Index.cshtml
@@ -44,8 +44,16 @@

 Random

 Previous File

 Auto-Click

-
 Direct Link

 Upload

+

+

+

+

+

+

+
 Download

+
 Comments

+
 Tags


scrolling window

scrolling window

--- contractsWindow.cs
+++ contractsWindow.cs
@@ -15,6 +15,7 @@
 		private List<contractContainer> cList = new List<contractContainer>();
 		private string version;
 		private Assembly assembly;
+		private Vector2 scroll;

 		internal override void Awake()
 		{
@@ -23,7 +24,8 @@
 				assembly = AssemblyLoader.loadedAssemblies.GetByAssembly(Assembly.GetExecutingAssembly()).assembly;
 				version = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion;
 				WindowCaption = string.Format("Contracts {0}", version);
-				WindowRect = new Rect(0, 0, 250, 100);
+				WindowRect = new Rect(0, 0, 250, 300);
+				WindowOptions = new GUILayoutOption[1] { GUILayout.MaxHeight(300) };
 				Visible = true;
 				DragEnabled = true;
 				DragRect = new Rect(WindowRect.x, WindowRect.y, WindowRect.width, 20);
@@ -52,28 +54,30 @@
 		{
 			GUILayout.Label(string.Format("Active Contracts: {0}", cList.Count));
 			GUILayout.BeginVertical();
+			scroll = GUILayout.BeginScrollView(scroll);
 			foreach (contractContainer c in cList)
 			{
-				if (GUILayout.Button(c.contract.Title, titleState(c.contract.ContractState)))
-				{
+				GUILayout.Button(c.contract.Title, titleState(c.contract.ContractState));
+
 					GUILayout.BeginVertical();
-					parameterBox(c, 250);
+					//parameterBox(c, 250);
+					foreach (ContractParameter cP in c.contract.AllParameters)
+					{
+
+						GUILayout.BeginHorizontal();
+						GUILayout.Space(10);
+						GUILayout.Box(cP.Title, paramState(cP.State));
+						GUILayout.EndHorizontal();
+					}
+
 					GUILayout.EndVertical();
-				}
+

-				//GUILayout.BeginVertical();
-				//foreach (ContractParameter cP in c.contract.AllParameters)
-				//{
-
-				//    GUILayout.BeginHorizontal();
-				//    GUILayout.Space(10);
-				//    GUILayout.Box(cP.Title, paramState(cP.State));
-				//    GUILayout.EndHorizontal();
-				//}
-				//GUILayout.EndVertical();
+

 			}
 			GUILayout.EndVertical();
+			GUILayout.EndScrollView();

 		}


Move instructions about BuildServiceProvider() up

--- docs/guides/getting_started/samples/intro/structure.cs
+++ docs/guides/getting_started/samples/intro/structure.cs
@@ -99,15 +99,15 @@
         // and other dependencies that your commands might need.
         _map.AddSingleton(new SomeServiceClass());

+        // When all your required services are in the collection, build the container.
+        // Tip: There's an overload taking in a 'validateScopes' bool to make sure
+        // you haven't made any mistakes in your dependency graph.
+        _services = _map.BuildServiceProvider();
+
         // Either search the program and add all Module classes that can be found:
         await _commands.AddModulesAsync(Assembly.GetEntryAssembly());
         // Or add Modules manually if you prefer to be a little more explicit:
         await _commands.AddModuleAsync<SomeModule>();
-
-        // When all your required services are in the collection, build the container.
-        // Tip: There's an overload taking in a 'validateScopes' bool to make sure
-        // you haven't made any mistakes in your dependency graph.
-        _services = _map.BuildServiceProvider();

         // Subscribe a handler to see if a message invokes a command.
         _client.MessageReceived += HandleCommandAsync;


fix test.

fix test.

--- testcases/ooxml/POIFS/Crypt/TestDecryptor.cs
+++ testcases/ooxml/POIFS/Crypt/TestDecryptor.cs
@@ -160,7 +160,7 @@
         [Test]
         public void Test58616()
         {
-            POIFSFileSystem pfs = new POIFSFileSystem(XSSFTestDataSamples.GetSampleFile("58616.xlsx").Create());
+            POIFSFileSystem pfs = new POIFSFileSystem(XSSFTestDataSamples.GetSampleFile("58616.xlsx"));
             EncryptionInfo info = new EncryptionInfo(pfs);
             Decryptor dec = Decryptor.GetInstance(info);
             //dec.VerifyPassword(null);


Fix incorrect assert

Fix incorrect assert

Remove incorrect assert for CreateTemporaryInstance() by itself, as if you don't do anything with it it's lazy.

--- tests/SqlLocalDb.Tests/SqlLocalDbApiTests.cs
+++ tests/SqlLocalDb.Tests/SqlLocalDbApiTests.cs
@@ -144,7 +144,6 @@
             {
                 // Act and Assert
                 Assert.Throws<PlatformNotSupportedException>(() => actual.CreateInstance("name"));
-                Assert.Throws<PlatformNotSupportedException>(() => actual.CreateTemporaryInstance());
                 Assert.Throws<PlatformNotSupportedException>(() => actual.DeleteInstance("name"));
                 Assert.Throws<PlatformNotSupportedException>(() => actual.DeleteUserInstances());
                 Assert.Throws<PlatformNotSupportedException>(() => actual.GetDefaultInstance());


Update test app with non-foci app

Update test app with non-foci app

--- tests/devapps/NetFxConsoleTestApp/Program.cs
+++ tests/devapps/NetFxConsoleTestApp/Program.cs
@@ -41,31 +41,42 @@
     public class Program
     {
         // TODO: replace with FOCI family members IDs
-        private const string FAMILY_MEMBER_1 = "";
-        private const string FAMILY_MEMBER_2 = "";
+        // DO NOT CHECK THESE IN
+        private const string FAMILY_MEMBER_1 = "";  // Office
+        private const string FAMILY_MEMBER_2 = "";  // Teams
+        private const string NON_FAMILY_MEMBER = "0615b6ca-88d4-4884-8729-b178178f7c27";
+

         private static readonly string[] s_scopes = new[] { "https://graph.microsoft.com/.default" };

-        private static readonly string s_cacheFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location + ".msalcache.bin";
+        private static readonly string s_cacheFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location + ".msalcache.json";

         // These 2 apps share the cache
-        private static IPublicClientApplication s_pca1;
-        private static IPublicClientApplication s_pca2;
+        private static IPublicClientApplication s_pcaFam1;
+        private static IPublicClientApplication s_pcaFam2;
+        private static IPublicClientApplication s_pcaNonFam;

         public static void Main(string[] args)
         {
-            s_pca1 = PublicClientApplicationBuilder
+            s_pcaFam1 = PublicClientApplicationBuilder
                 .Create(FAMILY_MEMBER_1)
                 .WithLogging(Log, LogLevel.Verbose, true)
                 .Build();

-            s_pca2 = PublicClientApplicationBuilder
+            s_pcaFam2 = PublicClientApplicationBuilder
                .Create(FAMILY_MEMBER_2)
                .WithLogging(Log, LogLevel.Verbose, true)
                .Build();

-
-            SetCacheSerializationToFile(s_pca1);
+            s_pcaNonFam = PublicClientApplicationBuilder
+             .Create(NON_FAMILY_MEMBER)
+             .WithLogging(Log, LogLevel.Verbose, true)
+             .Build();
+
+
+            SetCacheSerializationToFile(s_pcaFam1);
+            SetCacheSerializationToFile(s_pcaFam2);
+            SetCacheSerializationToFile(s_pcaNonFam);

             RunConsoleAppLogicAsync().Wait();
         }
@@ -95,15 +106,19 @@
             {
                 Console.Clear();

-                await DisplayAccountsAsync(s_pca1).ConfigureAwait(false);
+                await DisplayAccountsAsync(s_pcaFam1).ConfigureAwait(false);

                 // display menu
                 Console.WriteLine(@"
-                        1. Acquire Token App1
-                        2. Acquire Token App2
-                        3. Acquire Token Silent App1
-                        4. Acquire Token Silent App2
-                        5. Clear cache
+                        1. Acquire Token App1 (family member)
+                        2. Acquire Token App2 (family member)
+                        3. Acquire Token App3 (non-family member)
+                        4. Acquire Token Silent App1 (family member)
+                        5. Acquire Token Silent App2 (family member)
+                        6. Acquire Token Silent App3 (non-family member)
+
+
+                        7. Clear cache
                         0. Exit App
                     Enter your Selection: ");
                 int.TryParse(Console.ReadLine(), out var selection);
@@ -114,35 +129,47 @@
                 {
                     switch (selection)
                     {
-                        case 1:
-                            authTask = GetInteractiveAuthTaskAsync(s_pca1);
-                            FetchTokenAsync(s_pca2, authTask).GetAwaiter().GetResult();
-                            break;
-                        case 2:
-                            authTask = GetInteractiveAuthTaskAsync(s_pca2);
-                            FetchTokenAsync(s_pca2, authTask).GetAwaiter().GetResult();
-                            break;
-                        case 3:
-                            authTask = GetSilentAuthTaskAsync(s_pca1);
-                            FetchTokenAsync(s_pca1, authTask).GetAwaiter().GetResult();
-                            break;
-                        case 4:
-                            authTask = GetSilentAuthTaskAsync(s_pca2);
-                            FetchTokenAsync(s_pca2, authTask).GetAwaiter().GetResult();
-                            break;
-
-                        case 5:
-                            var accounts = await s_pca1.GetAccountsAsync().ConfigureAwait(false);
-                            foreach (var acc in accounts)
-                            {
-                                await s_pca1.RemoveAsync(acc).ConfigureAwait(false);
-                            }
-
-                            break;
-                        case 0:
-                            return;
-                        default:
-                            break;
+                    case 1:
+                        authTask = GetInteractiveAuthTaskAsync(s_pcaFam1);
+                        FetchTokenAsync(s_pcaNonFam, authTask).GetAwaiter().GetResult();
+                        break;
+                    case 2:
+                        authTask = GetInteractiveAuthTaskAsync(s_pcaFam2);
+                        FetchTokenAsync(s_pcaNonFam, authTask).GetAwaiter().GetResult();
+                        break;
+                    case 3:
+                        authTask = GetInteractiveAuthTaskAsync(s_pcaNonFam);
+                        FetchTokenAsync(s_pcaNonFam, authTask).GetAwaiter().GetResult();
+                        break;
+                    case 4:
+                        authTask = GetSilentAuthTaskAsync(s_pcaFam1);
+                        FetchTokenAsync(s_pcaFam1, authTask).GetAwaiter().GetResult();
+                        break;
+                    case 5:
+                        authTask = GetSilentAuthTaskAsync(s_pcaFam2);
+                        FetchTokenAsync(s_pcaNonFam, authTask).GetAwaiter().GetResult();
+                        break;
+                    case 6:
+                        authTask = GetSilentAuthTaskAsync(s_pcaNonFam);
+                        FetchTokenAsync(s_pcaNonFam, authTask).GetAwaiter().GetResult();
+                        break;
+
+                    case 7:
+                        var accounts1 = await s_pcaFam1.GetAccountsAsync().ConfigureAwait(false);
+                        var accounts2 = await s_pcaFam1.GetAccountsAsync().ConfigureAwait(false);
+                        var accounts3 = await s_pcaFam1.GetAccountsAsync().ConfigureAwait(false);
+
+
+                        foreach (var acc in accounts1)
+                        {
+                            await s_pcaFam1.RemoveAsync(acc).ConfigureAwait(false);
+                        }
+
+                        break;
+                    case 0:
+                        return;
+                    default:
+                        break;
                     }

                 }
@@ -162,9 +189,15 @@
             return pca.AcquireTokenInteractive(s_scopes, null).ExecuteAsync();
         }

-
         private static Task<AuthenticationResult> GetSilentAuthTaskAsync(IPublicClientApplication pca)
         {
+            // get all serialized accounts
+            // get all RTs WHERE rt.client == app.client OR app is part of family or unkown
+            // JOIN acounts and RTs ON homeAccountID
+
+            // A -> interactive auth -> account, RT1
+            // B -> GetAccounts -> NULL
+
             var accounts = pca.GetAccountsAsync().GetAwaiter().GetResult();
             if (accounts.Count() > 1)
             {
@@ -172,10 +205,10 @@
                 return null;
             }

-            return pca.AcquireTokenSilent(s_scopes, accounts.FirstOrDefault()).ExecuteAsync();
-        }
-
-
+            //return pca.AcquireTokenSilent(s_scopes, accounts.FirstOrDefault()).ExecuteAsync();
+            return pca.AcquireTokenSilent(s_scopes, "bogavril@microsoft.com").ExecuteAsync();
+
+        }

         private static async Task FetchTokenAsync(IPublicClientApplication pca, Task<AuthenticationResult> authTask)
         {
@@ -220,17 +253,17 @@

             switch (level)
             {
-                case LogLevel.Error:
-                    Console.ForegroundColor = ConsoleColor.Red;
-                    break;
-                case LogLevel.Warning:
-                    Console.ForegroundColor = ConsoleColor.Yellow;
-                    break;
-                case LogLevel.Verbose:
-                    Console.ForegroundColor = ConsoleColor.Gray;
-                    break;
-                default:
-                    break;
+            case LogLevel.Error:
+                Console.ForegroundColor = ConsoleColor.Red;
+                break;
+            case LogLevel.Warning:
+                Console.ForegroundColor = ConsoleColor.Yellow;
+                break;
+            case LogLevel.Verbose:
+                Console.ForegroundColor = ConsoleColor.Gray;
+                break;
+            default:
+                break;
             }

             Console.WriteLine($"{level} {message}");


mainline : fixing naming convention

mainline : fixing naming convention

--- mainline/SocketEngine/SocketBuffer.cs
+++ mainline/SocketEngine/SocketBuffer.cs
@@ -8,18 +8,18 @@
 {
     public class SocketBuffer
     {
-        private object mLocker = new object();
-        private Int32 mPageSize = 1024;
-        private Int32 mReadCursor = 0;
-        private Int32 mWriteCursor = 0;
-        private Int32 mLength = 0;
+        private object m_Locker = new object();
+        private Int32 m_PageSize = 1024;
+        private Int32 m_ReadCursor = 0;
+        private Int32 m_WriteCursor = 0;
+        private Int32 m_Length = 0;
         private List<byte[]> mPages = new List<byte[]>();

         /// Returns the length of valid content.
         public int Length
         {// No need to lock this field. It's updated when locked whenever this SocketBuffer changes.
-            get { return mLength; }
+            get { return m_Length; }
         }

         /// Creates new SocketBuffer object.
@@ -37,7 +37,7 @@
                 {
                     throw new ArgumentOutOfRangeException("Page size must be greater then 0");
                 }
-                mPageSize = pageSize;
+                m_PageSize = pageSize;
             }
             catch (Exception)
             {
@@ -53,7 +53,7 @@
         {
             try
             {
-                lock (mLocker)
+                lock (m_Locker)
                 {
                     if (data == null || length == 0)
                     {
@@ -62,19 +62,19 @@
                     int leftToWrite = length;
                     while (leftToWrite != 0)
                     {
-                        int currentPageIndex = mWriteCursor / mPageSize;
+                        int currentPageIndex = m_WriteCursor / m_PageSize;
                         if (currentPageIndex >= mPages.Count)
                         {
                             AddPage();
                         }
                         byte[] currentPage = mPages[currentPageIndex];
-                        int spaceInPage = mPageSize - (mWriteCursor % mPageSize);
+                        int spaceInPage = m_PageSize - (m_WriteCursor % m_PageSize);
                         int toWrite = Math.Min(leftToWrite, spaceInPage);
-                        Array.Copy(data, start, currentPage, (mWriteCursor % mPageSize), toWrite);
+                        Array.Copy(data, start, currentPage, (m_WriteCursor % m_PageSize), toWrite);
                         leftToWrite -= toWrite;
-                        mWriteCursor += toWrite;
+                        m_WriteCursor += toWrite;
                         start += toWrite;
-                        mLength = mWriteCursor - mReadCursor;
+                        m_Length = m_WriteCursor - m_ReadCursor;
                     }
                 }
             }
@@ -103,7 +103,7 @@
         {
             try
             {
-                lock (mLocker)
+                lock (m_Locker)
                 {
                     byte[] result = Peek(size);
                     Discard(size);
@@ -123,7 +123,7 @@
         {
             try
             {
-                lock (mLocker)
+                lock (m_Locker)
                 {
                     byte[] result = Peek(startIndex, size);
                     Discard(startIndex, size);
@@ -142,14 +142,14 @@
         {
             try
             {
-                lock (mLocker)
+                lock (m_Locker)
                 {
                     if (size > Length)
                     {
                         throw new ArgumentOutOfRangeException("Size is larger then buffer content");
                     }
-                    mReadCursor += size;
-                    mLength = mWriteCursor - mReadCursor;
+                    m_ReadCursor += size;
+                    m_Length = m_WriteCursor - m_ReadCursor;
                     Purge();
                 }
             }
@@ -166,14 +166,14 @@
         {
             try
             {
-                lock (mLocker)
+                lock (m_Locker)
                 {
                     if ((startIndex + size) > Length)
                     {
                         throw new ArgumentOutOfRangeException("Size is larger then buffer content");
                     }
-                    mReadCursor += startIndex + size;
-                    mLength = mWriteCursor - mReadCursor;
+                    m_ReadCursor += startIndex + size;
+                    m_Length = m_WriteCursor - m_ReadCursor;
                     Purge();
                 }
             }
@@ -191,22 +191,22 @@
         {
             try
             {
-                lock (mLocker)
+                lock (m_Locker)
                 {
                     if (size > Length)
                     {
                         throw new ArgumentOutOfRangeException("Size is larger then buffer content");
                     }
                     byte[] result = new byte[size];
-                    int readCursor = mReadCursor;
+                    int readCursor = m_ReadCursor;
                     int leftToRead = size;
                     while (leftToRead != 0)
                     {
-                        int currentPageIndex = readCursor / mPageSize;
+                        int currentPageIndex = readCursor / m_PageSize;
                         byte[] currentPage = mPages[currentPageIndex];
-                        int spaceInPage = mPageSize - (readCursor % mPageSize);
+                        int spaceInPage = m_PageSize - (readCursor % m_PageSize);
                         int toRead = Math.Min(leftToRead, spaceInPage);
-                        Array.Copy(currentPage, (readCursor % mPageSize), result, result.Length - leftToRead, toRead);
+                        Array.Copy(currentPage, (readCursor % m_PageSize), result, result.Length - leftToRead, toRead);
                         leftToRead -= toRead;
                         readCursor += toRead;
                     }
@@ -228,22 +228,22 @@
         {
             try
             {
-                lock (mLocker)
+                lock (m_Locker)
                 {
                     if (size > Length)
                     {
                         throw new ArgumentOutOfRangeException("Size is larger then buffer content");
                     }
                     byte[] result = new byte[size];
-                    int readCursor = mReadCursor + offset;
+                    int readCursor = m_ReadCursor + offset;
                     int leftToRead = size;
                     while (leftToRead != 0)
                     {
-                        int currentPageIndex = readCursor / mPageSize;
+                        int currentPageIndex = readCursor / m_PageSize;
                         byte[] currentPage = mPages[currentPageIndex];
-                        int spaceInPage = mPageSize - (readCursor % mPageSize);
+                        int spaceInPage = m_PageSize - (readCursor % m_PageSize);
                         int toRead = Math.Min(leftToRead, spaceInPage);
-                        Array.Copy(currentPage, (readCursor % mPageSize), result, result.Length - leftToRead, toRead);
+                        Array.Copy(currentPage, (readCursor % m_PageSize), result, result.Length - leftToRead, toRead);
                         leftToRead -= toRead;
                         readCursor += toRead;
                     }
@@ -261,11 +261,11 @@
         {
             try
             {
-                lock (mLocker)
-                {
-                    mReadCursor = 0;
-                    mWriteCursor = 0;
-                    mLength = 0;
+                lock (m_Locker)
+                {
+                    m_ReadCursor = 0;
+                    m_WriteCursor = 0;
+                    m_Length = 0;
                     mPages.Clear();
                 }
             }
@@ -279,9 +279,9 @@
         {
             try
             {
-                lock (mLocker)
-                {
-                    mPages.Add(new byte[mPageSize]);
+                lock (m_Locker)
+                {
+                    mPages.Add(new byte[m_PageSize]);
                 }
             }
             catch (Exception)
@@ -294,16 +294,16 @@
         {
             try
             {
-                lock (mLocker)
-                {
-                    int readPageIndex = mReadCursor / mPageSize;
+                lock (m_Locker)
+                {
+                    int readPageIndex = m_ReadCursor / m_PageSize;
                     while (readPageIndex > 0)
                     {
                         mPages.RemoveAt(0);
-                        mReadCursor -= mPageSize;
-                        mWriteCursor -= mPageSize;
-                        mLength = mWriteCursor - mReadCursor;
-                        readPageIndex = mReadCursor / mPageSize;
+                        m_ReadCursor -= m_PageSize;
+                        m_WriteCursor -= m_PageSize;
+                        m_Length = m_WriteCursor - m_ReadCursor;
+                        readPageIndex = m_ReadCursor / m_PageSize;
                     }
                 }
             }


Updates AgentManager Class inline documentation (98% complete) [documentation only, no code changes]

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

--- libsecondlife/AgentManager.cs
+++ libsecondlife/AgentManager.cs
@@ -1744,39 +1744,39 @@
         }

         /// <summary>
-        ///
-        /// </summary>
-        /// <param name="target"></param>
-        /// <param name="amount"></param>
-        /// <param name="objectName"></param>
+        /// Give L$ to an object
+        /// </summary>
+        /// <param name="target">object <seealso cref="libsecondlife.LLUUID"/> to give money to</param>
+        /// <param name="amount">amount of L$ to give</param>
+        /// <param name="objectName">name of object</param>
         public void GiveObjectMoney(LLUUID target, int amount, string objectName)
         {
             GiveMoney(target, amount, objectName, MoneyTransactionType.PayObject, TransactionFlags.None);
         }

         /// <summary>
-        ///
-        /// </summary>
-        /// <param name="target"></param>
-        /// <param name="amount"></param>
+        /// Give L$ to a group
+        /// </summary>
+        /// <param name="target">group <seealso cref="libsecondlife.LLUUID"/> to give money to</param>
+        /// <param name="amount">amount of L$ to give</param>
         public void GiveGroupMoney(LLUUID target, int amount)
         {
             GiveMoney(target, amount, String.Empty, MoneyTransactionType.Gift, TransactionFlags.DestGroup);
         }

         /// <summary>
-        ///
-        /// </summary>
-        /// <param name="target"></param>
-        /// <param name="amount"></param>
-        /// <param name="description"></param>
+        /// Give L$ to a group
+        /// </summary>
+        /// <param name="target">group <seealso cref="libsecondlife.LLUUID"/> to give money to</param>
+        /// <param name="amount">amount of L$ to give</param>
+        /// <param name="description">description of transaction</param>
         public void GiveGroupMoney(LLUUID target, int amount, string description)
         {
             GiveMoney(target, amount, description, MoneyTransactionType.Gift, TransactionFlags.DestGroup);
         }

         /// <summary>
-        ///
+        /// Pay texture/animation upload fee
         /// </summary>
         public void PayUploadFee()
         {
@@ -1785,9 +1785,9 @@
         }

         /// <summary>
-        ///
-        /// </summary>
-        /// <param name="description"></param>
+        /// Pay texture/animation upload fee
+        /// </summary>
+        /// <param name="description">description of the transaction</param>
         public void PayUploadFee(string description)
         {
             GiveMoney(LLUUID.Zero, Client.Settings.UPLOAD_COST, description, MoneyTransactionType.UploadCharge,
@@ -1827,7 +1827,7 @@
         /// <summary>
         /// Send an AgentAnimation packet that toggles a single animation on
         /// </summary>
-        /// <param name="animation">The animation to start playing</param>
+        /// <param name="animation">The <seealso cref="libsecondlife.LLUUID"/> of the animation to start playing</param>
         /// <param name="reliable">Whether to ensure delivery of this packet or not</param>
         public void AnimationStart(LLUUID animation, bool reliable)
         {
@@ -1840,7 +1840,8 @@
         /// <summary>
         /// Send an AgentAnimation packet that toggles a single animation off
         /// </summary>
-        /// <param name="animation">The animation to stop playing</param>
+        /// <param name="animation">The <seealso cref="libsecondlife.LLUUID"/> of a
+        /// currently playing animation to stop playing</param>
         /// <param name="reliable">Whether to ensure delivery of this packet or not</param>
         public void AnimationStop(LLUUID animation, bool reliable)
         {
@@ -1853,7 +1854,7 @@
         /// <summary>
         /// Send an AgentAnimation packet that will toggle animations on or off
         /// </summary>
-        /// <param name="animations">A list of animation UUIDs, and whether to
+        /// <param name="animations">A list of animation <seealso cref="libsecondlife.LLUUID"/>s, and whether to
         /// turn that animation on or off</param>
         /// <param name="reliable">Whether to ensure delivery of this packet or not</param>
         public void Animate(Dictionary<LLUUID, bool> animations, bool reliable)
@@ -1883,14 +1884,18 @@
         #region Teleporting

         /// <summary>
-        /// Teleports the avatar home
+        /// Teleports agent to their stored home location
         /// </summary>
         public bool GoHome()
         {
             return Teleport(LLUUID.Zero);
         }

-		/// <summary>Attempt teleport to specified LLUUID</summary>
+		/// <summary>
+		/// Teleport agent to a landmark
+		/// </summary>
+		/// <param name="landmark"><seealso cref="libsecondlife.LLUUID"/> of the landmark to teleport agent to</param>
+		/// <returns>true on success, false on failure</returns>
 		public bool Teleport(LLUUID landmark)
 		{
 			teleportStat = TeleportStatus.None;
@@ -1966,23 +1971,25 @@
         }

         /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
-        /// <returns></returns>
+        /// Teleport agent to another region
+        /// </summary>
+        /// <param name="regionHandle">handle of region to teleport agent to</param>
+        /// <param name="position"><seealso cref="libsecondlife.LLVector3"/> position in destination sim to teleport to</param>
+        /// <returns>true on success, false on failure</returns>
+        /// <remarks>This call is blocking</remarks>
         public bool Teleport(ulong regionHandle, LLVector3 position)
         {
             return Teleport(regionHandle, position, new LLVector3(0.0f, 1.0f, 0.0f));
         }

         /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
-        /// <param name="lookAt">Target to look at</param>
-        /// <returns></returns>
+        /// Teleport agent to another region
+        /// </summary>
+        /// <param name="regionHandle">handle of region to teleport agent to</param>
+        /// <param name="position"><seealso cref="libsecondlife.LLVector3"/> position in destination sim to teleport to</param>
+        /// <param name="lookAt"><seealso cref="libsecondlife.LLVector3"/> direction in destination sim agent will look at</param>
+        /// <returns>true on success, false on failure</returns>
+        /// <remarks>This call is blocking</remarks>
         public bool Teleport(ulong regionHandle, LLVector3 position, LLVector3 lookAt)
         {
             teleportStat = TeleportStatus.None;
@@ -2004,21 +2011,21 @@
         }

         /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
+        /// Request teleport to a another simulator
+        /// </summary>
+        /// <param name="regionHandle">handle of region to teleport agent to</param>
+        /// <param name="position"><seealso cref="libsecondlife.LLVector3"/> position in destination sim to teleport to</param>
         public void RequestTeleport(ulong regionHandle, LLVector3 position)
         {
             RequestTeleport(regionHandle, position, new LLVector3(0.0f, 1.0f, 0.0f));
         }

         /// <summary>
-        /// Start a teleport process
-        /// </summary>
-        /// <param name="regionHandle"></param>
-        /// <param name="position">Position for Teleport</param>
-        /// <param name="lookAt">Target to look at</param>
+        /// Request teleport to a another simulator
+        /// </summary>
+        /// <param name="regionHandle">handle of region to teleport agent to</param>
+        /// <param name="position"><seealso cref="libsecondlife.LLVector3"/> position in destination sim to teleport to</param>
+        /// <param name="lookAt"><seealso cref="libsecondlife.LLVector3"/> direction in destination sim agent will look at</param>
         public void RequestTeleport(ulong regionHandle, LLVector3 position, LLVector3 lookAt)
         {
             if (Client.Network.CurrentSim != null &&
@@ -2044,11 +2051,20 @@
             }
         }

+        /// <summary>
+        /// Send a teleport lure to another avatar with default "Join me in ..." invitation message
+        /// </summary>
+        /// <param name="targetID">target avatars <seealso cref="libsecondlife.LLUUID"/> to lure</param>
         public void SendTeleportLure(LLUUID targetID)
         {
             SendTeleportLure(targetID, "Join me in " + Client.Network.CurrentSim.Name + "!");
         }

+        /// <summary>
+        /// Send a teleport lure to another avatar with custom invitation message
+        /// </summary>
+        /// <param name="targetID">target avatars <seealso cref="libsecondlife.LLUUID"/> to lure</param>
+        /// <param name="message">custom message to send with invitation</param>
         public void SendTeleportLure(LLUUID targetID, string message)
         {
             StartLurePacket p = new StartLurePacket();
@@ -2065,8 +2081,8 @@
         /// Respond to a teleport lure by either accepting it and initiating
         /// the teleport, or denying it
         /// </summary>
-        /// <param name="requesterID">UUID of the avatar requesting the teleport</param>
-        /// <param name="accept">Accept the teleport request or deny it</param>
+        /// <param name="requesterID"><seealso cref="libsecondlife.LLUUID"/> of the avatar sending the lure</param>
+        /// <param name="accept">true to accept the lure, false to decline it</param>
         public void TeleportLureRespond(LLUUID requesterID, bool accept)
         {
             InstantMessage(Name, requesterID, String.Empty, LLUUID.Random(),
@@ -2091,9 +2107,10 @@
         #region Misc

         /// <summary>
-        ///
-        /// </summary>
-        /// <param name="profile"></param>
+        /// Update agent profile
+        /// </summary>
+        /// <param name="profile"><seealso cref="libsecondlife.Avatar.AvatarProperties"/> struct containing updated
+        /// profile information</param>
         public void UpdateProfile(Avatar.AvatarProperties profile)
         {
             AvatarPropertiesUpdatePacket apup = new AvatarPropertiesUpdatePacket();
@@ -2111,9 +2128,9 @@
         }

         /// <summary>
-        ///
-        /// </summary>
-        /// <param name="interests"></param>
+        /// Update agents profile interests
+        /// </summary>
+        /// <param name="interests">selection of interests from <seealso cref="T:libsecondlife.Avatar.Interests"/> struct</param>
         public void UpdateInterests(Avatar.Interests interests)
         {
             AvatarInterestsUpdatePacket aiup = new AvatarInterestsUpdatePacket();
@@ -2148,7 +2165,7 @@
         }

         /// <summary>
-        /// Request the list of muted things for this avatar
+        /// Request the list of muted objects and avatars for this agent
         /// </summary>
         public void RequestMuteList()
         {
@@ -2161,8 +2178,10 @@
         }

         /// <summary>
-        /// Sets home location
-        /// </summary>
+        /// Sets home location to agents current position
+        /// </summary>
+        /// <remarks>will fire an AlertMessage (<seealso cref="E:libsecondlife.AgentManager.OnAlertMessage"/>) with
+        /// success or failure message</remarks>
         public void SetHome()
         {
             SetStartLocationRequestPacket s = new SetStartLocationRequestPacket();
@@ -2181,7 +2200,7 @@
         /// Move an agent in to a simulator. This packet is the last packet
         /// needed to complete the transition in to a new simulator
         /// </summary>
-        /// <param name="simulator"></param>
+        /// <param name="simulator"><seealso cref="T:libsecondlife.Simulator"/> Object</param>
         public void CompleteAgentMovement(Simulator simulator)
         {
             CompleteAgentMovementPacket move = new CompleteAgentMovementPacket();
@@ -2196,10 +2215,10 @@
         /// <summary>
         /// Reply to script permissions request
         /// </summary>
-        /// <param name="simulator"></param>
-        /// <param name="itemID"></param>
-        /// <param name="taskID"></param>
-        /// <param name="permissions"></param>
+        /// <param name="simulator"><seealso cref="T:libsecondlife.Simulator"/> Object</param>
+        /// <param name="itemID"><seealso cref="libsecondlife.LLUUID"/> of the itemID requesting permissions</param>
+        /// <param name="taskID"><seealso cref="libsecondlife.LLUUID"/> of the taskID requesting permissions</param>
+        /// <param name="permissions"><seealso cref="libsecondlife.ScriptPermission"/> list of permissions to allow</param>
         public void ScriptQuestionReply(Simulator simulator, LLUUID itemID, LLUUID taskID, ScriptPermission permissions)
         {
             ScriptAnswerYesPacket yes = new ScriptAnswerYesPacket();


fixes Inverted Color and Transparency issue in TextureEntry. Please report any other behavior changes related to texture colors and transparencies in Mantis. See #237, Patch courtesy of timhart

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@1774 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife/TextureEntry.cs
+++ libsecondlife/TextureEntry.cs
@@ -672,12 +672,12 @@
                 #endregion Texture

                 #region Color
-                DefaultTexture.RGBA = new LLColor(data, i, true);
+                DefaultTexture.RGBA = new LLColor(data, i, false);
                 i += 4;

                 while (ReadFaceBitfield(data, ref i, ref faceBits, ref bitfieldSize))
                 {
-                    LLColor tmpColor = new LLColor(data, i, true);
+                    LLColor tmpColor = new LLColor(data, i, false);
                     i += 4;

                     for (uint face = 0, bit = 1; face < bitfieldSize; face++, bit <<= 1)


Update Courses.cs

Update Courses.cs

--- courses/Courses.cs
+++ courses/Courses.cs
@@ -122,7 +122,7 @@
 		public object StartDate { get; set; }
 		[JsonProperty("end_date")]
 		public object EndDate { get; set; }
-		[JsonProperty("_tba")]
+		[JsonProperty("is_tba")]
 		public bool IsTba { get; set; }
 		[JsonProperty("is_cancelled")]
 		public bool IsCancelled { get; set; }


Do not generate using xxx = yyy for typedef enum yyy { ... } xxx. Fix const args.

- usings for enums prevented valid code by generating duplicate identifiers.
- const foobar types were not caught as primitives.

--- samples/PInvokeGenerator/Program.cs
+++ samples/PInvokeGenerator/Program.cs
@@ -95,7 +95,9 @@
 							InsideUsingDeclaration = true;
 							if (usings.All (u => u.Alias != alias)) {
 								var actual = ToTypeName (cursor.TypeDefDeclUnderlyingType);
-								if (cursor.TypeDefDeclUnderlyingType.ArraySize < 0)
+								if (cursor.TypeDefDeclUnderlyingType.Kind == TypeKind.Enum)
+									TextWriter.Null.WriteLine ("Enum not being aliased."); // do nothing
+								else if (cursor.TypeDefDeclUnderlyingType.ArraySize < 0)
 									usings.Add (new TypeDef () { Alias = alias, Actual = actual });
 								else
 									usings.Add (new TypeDef () { Alias = alias, Actual = $"System.IntPtr/*{actual}*/" }); // array
@@ -402,33 +404,32 @@
 		string ToTypeName_ (ClangType type, bool strip = true)
 		{
 			if (type.IsPODType) {
-				switch (type.Spelling) {
-				case "unsigned char":
+				switch (type.Kind) {
+				case TypeKind.Int:
+					return "int"; // FIXME: this should be actually platform dependent
+				case TypeKind.UInt:
+					return "uint"; // FIXME: this should be actually platform dependent
+				case TypeKind.Float:
+					return "float";
+				case TypeKind.Double:
+					return "double";
+				case TypeKind.UChar:
+				case TypeKind.CharU:
 					return "byte";
-				case "char":
-					return "byte"; // we most likely don't need sbyte
-				case "signed char":
+				case TypeKind.CharS:
 					return "sbyte"; // probably explicit signed specification means something
-				case "short":
+				case TypeKind.Short:
 					return "short";
-				case "unsigned short":
+				case TypeKind.UShort:
 					return "ushort";
-				case "long":
+				case TypeKind.Long:
 					return "long"; // FIXME: this should be actually platform dependent
-				case "long long":
+				case TypeKind.ULong:
+					return "ulong"; // FIXME: this should be actually platform dependent
+				case TypeKind.LongLong:
 					return "/*FIXME: this was long long*/long"; // FIXME: this should be actually platform dependent
-				case "unsigned long":
-					return "ulong"; // FIXME: this should be actually platform dependent
-				case "unsigned long long":
+				case TypeKind.ULongLong:
 					return "/*FIXME: this was unsigned long long*/ulong"; // FIXME: this should be actually platform dependent
-				case "int":
-					return "int"; // FIXME: this should be actually platform dependent
-				case "unsigned int":
-					return "uint"; // FIXME: this should be actually platform dependent
-				case "float":
-					return "float";
-				case "double":
-					return "double";
 				}
 				// for aliased types to POD they still have IsPODType = true, so we need to ignore them.
 			}


Added support for nested namespaces in Namespace.cs.

--- src/Bridge/Namespace.cs
+++ src/Bridge/Namespace.cs
@@ -8,6 +8,15 @@
 	/// </summary>
 	public class Namespace
 	{
+		public string Name { get; set; }
+		public Namespace Parent { get; set; }
+		public bool IsAnonymous { get; set; }
+
+		public List<Namespace> Namespaces;
+		public List<Enumeration> Enums;
+		public List<Function> Functions;
+		public List<Class> Classes;
+
 		public Namespace()
 			: this(null, String.Empty)
 		{
@@ -19,42 +28,53 @@
 			Parent = parent;
 			IsAnonymous = isAnonymous;

+			Namespaces = new List<Namespace>();
 			Enums = new List<Enumeration>();
 			Functions = new List<Function>();
 			Classes = new List<Class>();
 		}

-		public Enumeration FindEnum(string Name)
+		public Namespace FindNamespace(string name)
 		{
-			return FindEnumWithName(Name);
+			return Namespaces.Find(e => e.Name.Equals(name));
 		}

-		public Function FindFunction(string Name)
+		public Enumeration FindEnum(string name)
 		{
-			return Functions.Find(e => e.Name.Equals(Name));
+			return Enums.Find(e => e.Name.Equals(name));
 		}

-		public Class FindClass(string Name)
+		public Function FindFunction(string name)
 		{
-			return Classes.Find(e => e.Name.Equals(Name));
+			return Functions.Find(e => e.Name.Equals(name));
 		}

-		public T FindType<T>(string Name) where T : Declaration
+		public Class FindClass(string name, bool create = false)
 		{
-			var type = FindEnumWithName(Name)
-				?? FindFunction(Name) ?? (Declaration)FindClass(Name);
+			Class @class = Classes.Find(e => e.Name.Equals(name));
+
+			if (@class == null && create)
+			{
+				@class = new Class();
+				@class.Name = name;
+
+				Classes.Add(@class);
+			}
+
+			return @class;
+		}
+
+		public T FindType<T>(string name) where T : Declaration
+		{
+			var type = FindEnum(name)
+				?? FindFunction(name) ?? (Declaration)FindClass(name);

 			return type as T;
 		}

-		public Enumeration FindEnumWithName(string Name)
+		public Enumeration FindEnumWithItem(string name)
 		{
-			return Enums.Find(e => e.Name.Equals(Name));
-		}
-
-		public Enumeration FindEnumWithItem(string Name)
-		{
-			return Enums.Find(e => e.ItemsByName.ContainsKey(Name));
+			return Enums.Find(e => e.ItemsByName.ContainsKey(name));
 		}

 		public bool HasDeclarations
@@ -62,7 +82,8 @@
 			get
 			{
 				Predicate<Declaration> pred = (t => !t.Ignore);
-				return Enums.Exists(pred) || HasFunctions || Classes.Exists(pred);
+				return Enums.Exists(pred) || HasFunctions
+					|| Classes.Exists(pred) || Namespaces.Exists(n => n.HasDeclarations);
 			}
 		}

@@ -71,16 +92,8 @@
 			get
 			{
 				Predicate<Declaration> pred = (t => !t.Ignore);
-				return Functions.Exists(pred);
+				return Functions.Exists(pred) || Namespaces.Exists(n => n.HasFunctions);
 			}
 		}
-
-		public string Name { get; set; }
-		public Namespace Parent { get; set; }
-		public bool IsAnonymous { get; set; }
-
-		public List<Enumeration> Enums;
-		public List<Function> Functions;
-		public List<Class> Classes;
 	}
 }


default opening file

default opening file


Used new Enumerate() extension method in EnumHelper.AllValues.


Aligning FirefoxProfile with r10135

Aligning FirefoxProfile with r10135

git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@10140 07704840-8298-11de-bf8c-fd130f914ac9

--- firefox/src/csharp/webdriver-firefox/FirefoxProfile.cs
+++ firefox/src/csharp/webdriver-firefox/FirefoxProfile.cs
@@ -240,6 +240,7 @@
             AddDefaultPreference(prefs, "browser.tabs.warnOnClose", "false");
             AddDefaultPreference(prefs, "browser.tabs.warnOnOpen", "false");
             AddDefaultPreference(prefs, "dom.disable_open_during_load", "false");
+			AddDefaultPreference(prefs, "dom.max_script_run_time", "30");
             AddDefaultPreference(prefs, "extensions.update.enabled", "false");
             AddDefaultPreference(prefs, "extensions.update.notifyUser", "false");
             AddDefaultPreference(prefs, "network.manage-offline-status", "false");
@@ -256,6 +257,7 @@
             AddDefaultPreference(prefs, "security.warn_viewing_mixed.show_once", "false");
             AddDefaultPreference(prefs, "signon.rememberSignons", "false");
             AddDefaultPreference(prefs, "startup.homepage_welcome_url", "\"about:blank\"");
+			AddDefaultPreference(prefs, "toolkit.networkmanager.disable", "true");

             // Which port should we listen on?
             AddDefaultPreference(prefs, "webdriver_firefox_port", profilePort.ToString(CultureInfo.InvariantCulture));


:jeans: :ghost:  调整代码结构。 :rabbit:

:jeans: :ghost:  调整代码结构。 :rabbit:

--- src/Data/DataService.cs
+++ src/Data/DataService.cs
@@ -41,49 +41,29 @@
 		#endregion

 		#region 构造函数
-		public DataService(IDataAccess dataAccess)
-		{
-			if(dataAccess == null)
-				throw new ArgumentNullException("dataAccess");
-
-			_dataAccess = dataAccess;
-		}
-
-		public DataService(string name, IDataAccess dataAccess)
+		public DataService(Zongsoft.Services.IServiceProvider serviceProvider)
+		{
+			if(serviceProvider == null)
+				throw new ArgumentNullException("serviceProvider");
+
+			_serviceProvider = serviceProvider;
+		}
+
+		public DataService(string name, Zongsoft.Services.IServiceProvider serviceProvider)
 		{
 			if(string.IsNullOrWhiteSpace(name))
 				throw new ArgumentNullException("name");

-			if(dataAccess == null)
-				throw new ArgumentNullException("dataAccess");
-
-			_name = name.Trim();
-			_dataAccess = dataAccess;
-		}
-
-		public DataService(Zongsoft.Services.IServiceProvider serviceProvider)
-		{
 			if(serviceProvider == null)
 				throw new ArgumentNullException("serviceProvider");

-			_serviceProvider = serviceProvider;
-		}
-
-		public DataService(string name, Zongsoft.Services.IServiceProvider serviceProvider)
-		{
-			if(string.IsNullOrWhiteSpace(name))
-				throw new ArgumentNullException("name");
-
-			if(serviceProvider == null)
-				throw new ArgumentNullException("serviceProvider");
-
 			_name = name.Trim();
 			_serviceProvider = serviceProvider;
 		}
 		#endregion

 		#region 公共属性
-		public virtual string Name
+		public string Name
 		{
 			get
 			{
@@ -95,25 +75,32 @@

 				return _name;
 			}
-		}
-
-		public virtual IDataAccess DataAccess
+			protected set
+			{
+				if(string.IsNullOrWhiteSpace(value))
+					throw new ArgumentNullException();
+
+				_name = value.Trim();
+			}
+		}
+
+		[Zongsoft.Services.ServiceDependency]
+		public IDataAccess DataAccess
 		{
 			get
 			{
-				if(_dataAccess == null)
-				{
-					var serviceProvider = this.ServiceProvider;
-
-					if(serviceProvider != null)
-						_dataAccess = serviceProvider.Resolve<IDataAccess>();
-				}
-
 				return _dataAccess;
 			}
-		}
-
-		public virtual Zongsoft.Services.IServiceProvider ServiceProvider
+			set
+			{
+				if(value == null)
+					throw new ArgumentNullException();
+
+				_dataAccess = value;
+			}
+		}
+
+		public Zongsoft.Services.IServiceProvider ServiceProvider
 		{
 			get
 			{
@@ -121,6 +108,9 @@
 			}
 			set
 			{
+				if(value == null)
+					throw new ArgumentNullException();
+
 				_serviceProvider = value;
 			}
 		}


Fixed bug 880809

Fixed bug 880809

--- yafsrc/pages/posts.ascx.cs
+++ yafsrc/pages/posts.ascx.cs
@@ -290,6 +290,7 @@
 						if((int)dt[foundRow]["MessageID"] == nFindMessage)
 						{
 							pds.CurrentPageIndex = foundRow / pds.PageSize;
+							Pager.CurrentPageIndex = pds.CurrentPageIndex;
 							break;
 						}
 					}


fix bug

fix bug


Added compatibility query and improved stuff

--- nUpdate.Administration/UI/Dialogs/ProjectImportDialog.cs
+++ nUpdate.Administration/UI/Dialogs/ProjectImportDialog.cs
@@ -96,7 +96,41 @@
                 try
                 {
                     string folderPath = Path.Combine(Program.Path, "ImpProj");
+                    string statisticsFilePath = Path.Combine(folderPath, "statistics.php");
+                    string projectFilePath = Path.Combine(folderPath,
+                        String.Format("{0}.nupdproj", projectNameTextBox.Text));
                     Directory.CreateDirectory(folderPath);
+
+                    var updateProject = UpdateProject.LoadProject(projectFilePath);
+                    if (updateProject.UseStatistics)
+                    {
+                        Popup.ShowPopup(this, SystemIcons.Warning, "Incompatible project.", "This project cannot be imported because the support for projects using statistics is currently missing. It will be available in the next version(s) of nUpdate Administration.", PopupButtons.Ok);
+                        Directory.Delete(folderPath);
+                        return;
+                    }
+
+                    //if (updateProject.ConfigVersion != "3b2")
+                    //{
+                    //    Popup.ShowPopup(this, SystemIcons.Warning, "Incompatible project.", "This project is not compatible to this version of nUpdate Administration. Please download the newest version of nUpdate Administration and then export the project again.", PopupButtons.Ok);
+                    //    Directory.Delete(folderPath);
+                    //    return;
+                    //}
+
+                    updateProject.Path = projectFilePathTextBox.Text;
+                    //if (updateProject.UseStatistics)
+                    //{
+                    //    var statisticsServers = Serializer.Deserialize<List<StatisticsServer>>(Path.Combine(Program.Path, "statservers.json"));
+                    //    if (!statisticsServers.Any(item => item.WebUrl == updateProject.SqlWebUrl && item.DatabaseName == updateProject.SqlDatabaseName && item.Username == updateProject.SqlUsername))
+                    //    {
+                    //        if (Popup.ShowPopup(this, SystemIcons.Information, "New statistics server found.", "This project uses a statistics server that isn't currently available on this computer. Should nUpdate Administration add this server to your list?", PopupButtons.YesNo) == DialogResult.Yes)
+                    //        {
+                    //            statisticsServers.Add(new StatisticsServer(updateProject.SqlWebUrl, updateProject.SqlDatabaseName, updateProject.SqlUsername));
+                    //            File.WriteAllText(Path.Combine(Program.Path, "statservers.json"), Serializer.Serialize(statisticsServers));
+                    //        }
+                    //    }
+                    //}
+
+                    UpdateProject.SaveProject(updateProject.Path, updateProject);

                     string projectPath = Path.Combine(Program.Path, "Projects", projectNameTextBox.Text);
                     if (!Directory.Exists(projectPath))
@@ -107,16 +141,9 @@
                         zip.ExtractAll(folderPath);
                     }

-                    string statisticsFilePath = Path.Combine(folderPath, "statistics.php");
                     if (File.Exists(statisticsFilePath))
                         File.Move(statisticsFilePath, Path.Combine(projectPath, "statistics.php"));
-                    string projectFilePath = Path.Combine(folderPath,
-                        String.Format("{0}.nupdproj", projectNameTextBox.Text));
                     File.Move(projectFilePath, projectFilePathTextBox.Text);
-
-                    var updateProject = UpdateProject.LoadProject(projectFilePathTextBox.Text);
-                    updateProject.Path = projectFilePathTextBox.Text;
-                    UpdateProject.SaveProject(updateProject.Path, updateProject);

                     foreach (var versionDirectory in new DirectoryInfo(folderPath).GetDirectories())
                     {


Allow mac for EncryptedString

Allow mac for EncryptedString

--- src/Api/Utilities/EncryptedValueAttribute.cs
+++ src/Api/Utilities/EncryptedValueAttribute.cs
@@ -28,7 +28,7 @@
                 }

                 var encStringPieces = encString.Split('|');
-                if(encStringPieces.Length != 2)
+                if(encStringPieces.Length != 2 && encStringPieces.Length != 3)
                 {
                     return false;
                 }
@@ -40,6 +40,15 @@
                 {
                     return false;
                 }
+
+                if(encStringPieces.Length == 3)
+                {
+                    var mac = Convert.FromBase64String(encStringPieces[2]);
+                    if(mac.Length < 1)
+                    {
+                        return false;
+                    }
+                }
             }
             catch
             {


wrap file body stream in using block

wrap file body stream in using block

--- src/Api/Utilities/MultipartFormDataHelper.cs
+++ src/Api/Utilities/MultipartFormDataHelper.cs
@@ -27,12 +27,14 @@
             var fileNumber = 1;
             while(section != null && fileNumber <= fileCount)
             {
-                ContentDispositionHeaderValue content;
-                if(ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out content) &&
+                if(ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out var content) &&
                     HasFileContentDisposition(content))
                 {
                     var fileName = HeaderUtilities.RemoveQuotes(content.FileName) ?? string.Empty;
-                    await callback(section.Body, fileName);
+                    using(section.Body)
+                    {
+                        await callback(section.Body, fileName);
+                    }
                 }

                 if(fileNumber >= fileCount)


Fixed typo

Fixed typo

--- .build/version.cake
+++ .build/version.cake
@@ -67,7 +67,7 @@
     {
       Version = version,
       SemVersion = semVersion,
-      FullSemVer = fullSemVersion,
+      FullSemVersion = fullSemVersion,
       DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'),
       Milestone = milestone,
       CakeVersion = cakeVersion


Remove another unnecessary override

Remove another unnecessary override

--- osu.Framework.Tests/Visual/Containers/TestSceneSizing.cs
+++ osu.Framework.Tests/Visual/Containers/TestSceneSizing.cs
@@ -1163,10 +1163,6 @@
             Position += e.Delta;
         }

-        protected override void OnDragEnd(DragEndEvent e)
-        {
-        }
-
         protected override bool OnDragStart(DragStartEvent e) => AllowDrag;

         public InfofulBox()


Fix frame count dependent tests regressing

--- osu.Game.Rulesets.Mania.Tests/TestSceneAutoGeneration.cs
+++ osu.Game.Rulesets.Mania.Tests/TestSceneAutoGeneration.cs
@@ -16,6 +16,11 @@
     [HeadlessTest]
     public class TestSceneAutoGeneration : OsuTestScene
     {
+        /// <summary>
+        /// The number of frames which are generated at the start of a replay regardless of hitobject content.
+        /// </summary>
+        private const int frame_offset = 2;
+
         [Test]
         public void TestSingleNote()
         {
@@ -28,11 +33,11 @@

             var generated = new ManiaAutoGenerator(beatmap).Generate();

-            Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
-            Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
-            Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
-            Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Special1), "Special1 has not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Special1), "Special1 has not been released");
+            Assert.IsTrue(generated.Frames.Count == frame_offset + 2, "Replay must have 3 frames");
+            Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect hit time");
+            Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Special1), "Special1 has not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Special1), "Special1 has not been released");
         }

         [Test]
@@ -49,11 +54,11 @@

             var generated = new ManiaAutoGenerator(beatmap).Generate();

-            Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
-            Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
-            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
-            Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Special1), "Special1 has not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Special1), "Special1 has not been released");
+            Assert.IsTrue(generated.Frames.Count == frame_offset + 2, "Replay must have 3 frames");
+            Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect hit time");
+            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Special1), "Special1 has not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Special1), "Special1 has not been released");
         }

         [Test]
@@ -69,11 +74,11 @@

             var generated = new ManiaAutoGenerator(beatmap).Generate();

-            Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
-            Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
-            Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
-            Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
+            Assert.IsTrue(generated.Frames.Count == frame_offset + 2, "Replay must have 3 frames");
+            Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect hit time");
+            Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
         }

         [Test]
@@ -91,11 +96,13 @@

             var generated = new ManiaAutoGenerator(beatmap).Generate();

-            Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
-            Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
-            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
-            Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
+            Assert.IsTrue(generated.Frames.Count == frame_offset + 2, "Replay must have 3 frames");
+
+            Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect hit time");
+            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
+
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
         }

         [Test]
@@ -112,15 +119,15 @@

             var generated = new ManiaAutoGenerator(beatmap).Generate();

-            Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames");
-            Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
-            Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect first note release time");
-            Assert.AreEqual(2000, generated.Frames[3].Time, "Incorrect second note hit time");
-            Assert.AreEqual(2000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time");
-            Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1), "Key1 has not been released");
-            Assert.IsTrue(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[4], ManiaAction.Key2), "Key2 has not been released");
+            Assert.IsTrue(generated.Frames.Count == frame_offset + 4, "Replay must have 4 generated frames");
+            Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect first note hit time");
+            Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 1].Time, "Incorrect first note release time");
+            Assert.AreEqual(2000, generated.Frames[frame_offset + 2].Time, "Incorrect second note hit time");
+            Assert.AreEqual(2000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 3].Time, "Incorrect second note release time");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Key1), "Key1 has not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key1), "Key1 has not been released");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset + 2], ManiaAction.Key2), "Key2 has not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 3], ManiaAction.Key2), "Key2 has not been released");
         }

         [Test]
@@ -139,16 +146,16 @@

             var generated = new ManiaAutoGenerator(beatmap).Generate();

-            Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames");
-            Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
-            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect first note release time");
-            Assert.AreEqual(2000, generated.Frames[2].Time, "Incorrect second note hit time");
-            Assert.AreEqual(4000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time");
-            Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
-            Assert.IsTrue(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[3], ManiaAction.Key1), "Key1 has not been released");
-            Assert.IsTrue(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has been released");
-            Assert.IsFalse(checkContains(generated.Frames[4], ManiaAction.Key2), "Key2 has not been released");
+            Assert.IsTrue(generated.Frames.Count == frame_offset + 4, "Replay must have 4 generated frames");
+            Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect first note hit time");
+            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 2].Time, "Incorrect first note release time");
+            Assert.AreEqual(2000, generated.Frames[frame_offset + 1].Time, "Incorrect second note hit time");
+            Assert.AreEqual(4000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 3].Time, "Incorrect second note release time");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Key1), "Key1 has not been pressed");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 2], ManiaAction.Key1), "Key1 has not been released");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset + 2], ManiaAction.Key2), "Key2 has been released");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 3], ManiaAction.Key2), "Key2 has not been released");
         }

         [Test]
@@ -166,14 +173,14 @@

             var generated = new ManiaAutoGenerator(beatmap).Generate();

-            Assert.IsTrue(generated.Frames.Count == 4, "Replay must have 4 frames");
-            Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
-            Assert.AreEqual(3000, generated.Frames[2].Time, "Incorrect second note press time + first note release time");
-            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect second note release time");
-            Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1), "Key1 has not been released");
-            Assert.IsTrue(checkContains(generated.Frames[2], ManiaAction.Key2), "Key2 has not been pressed");
-            Assert.IsFalse(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has not been released");
+            Assert.IsTrue(generated.Frames.Count == frame_offset + 3, "Replay must have 3 generated frames");
+            Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect first note hit time");
+            Assert.AreEqual(3000, generated.Frames[frame_offset + 1].Time, "Incorrect second note press time + first note release time");
+            Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 2].Time, "Incorrect second note release time");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Key1), "Key1 has not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key1), "Key1 has not been released");
+            Assert.IsTrue(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key2), "Key2 has not been pressed");
+            Assert.IsFalse(checkContains(generated.Frames[frame_offset + 2], ManiaAction.Key2), "Key2 has not been released");
         }

         private bool checkContains(ReplayFrame frame, params ManiaAction[] actions) => actions.All(action => ((ManiaReplayFrame)frame).Actions.Contains(action));


Fix spinner centre size being updated every frame using transforms

--- osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerDisc.cs
+++ osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerDisc.cs
@@ -2,7 +2,6 @@
 // See the LICENCE file in the repository root for full licence text.

 using System;
-using System.Diagnostics;
 using osu.Framework.Allocation;
 using osu.Framework.Bindables;
 using osu.Framework.Extensions.ObjectExtensions;
@@ -138,6 +137,8 @@
             updateStateTransforms(drawableSpinner, drawableSpinner.State.Value);
         }

+        private float trackingElementInterpolation;
+
         protected override void Update()
         {
             base.Update();
@@ -157,11 +158,12 @@
             }
             else
             {
-                fill.Alpha = (float)Interpolation.Damp(fill.Alpha, drawableSpinner.RotationTracker.Tracking ? tracking_alpha : idle_alpha, 0.98f, (float)Math.Abs(Clock.ElapsedFrameTime));
-            }
-
-            if (centre.Width == idle_centre_size && drawableSpinner.Result?.TimeStarted != null)
-                updateCentrePieceSize();
+                trackingElementInterpolation =
+                    (float)Interpolation.Damp(trackingElementInterpolation, drawableSpinner.RotationTracker.Tracking ? 1 : 0, 0.985f, (float)Math.Abs(Clock.ElapsedFrameTime));
+
+                fill.Alpha = trackingElementInterpolation * (tracking_alpha - idle_alpha) + idle_alpha;
+                centre.Size = new Vector2(trackingElementInterpolation * (tracking_centre_size - idle_centre_size) + idle_centre_size);
+            }

             const float initial_fill_scale = 0.1f;
             float targetScale = initial_fill_scale + (0.98f - initial_fill_scale) * drawableSpinner.Progress;
@@ -221,19 +223,6 @@
                     }
                 }
             }
-
-            if (drawableSpinner.Result?.TimeStarted != null)
-                updateCentrePieceSize();
-        }
-
-        private void updateCentrePieceSize()
-        {
-            Debug.Assert(drawableSpinner.Result?.TimeStarted != null);
-
-            Spinner spinner = drawableSpinner.HitObject;
-
-            using (BeginAbsoluteSequence(drawableSpinner.Result.TimeStarted.Value))
-                centre.ResizeTo(new Vector2(tracking_centre_size), spinner.TimePreempt / 2, Easing.OutQuint);
         }

         protected override void Dispose(bool isDisposing)


Trim whitespace

Trim whitespace

--- osu.Game/Overlays/Changelog/ChangelogUpdateStreamItem.cs
+++ osu.Game/Overlays/Changelog/ChangelogUpdateStreamItem.cs
@@ -14,7 +14,7 @@
             : base(stream)
         {
             if (stream.IsFeatured)
-                Width *= 2;
+                Width *= 2;
         }

         protected override string GetMainText => Value.DisplayName;


perf: Type.FullName LUT, 2.5-3 times faster (for math.net iridium)

Signed-off-by: James Gregory <474ba67bdb289c6263b36dfd8a7bed6c85b04943@jagregory.com>

--- src/Docu.Console/Parsing/Model/Identifier.cs
+++ src/Docu.Console/Parsing/Model/Identifier.cs
@@ -7,6 +7,7 @@
     public abstract class Identifier : IComparable<Identifier>
     {
         private readonly string name;
+        private static Dictionary<string, Type> nameToType;

         protected Identifier(string name)
         {
@@ -162,6 +163,19 @@
         {
             var parameters = new List<TypeIdentifier>();

+            if(nameToType == null)
+            {
+                // build type lookup table
+                nameToType = new Dictionary<string, Type>();
+                foreach(Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
+                {
+                    foreach(Type type in assembly.GetTypes())
+                    {
+                        nameToType[type.FullName] = type;
+                    }
+                }
+            }
+
             if (fullName.EndsWith(")"))
             {
                 string paramList = fullName.Substring(fullName.IndexOf("(") + 1);
@@ -169,13 +183,10 @@

                 foreach (string paramName in paramList.Split(','))
                 {
-                    foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
+                    Type paramType;
+                    if(nameToType.TryGetValue(paramName, out paramType))
                     {
-                        foreach (Type type in assembly.GetTypes())
-                        {
-                            if (type.FullName == paramName)
-                                parameters.Add(FromType(type));
-                        }
+                        parameters.Add(FromType(paramType));
                     }
                 }
             }


Add null checks to Reference

Add null checks to Reference

--- src/GitVersion.LibGit2Sharp/Git/Reference.cs
+++ src/GitVersion.LibGit2Sharp/Git/Reference.cs
@@ -1,3 +1,4 @@
+using GitVersion.Extensions;
 using GitVersion.Helpers;
 using LibGit2Sharp;

@@ -7,25 +8,26 @@
     {
         private static readonly LambdaEqualityHelper<IReference> equalityHelper = new(x => x.Name.Canonical);
         private static readonly LambdaKeyComparer<IReference, string> comparerHelper = new(x => x.Name.Canonical);
-
         internal readonly LibGit2Sharp.Reference innerReference;

         internal Reference(LibGit2Sharp.Reference reference)
         {
-            this.innerReference = reference;
+            this.innerReference = reference.NotNull();
             Name = new ReferenceName(reference.CanonicalName);

             if (reference is DirectReference)
                 ReferenceTargetId = new ObjectId(reference.TargetIdentifier);
         }
+
         public ReferenceName Name { get; }
         public IObjectId? ReferenceTargetId { get; }
         public int CompareTo(IReference other) => comparerHelper.Compare(this, other);
-        public override bool Equals(object obj) => Equals((obj as IReference));
+        public override bool Equals(object obj) => Equals(obj as IReference);
         public bool Equals(IReference? other) => equalityHelper.Equals(this, other);
         public override int GetHashCode() => equalityHelper.GetHashCode(this);
         public override string ToString() => Name.ToString();
         public string TargetIdentifier => this.innerReference.TargetIdentifier;
-        public static implicit operator LibGit2Sharp.Reference(Reference d) => d.innerReference;
+        public static implicit operator LibGit2Sharp.Reference(Reference d)
+            => d.NotNull().innerReference;
     }
 }


fix for appveyor exposed test error

fix for appveyor exposed test error

--- src/Lessmsi.Tests/CommandLineExtractTests.cs
+++ src/Lessmsi.Tests/CommandLineExtractTests.cs
@@ -104,7 +104,10 @@

 		    string consoleOutput;
 			RunCommandLine("l -t Property TestFiles\\MsiInput\\NUnit-2.5.2.9222.msi", out consoleOutput);
-			Assert.Equal(expectedOutput, consoleOutput);
+            // strangely I've seen newlines treated differently either by xunit or different versions of windows. So lets compare these as a list of lines: https://ci.appveyor.com/project/activescott/lessmsi/build/1.0.7/tests
+            string[] expectedOutputLines = expectedOutput.Split(new string[]{ "\r\n", "\n" }, StringSplitOptions.None);
+            string[] consoleOutputLines = consoleOutput.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);
+            Assert.Equal(expectedOutputLines, consoleOutputLines);
 		}

 		[Fact]


Detecting if input is redirected

Detecting if input is redirected

--- src/Main/Ghost.Engine/CommandLine/Program.cs
+++ src/Main/Ghost.Engine/CommandLine/Program.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices;
 using Ghost.Engine.Settings;
 using NDesk.Options;

@@ -31,19 +32,43 @@
             };

             var server = engine.Start(info);
-            HandleBreak(server.Dispose);

             info.Output.WriteLine("Started at {0}", info.Url);
-            while (true)
+            if (IsInputRedirected)
             {
-                var key = Console.ReadKey(true);
-                if (key.Key == ConsoleKey.Escape)
+                // read a single line that will never arrive, I guess...
+                // what's the best way to signal userless console process to exit?
+
+                Console.ReadLine();
+            }
+            else
+            {
+                HandleBreak(server.Dispose);
+
+                while (true)
                 {
-                    break;
+                    var key = Console.ReadKey(true);
+                    if (key.Key == ConsoleKey.Escape)
+                    {
+                        break;
+                    }
                 }
             }
             server.Dispose();
         }
+
+        public static bool IsInputRedirected
+        {
+            get { return FileType.Char != GetFileType(GetStdHandle(StdHandle.Stdin)); }
+        }
+
+        // P/Invoke:
+        private enum FileType { Unknown, Disk, Char, Pipe };
+        private enum StdHandle { Stdin = -10, Stdout = -11, Stderr = -12 };
+        [DllImport("kernel32.dll")]
+        private static extern FileType GetFileType(IntPtr hdl);
+        [DllImport("kernel32.dll")]
+        private static extern IntPtr GetStdHandle(StdHandle std);

         static void HandleBreak(Action dispose)
         {
@@ -55,7 +80,7 @@
                 if (cancelPressed)
                 {
                     dispose();
-                    Environment.Exit(-1);
+                    Environment.Exit(1);
                     e.Cancel = true;
                 }
                 else


Updating Social startup as well to use chaining to add configuration sources.

--- src/MusicStore/Mocks/StartupSocialTesting.cs
+++ src/MusicStore/Mocks/StartupSocialTesting.cs
@@ -29,9 +29,9 @@
             Console.WriteLine("Social Testing mode...");
             //Below code demonstrates usage of multiple configuration sources. For instance a setting say 'setting1' is found in both the registered sources,
             //then the later source will win. By this way a Local config can be overridden by a different setting while deployed remotely.
-            var configuration = new Configuration();
-            configuration.AddJsonFile("config.json");
-            configuration.AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values.
+            var configuration = new Configuration()
+                        .AddJsonFile("config.json")
+                        .AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values.

             //Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline.
             //Note: ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production.