Skip to content

Auto Network [No Dependency]

TheInsanityGod edited this page Jun 16, 2026 · 1 revision

Attributes

[AutoNetworkMessage]

Can be applied on static or ModSystem methods to simplify automatically register methods as message handlers.

Properties:

  • channelName (modid by default): the name of the channel to register it on.

Note: They are registered when AutoSetup is called.

Examples

public class MessageHandlerExampleSystem : ModSystem
{

    [AutoNetworkMessage]
    public static void OnServerPacket(IServerPlayer player, Packet packet)
    {
        //handle server receiving packet
    }

    [AutoNetworkMessage]
    public void OnClientPacket(Packet packet)
    {
        //Handle client receiving packet
    }
}

Clone this wiki locally