Plugins functionalitySolved

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)

Hooks are called when the location in the server code is triggered, or when Oxide manually calls the hook. 

So, how da hook find my method 0_o

8VBjWTsCQDoBqEn.jpg WeiZedInc

So, how da hook find my method 0_o

If the method is the same signature as a hook, Oxide sees it and calls it. All methods that are hooks are kept track of when the plugin loads.
zBEfPXN4GY2TGNe.png Wulf
If the method is the same signature as a hook, Oxide sees it and calls it. All methods that are hooks are kept track of when the plugin loads.

Ok, now I understood, thx <3

Locked automatically