Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin interface {
_interface.CallBack
// 插件ID(uuid)
GetId() string
// 获取插件名称
GetName() string
// 获取简介
GetDescription() string
// 获取使用说明
GetHelpDescription() string
// 获取命令
GetCommandName() string
// 非全局插件,会服务端插件初始化
Init(server server.MinecraftServer)
// 是否是全局插件
IsGlobal() bool
// 如果是非全局插件就要提供一个新建插件实体的函数
NewInstance() Plugin
// 处理投递消息
HandleMessage(messageType *models.ReciveMessage)
// 开启插件
Start()
// 停止插件
Stop()
}
type PluginContainer ¶
type PluginContainer interface {
_interface.CallBack
// 注册插件
RegisterPlugin(Plugin)
// 新建一个管理器实例
NewPluginManager(server server.MinecraftServer) PluginManager
}
插件容器
type PluginManager ¶
type PluginManager interface {
_interface.CallBack
// 获取可用所有插件
GetAblePlugins() map[string]Plugin
// 获取可用所有插件
GetDisablePlugins() map[string]Plugin
// 根据id禁用插件
BanPlugin(string)
// 根据id接触禁用
UnbanPlugin(string)
// 处理投递消息
HandleMessage(*models.ReciveMessage)
// 通知添加插件(已拥有,则不添加),可用于动态添加插件
AddPlugin(Plugin)
}
插件管理服务器,每个mc服务端都会有一个实例
Click to show internal directories.
Click to hide internal directories.