How the server understands when exactly he needs to run my methods?
I'm new to the Rust plugin development and I can't understand how it woks :D
[Info("BetterCodeLock", "WeiZed", "1.0.0")]
[Description("BetterCodeLock")]
class BetterCodeLock : CovalencePlugin
{
void OnServerInitialized(bool initial) => Puts("BetterCodeLock loaded");
object CanChangeCode(BasePlayer player, CodeLock codeLock, string newCode, bool isGuestCode)
{
player.ChatMessage(newCode + " has set on " + codeLock.name + "(IsGuestCode: )" + isGuestCode.ToString());
return null;
}
}So, here we can see the method(CanChangeCode()) from documentation, which declared by me like a NEW method with object type. And I can't understand how and when the server calls it.In my other projects I was using delegates/events which were calling my methods to do some work on smth happens, but here I'm just declaring the brand new method, without any subscribing to any of delegates/events and it works somehow. There are not any attribute on it, so even all the parameters for it are coming from idk where xD
Brain damage ;c
sry for bad english)