-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The plugin is now loading the protocol assemblies if they're not by default - Protocol is dumped from all the relevant assemblies instead of only one - Added StringExtensions - Added ReflectionExtensions
- Loading branch information
1 parent
d26fcca
commit b60634c
Showing
4 changed files
with
87 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Reflection; | ||
|
||
namespace ProtocolDumper.Infrastructure; | ||
|
||
internal static class ReflectionExtensions | ||
{ | ||
public static bool IsProtocolAssembly(this Assembly assembly) | ||
=> assembly.FullName?.Contains("Dofus.Protocol") ?? false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ProtocolDumper.Infrastructure; | ||
internal static class StringExtensions | ||
{ | ||
public static string GetLastSegment(this string typeName, char separator = '.') | ||
{ | ||
var lastIndexOf = typeName.LastIndexOf(separator); | ||
return lastIndexOf == -1 ? typeName : typeName[(lastIndexOf + 1)..]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters