Skip to content

Commit

Permalink
- Removed no longer used assembly references
Browse files Browse the repository at this point in the history
- Added current date time to dump directory name (Todo: #3)
- Small logging logic refactor
  • Loading branch information
thenameless314159 committed Aug 19, 2024
1 parent b60634c commit 704ab47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/ProtocolDumper/ProtocolDumper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,5 @@
<Reference Include="UnityEngine.CoreModule">
<HintPath>$(ManagedAssembliesPath)\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="Ankama.Dofus.Protocol.Game">
<HintPath>$(ManagedAssembliesPath)\Ankama.Dofus.Protocol.Game.dll</HintPath>
</Reference>
<Reference Include="Ankama.Dofus.Protocol.Connection">
<HintPath>$(ManagedAssembliesPath)\Ankama.Dofus.Protocol.Connection.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
6 changes: 4 additions & 2 deletions src/ProtocolDumper/ProtocolDumperPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace ProtocolDumper;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class ProtocolDumperPlugin : BasePlugin
{
static readonly string ProtocolDumpPath = Path.Combine(Paths.PluginPath, "protocol");
static readonly string ProtocolDumpPath = Path.Combine(Paths.GameRootPath, $"protocol-{DateTime.Now:yyyyMMddTHHmmss}");

public override void Load()
{
Expand Down Expand Up @@ -83,8 +83,10 @@ void Start()
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
File.WriteAllText(filePath, protoFile);

logger.LogInfo($"Successfully dumped protocol at '{fileName}'");
logger.LogDebug($"Successfully dumped protocol at '{filePath}'");
}

logger.LogInfo($"Protocol files have been dumped successfully at '{ProtocolDumpPath}' ! ");
}
finally { Destroy(this); } // we only need to run this once
}
Expand Down

0 comments on commit 704ab47

Please sign in to comment.