Documentation
¶
Index ¶
- func GetPluginRegistry() pluginRegistry
- func Load(dataFilesPath string)
- func OnNetConnect(n NetConnection)
- func ReadFile(dfPath string) ([]byte, error)
- func Save()
- type NetConnection
- type Plugin
- func (p *Plugin) AddMobCommand(command string, handlerFunc mobcommands.MobCommand, allowWhenDowned bool)
- func (p *Plugin) AddScriptingFunction(funcName string, scriptFunc any)
- func (p *Plugin) AddUserCommand(command string, handlerFunc usercommands.UserCommand, allowWhenDowned bool, ...)
- func (p *Plugin) AttachFileSystem(f embed.FS) error
- func (p *Plugin) ExportFunction(stringId string, f any)
- func (p *Plugin) ReadBytes(identifier string) ([]byte, error)
- func (p *Plugin) ReadIntoStruct(identifier string, out any) error
- func (p *Plugin) Requires(modname string, modversion string)
- func (p *Plugin) WriteBytes(identifier string, bytes []byte) error
- func (p *Plugin) WriteStruct(identifier string, in any) error
- type PluginCallbacks
- type PluginConfig
- type PluginFiles
- type WebConfig
- type WebPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPluginRegistry ¶
func GetPluginRegistry() pluginRegistry
func OnNetConnect ¶
func OnNetConnect(n NetConnection)
Types ¶
type NetConnection ¶
type Plugin ¶
type Plugin struct {
Callbacks PluginCallbacks
Config PluginConfig
Web WebConfig
// contains filtered or unexported fields
}
func (*Plugin) AddMobCommand ¶
func (p *Plugin) AddMobCommand(command string, handlerFunc mobcommands.MobCommand, allowWhenDowned bool)
Registers a MobCommand and callback
func (*Plugin) AddScriptingFunction ¶
Registers a UserCommand and callback
func (*Plugin) AddUserCommand ¶
func (p *Plugin) AddUserCommand(command string, handlerFunc usercommands.UserCommand, allowWhenDowned bool, isAdminOnly bool)
Registers a UserCommand and callback
func (*Plugin) AttachFileSystem ¶
Adds an embedded file system to the plugin
func (*Plugin) ExportFunction ¶
type PluginCallbacks ¶
type PluginCallbacks struct {
// contains filtered or unexported fields
}
func (*PluginCallbacks) SetIACHandler ¶
func (c *PluginCallbacks) SetIACHandler(f func(uint64, []byte) bool)
func (*PluginCallbacks) SetOnLoad ¶
func (c *PluginCallbacks) SetOnLoad(f func())
func (*PluginCallbacks) SetOnNetConnect ¶
func (c *PluginCallbacks) SetOnNetConnect(f func(NetConnection))
func (*PluginCallbacks) SetOnSave ¶
func (c *PluginCallbacks) SetOnSave(f func())
type PluginConfig ¶
type PluginConfig struct {
// contains filtered or unexported fields
}
func (*PluginConfig) Get ¶
func (p *PluginConfig) Get(name string) any
func (*PluginConfig) Set ¶
func (p *PluginConfig) Set(name string, val any)
type PluginFiles ¶
type PluginFiles struct {
// contains filtered or unexported fields
}
Implements fs.ReadFileFS
Click to show internal directories.
Click to hide internal directories.