~ruther/NosSmooth.Local

9ac3d2d80917d4e243e12e2329459314702a7110 — Rutherther 2 years ago c13e87c
fix(samples): do not incorrectly intercept c_info_reset, do not put two spaces in c_info packet
2 files changed, 3 insertions(+), 43 deletions(-)

M src/Samples/LowLevel/InterceptNameChanger/NameChangeInterceptor.cs
D src/Samples/LowLevel/InterceptNameChanger/Properties/AssemblyInfo.cs
M src/Samples/LowLevel/InterceptNameChanger/NameChangeInterceptor.cs => src/Samples/LowLevel/InterceptNameChanger/NameChangeInterceptor.cs +3 -2
@@ 4,6 4,7 @@
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using Microsoft.Extensions.Logging;
using NosSmooth.Core.Client;
using NosSmooth.LocalClient;


@@ 61,10 62,10 @@ namespace InterceptNameChanger
        /// <inheritdoc/>
        public bool InterceptReceive(ref string packet)
        {
            if (packet.StartsWith("c_info"))
            if (packet.StartsWith("c_info "))
            {
                var oldPart = packet.Substring(packet.IndexOf(' ', 7));
                var result = _client.ReceivePacketAsync($"c_info {_name} " + oldPart)
                var result = _client.ReceivePacketAsync($"c_info {_name}" + oldPart)
                    .GetAwaiter().GetResult(); // Change the name

                if (!result.IsSuccess)

D src/Samples/LowLevel/InterceptNameChanger/Properties/AssemblyInfo.cs => src/Samples/LowLevel/InterceptNameChanger/Properties/AssemblyInfo.cs +0 -41
@@ 1,41 0,0 @@
//
//  AssemblyInfo.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("InterceptNameChanger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InterceptNameChanger")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("F96F3AA0-131E-4B6B-AB21-BBE2DEBCEF3A")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file

Do not follow this link