From 9ac3d2d80917d4e243e12e2329459314702a7110 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Tue, 3 Jan 2023 10:00:45 +0100 Subject: [PATCH] fix(samples): do not incorrectly intercept c_info_reset, do not put two spaces in c_info packet --- .../NameChangeInterceptor.cs | 5 ++- .../Properties/AssemblyInfo.cs | 41 ------------------- 2 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 src/Samples/LowLevel/InterceptNameChanger/Properties/AssemblyInfo.cs diff --git a/src/Samples/LowLevel/InterceptNameChanger/NameChangeInterceptor.cs b/src/Samples/LowLevel/InterceptNameChanger/NameChangeInterceptor.cs index c519de071c22272fae47b2965594e76ebc35486b..cdd299195e3102794c8ab961ee1931a10a514f25 100644 --- a/src/Samples/LowLevel/InterceptNameChanger/NameChangeInterceptor.cs +++ b/src/Samples/LowLevel/InterceptNameChanger/NameChangeInterceptor.cs @@ -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 /// 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) diff --git a/src/Samples/LowLevel/InterceptNameChanger/Properties/AssemblyInfo.cs b/src/Samples/LowLevel/InterceptNameChanger/Properties/AssemblyInfo.cs deleted file mode 100644 index 2501ebf48230410892d8f498b9482e89694e5f59..0000000000000000000000000000000000000000 --- a/src/Samples/LowLevel/InterceptNameChanger/Properties/AssemblyInfo.cs +++ /dev/null @@ -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