

This plugin offers an easy-to-use solution for Netcode's NetworkBehaviour class, streamlining the approach to networking mods with Server and Client RPCs. By leveraging the CustomMessagingHandler of Netcode, it simplifies the modding process, allowing for easier implementation of RPCs without the need for complex compile-time DLL patching. Designed as a BepInPlugin, it adheres to the same attribute and name restrictions as the standard netcode patcher, making it a user-friendly and effective dependency for enhancing your modding projects.
To integrate Runtime Unity Netcode Patcher in your Unity project, follow these steps:
[BepInDependency(RuntimeNetcodeRPCValidator.PluginInfo.GUID)] attribute to your [BepInPlugin].NetcodeValidator. When you wish to revert any patches applied, simply call Dispose() on the instance. A new instance can then be created to reapply the netcode patching.// Example of using NetcodeValidator
NetcodeValidator myValidator = new NetcodeValidator(...);
// ...
// Dispose when plugin unloads
myValidator.Dispose();
Ensure you have the following components within the environment:
Utilize the NetworkBehaviour.LastRPCSender(), accessible with this. inside a network behaviour instance, method to retrieve the ID of the last RPC sender. This will always be NetworkManager.ServerClientId on the clients.
We welcome contributions! If you would like to help improve the Runtime Unity Netcode Patcher, please submit pull requests, and report bugs or suggestions in the issues section of this repository.
This project is licensed under the MIT License - see the LICENSE file for details.