Documentation ¶
Index ¶
- Variables
- func AddLog(name string, params ...string) _interface.Log
- func AppendResourceWsToPool(ctx context.Context, serverId string, ws *websocket.Conn)
- func AppendStdWsToPool(serverId string, ws *websocket.Conn)
- func ConfInit()
- func DrawBanner(text string) string
- func ExitHandle()
- func GetAllServerSide() []string
- func GetConfInstance() _interface.Conf
- func GetConfVal(confKey string) string
- func GetFromDatabase(key string) string
- func GetGinServerInstance() server.GinServer
- func GetGinServerInstanceRouter() *gin.Engine
- func GetIncreateId() int
- func GetJobContainerInstance() container.JobContainer
- func GetLogContainerInstance() container.LogContainer
- func GetMinecraftServerById(id string) (server.MinecraftServer, error)
- func GetMinecraftServerContainerInstance() container.MinecraftContainer
- func GetPluginContainerInstance() plugin_interface.PluginContainer
- func GetWebManageUrl() string
- func InitFlag() map[string]string
- func ListenStdinFromWs(serverId string, ws *websocket.Conn)
- func NewMinecraftServer(serverConf *models.ServerConf) server.MinecraftServer
- func NewMonitorServer(id string, pid int) server.MonitorServer
- func RegisterCallBack(callback _interface.CallBack)
- func RegisterConfig(confKey, ConfVal, description string, level int64, IsAlterable bool)
- func RegisterJob(name string, interval string, handle func(), isStart bool) error
- func RunChangeConfCallBacks()
- func RunDestructCallBacks()
- func RunOneCommand(serverId, command string, commandType int64) bool
- func SendExitSign()
- func SetFromDatabase(key string, value string)
- func SetWiteTTLFromDatabase(key string, value string, t time.Duration)
- func WriteLogToChannels(msg string, level string, channels []string)
- func WriteLogToDefault(params ...string)
- type Conf
- func (c *Conf) ChangeConfCallBack()
- func (c *Conf) DestructCallBack()
- func (c *Conf) GetConfVal(key string) string
- func (c *Conf) GetConfig() map[string]string
- func (c *Conf) GetConfigKeys() []string
- func (c *Conf) GetConfigObj() map[string]*models.ConfParam
- func (c *Conf) Init(terminalConfs map[string]string)
- func (c *Conf) InitCallBack()
- func (c *Conf) RegisterConfParam(confKey, ConfVal, description string, level int64, IsAlterable bool)
- func (c *Conf) ReloadConfig()
- func (c *Conf) SetConfParam(Name, ConfVal, description string, level int64)
- type DataBase
- type GinServer
- type JobContainer
- func (jc *JobContainer) ChangeConfCallBack()
- func (jc *JobContainer) DestructCallBack()
- func (jc *JobContainer) HasJob(name string) bool
- func (jc *JobContainer) InitCallBack()
- func (jc *JobContainer) RegisterJob(name string, interval string, handle func())
- func (jc *JobContainer) StartAll() map[string]error
- func (jc *JobContainer) StartJob(name string) error
- func (jc *JobContainer) StartJobs(names ...string) map[string]error
- func (jc *JobContainer) StopJob(name string)
- func (jc *JobContainer) StopJobs(names ...string)
- type Log
- func (l *Log) ChangeConfCallBack()
- func (l *Log) CompressLogs(tpath string) error
- func (l *Log) Debugf(f string, v ...interface{})
- func (l *Log) DestructCallBack()
- func (l *Log) Errorf(f string, v ...interface{})
- func (l *Log) GetLines(page int, pageSize int) []string
- func (l *Log) Infof(f string, v ...interface{})
- func (l *Log) Init() error
- func (l *Log) InitCallBack()
- func (l *Log) InitFileObj()
- func (l *Log) SetLogLevel(level string)
- func (l *Log) Warningf(f string, v ...interface{})
- func (l *Log) Write(p []byte) (n int, err error)
- func (l *Log) WriteLog(logMsg *_interface.LogMsgType)
- type LogContainer
- func (l *LogContainer) AddLog(name string, params ...string) _interface.Log
- func (l *LogContainer) ChangeConfCallBack()
- func (l *LogContainer) CompressLogJobFunc()
- func (l *LogContainer) DestructCallBack()
- func (l *LogContainer) GetLogById(id int) _interface.Log
- func (l *LogContainer) GetLogByName(name string) _interface.Log
- func (l *LogContainer) InitCallBack()
- func (l *LogContainer) WriteLog(params ...string)
- func (l *LogContainer) WriteLogOnChannels(msg string, level string, channels []string)
- type MinecraftServer
- func (m *MinecraftServer) BanPlugin(pluginId string)
- func (m *MinecraftServer) ChangeConfCallBack()
- func (m *MinecraftServer) Command(c string) error
- func (m *MinecraftServer) DestructCallBack()
- func (m *MinecraftServer) GetPluginsInfo() []*models.PluginInfo
- func (m *MinecraftServer) GetServerConf() *models.ServerConf
- func (m *MinecraftServer) GetServerEntryId() string
- func (m *MinecraftServer) GetServerMonitor() server.MonitorServer
- func (m *MinecraftServer) InitCallBack()
- func (m *MinecraftServer) RegisterCloseCallback(c func(string))
- func (m *MinecraftServer) RegisterOpenCallback(c func(string))
- func (m *MinecraftServer) RegisterSaveCallback(c func(string))
- func (m *MinecraftServer) RegisterSubscribeMessageChan(c chan *models.ReciveMessage)
- func (m *MinecraftServer) Rename(name string)
- func (m *MinecraftServer) Restart() error
- func (m *MinecraftServer) RunCommand(cmd string, params ...string) error
- func (m *MinecraftServer) SayCommand(msg string) error
- func (m *MinecraftServer) SetMemory(memory int64)
- func (m *MinecraftServer) SetServerConf(c *models.ServerConf)
- func (m *MinecraftServer) Start() error
- func (m *MinecraftServer) StartMonitorServer()
- func (m *MinecraftServer) Stop() error
- func (m *MinecraftServer) StopMonitorServer()
- func (m *MinecraftServer) TellCommand(player string, msg string) error
- func (m *MinecraftServer) TellrawCommand(player string, msg interface{}) error
- func (m *MinecraftServer) UnbanPlugin(pluginId string)
- func (m *MinecraftServer) WriteLog(msg string, level string)
- type MinecraftServerContainer
- func (m *MinecraftServerContainer) AddServer(config *models.ServerConf, isSave bool)
- func (m *MinecraftServerContainer) ChangeConfCallBack()
- func (m *MinecraftServerContainer) DeleteServer(id string) error
- func (m *MinecraftServerContainer) DestructCallBack()
- func (m *MinecraftServerContainer) GetAllServerConf() []*models.ServerConf
- func (m *MinecraftServerContainer) GetAllServerObj() map[string]server.MinecraftServer
- func (m *MinecraftServerContainer) GetMirrorServerById(id string) (server.MinecraftServer, error)
- func (m *MinecraftServerContainer) GetServerById(id string) (server.MinecraftServer, error)
- func (m *MinecraftServerContainer) HandleMcFile(filePath, name string, port, memory int64, side string, comment string) *models.ServerConf
- func (m *MinecraftServerContainer) InitCallBack()
- func (m *MinecraftServerContainer) RegisterAllServerCloseCallback(f func(string))
- func (m *MinecraftServerContainer) RegisterAllServerOpenCallback(f func(string))
- func (m *MinecraftServerContainer) RegisterAllServerSaveCallback(f func(string))
- func (m *MinecraftServerContainer) RestartById(id string) error
- func (m *MinecraftServerContainer) SaveToDb()
- func (m *MinecraftServerContainer) StartAll() error
- func (m *MinecraftServerContainer) StartById(id string) error
- func (m *MinecraftServerContainer) StopAll() error
- func (m *MinecraftServerContainer) StopById(id string) error
- type MonitorServer
- func (m *MonitorServer) ChangeConfCallBack()
- func (m *MonitorServer) DestructCallBack()
- func (m *MonitorServer) GetMessageChan() chan *models.MonitorMessage
- func (m *MonitorServer) GetMonitorMessage()
- func (m *MonitorServer) InitCallBack()
- func (m *MonitorServer) Restart() error
- func (m *MonitorServer) Start() error
- func (m *MonitorServer) Stop() error
- type PluginContainer
- func (c *PluginContainer) ChangeConfCallBack()
- func (c *PluginContainer) DestructCallBack()
- func (c *PluginContainer) InitCallBack()
- func (c *PluginContainer) NewPluginManager(mcServer server.MinecraftServer) plugin_interface.PluginManager
- func (c *PluginContainer) RegisterPlugin(p plugin_interface.Plugin)
- type PluginManager
- func (m *PluginManager) AddPlugin(p plugin_interface.Plugin)
- func (m *PluginManager) BanPlugin(pluginId string)
- func (m *PluginManager) ChangeConfCallBack()
- func (m *PluginManager) DestructCallBack()
- func (m *PluginManager) GetAblePlugins() map[string]plugin_interface.Plugin
- func (m *PluginManager) GetDisablePlugins() map[string]plugin_interface.Plugin
- func (m *PluginManager) HandleMessage(msg *models.ReciveMessage)
- func (m *PluginManager) InitCallBack()
- func (m *PluginManager) UnbanPlugin(pluginId string)
- type ServerAdapter
- func (sa *ServerAdapter) GetGameSaveRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetGameStartRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetGameTypeRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetMessageRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetPlayerAdvancementRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetPlayerDeathRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetPlayerJoinRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetPlayerLeftRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
- func (sa *ServerAdapter) GetVersionRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NO_SERVER = errors.New("id没有对应的服务器") REPEAT_ID = errors.New("id段冲突") NOT_MIRROR = errors.New("不是镜像服务端") )
View Source
var ( PORT_REPEAT_ERROR = errors.New("服务器端口已被其他程序占用,请更换端口或者开启自动更换端口") SEFVER_NOT_START_ERROR = errors.New("服务器未开启") )
View Source
var (
DefaultConfParam map[string]*models.ConfParam
)
View Source
var ExitChan chan os.Signal
View Source
var (
LogLevel map[string]int
)
View Source
var (
NOT_EXIST_PROCESS = errors.New("不存在该pid的进程")
)
Functions ¶
func AppendResourceWsToPool ¶
func AppendStdWsToPool ¶
func GetFromDatabase ¶
func GetGinServerInstance ¶
func GetJobContainerInstance ¶
func GetJobContainerInstance() container.JobContainer
func GetLogContainerInstance ¶
func GetLogContainerInstance() container.LogContainer
func GetMinecraftServerById ¶ added in v1.1.0
func GetMinecraftServerById(id string) (server.MinecraftServer, error)
func GetMinecraftServerContainerInstance ¶
func GetMinecraftServerContainerInstance() container.MinecraftContainer
func GetPluginContainerInstance ¶
func GetPluginContainerInstance() plugin_interface.PluginContainer
func ListenStdinFromWs ¶
func NewMinecraftServer ¶
func NewMinecraftServer(serverConf *models.ServerConf) server.MinecraftServer
NewMinecraftServer 新建一个mc服务端进程
func NewMonitorServer ¶
func NewMonitorServer(id string, pid int) server.MonitorServer
func RegisterCallBack ¶
func RegisterCallBack(callback _interface.CallBack)
func RegisterConfig ¶
注册配置
func RegisterJob ¶
func RunChangeConfCallBacks ¶
func RunChangeConfCallBacks()
func RunDestructCallBacks ¶
func RunDestructCallBacks()
func RunOneCommand ¶
func SetFromDatabase ¶
func SetWiteTTLFromDatabase ¶
func WriteLogToChannels ¶
写入自定义管道日志帮助函数
Types ¶
type Conf ¶
type Conf struct { // ConfKeys // 所有配置键值 ConfKeys []string // contains filtered or unexported fields }
Conf 导入配置优先级:管理后台设置配置 > 命令行变量 > 环境变量 > 配置文件 > 默认配置
func (*Conf) ChangeConfCallBack ¶
func (c *Conf) ChangeConfCallBack()
func (*Conf) DestructCallBack ¶
func (c *Conf) DestructCallBack()
func (*Conf) InitCallBack ¶
func (c *Conf) InitCallBack()
func (*Conf) RegisterConfParam ¶
func (c *Conf) RegisterConfParam(confKey, ConfVal, description string, level int64, IsAlterable bool)
注册配置
func (*Conf) SetConfParam ¶
设置配置
type GinServer ¶
type GinServer struct {
// contains filtered or unexported fields
}
func (*GinServer) ChangeConfCallBack ¶
func (g *GinServer) ChangeConfCallBack()
func (*GinServer) DestructCallBack ¶
func (g *GinServer) DestructCallBack()
func (*GinServer) InitCallBack ¶
func (g *GinServer) InitCallBack()
type JobContainer ¶
type JobContainer struct {
// contains filtered or unexported fields
}
JobContainer 定时任务管理器
var JobContainerObj *JobContainer
func (*JobContainer) ChangeConfCallBack ¶
func (jc *JobContainer) ChangeConfCallBack()
func (*JobContainer) DestructCallBack ¶
func (jc *JobContainer) DestructCallBack()
func (*JobContainer) HasJob ¶
func (jc *JobContainer) HasJob(name string) bool
func (*JobContainer) InitCallBack ¶
func (jc *JobContainer) InitCallBack()
func (*JobContainer) RegisterJob ¶
func (jc *JobContainer) RegisterJob(name string, interval string, handle func())
func (*JobContainer) StartAll ¶
func (jc *JobContainer) StartAll() map[string]error
func (*JobContainer) StartJob ¶
func (jc *JobContainer) StartJob(name string) error
func (*JobContainer) StartJobs ¶
func (jc *JobContainer) StartJobs(names ...string) map[string]error
func (*JobContainer) StopJob ¶
func (jc *JobContainer) StopJob(name string)
func (*JobContainer) StopJobs ¶
func (jc *JobContainer) StopJobs(names ...string)
type Log ¶
type Log struct { Name string Path string Id int Level int WriteChan chan *_interface.LogMsgType FileObj *os.File // contains filtered or unexported fields }
func (*Log) ChangeConfCallBack ¶
func (l *Log) ChangeConfCallBack()
func (*Log) CompressLogs ¶
func (*Log) DestructCallBack ¶
func (l *Log) DestructCallBack()
func (*Log) InitCallBack ¶
func (l *Log) InitCallBack()
func (*Log) InitFileObj ¶
func (l *Log) InitFileObj()
func (*Log) SetLogLevel ¶
func (*Log) WriteLog ¶
func (l *Log) WriteLog(logMsg *_interface.LogMsgType)
type LogContainer ¶
type LogContainer struct { NameIdMapping map[string]int Logs map[int]*Log LogDir string // contains filtered or unexported fields }
func (*LogContainer) AddLog ¶
func (l *LogContainer) AddLog(name string, params ...string) _interface.Log
添加日志实例
func (*LogContainer) DestructCallBack ¶
func (l *LogContainer) DestructCallBack()
func (*LogContainer) GetLogById ¶
func (l *LogContainer) GetLogById(id int) _interface.Log
func (*LogContainer) GetLogByName ¶
func (l *LogContainer) GetLogByName(name string) _interface.Log
func (*LogContainer) InitCallBack ¶
func (l *LogContainer) InitCallBack()
func (*LogContainer) WriteLogOnChannels ¶
func (l *LogContainer) WriteLogOnChannels(msg string, level string, channels []string)
把日志写到各个管道中
type MinecraftServer ¶
type MinecraftServer struct { *models.ServerConf *ServerAdapter // CmdObj //子进程实例 CmdObj *exec.Cmd // Pid // 进程pid Pid int // contains filtered or unexported fields }
MinecraftServer mc服务器子进程对象
func (*MinecraftServer) BanPlugin ¶
func (m *MinecraftServer) BanPlugin(pluginId string)
func (*MinecraftServer) ChangeConfCallBack ¶
func (m *MinecraftServer) ChangeConfCallBack()
func (*MinecraftServer) Command ¶
func (m *MinecraftServer) Command(c string) error
func (*MinecraftServer) DestructCallBack ¶
func (m *MinecraftServer) DestructCallBack()
func (*MinecraftServer) GetPluginsInfo ¶
func (m *MinecraftServer) GetPluginsInfo() []*models.PluginInfo
获取插件信息
func (*MinecraftServer) GetServerConf ¶
func (m *MinecraftServer) GetServerConf() *models.ServerConf
func (*MinecraftServer) GetServerEntryId ¶
func (m *MinecraftServer) GetServerEntryId() string
func (*MinecraftServer) GetServerMonitor ¶
func (m *MinecraftServer) GetServerMonitor() server.MonitorServer
func (*MinecraftServer) InitCallBack ¶
func (m *MinecraftServer) InitCallBack()
func (*MinecraftServer) RegisterCloseCallback ¶
func (m *MinecraftServer) RegisterCloseCallback(c func(string))
func (*MinecraftServer) RegisterOpenCallback ¶
func (m *MinecraftServer) RegisterOpenCallback(c func(string))
func (*MinecraftServer) RegisterSaveCallback ¶
func (m *MinecraftServer) RegisterSaveCallback(c func(string))
func (*MinecraftServer) RegisterSubscribeMessageChan ¶
func (m *MinecraftServer) RegisterSubscribeMessageChan(c chan *models.ReciveMessage)
func (*MinecraftServer) Rename ¶
func (m *MinecraftServer) Rename(name string)
func (*MinecraftServer) Restart ¶
func (m *MinecraftServer) Restart() error
func (*MinecraftServer) RunCommand ¶
func (m *MinecraftServer) RunCommand(cmd string, params ...string) error
func (*MinecraftServer) SayCommand ¶
func (m *MinecraftServer) SayCommand(msg string) error
func (*MinecraftServer) SetMemory ¶
func (m *MinecraftServer) SetMemory(memory int64)
func (*MinecraftServer) SetServerConf ¶
func (m *MinecraftServer) SetServerConf(c *models.ServerConf)
func (*MinecraftServer) Start ¶
func (m *MinecraftServer) Start() error
func (*MinecraftServer) StartMonitorServer ¶
func (m *MinecraftServer) StartMonitorServer()
func (*MinecraftServer) Stop ¶
func (m *MinecraftServer) Stop() error
func (*MinecraftServer) StopMonitorServer ¶
func (m *MinecraftServer) StopMonitorServer()
func (*MinecraftServer) TellCommand ¶
func (m *MinecraftServer) TellCommand(player string, msg string) error
执行tell命令
func (*MinecraftServer) TellrawCommand ¶
func (m *MinecraftServer) TellrawCommand(player string, msg interface{}) error
执行tellraw命令
func (*MinecraftServer) UnbanPlugin ¶
func (m *MinecraftServer) UnbanPlugin(pluginId string)
func (*MinecraftServer) WriteLog ¶
func (m *MinecraftServer) WriteLog(msg string, level string)
type MinecraftServerContainer ¶
type MinecraftServerContainer struct {
// contains filtered or unexported fields
}
func (*MinecraftServerContainer) AddServer ¶
func (m *MinecraftServerContainer) AddServer(config *models.ServerConf, isSave bool)
把根据配置添加服务端
func (*MinecraftServerContainer) ChangeConfCallBack ¶
func (m *MinecraftServerContainer) ChangeConfCallBack()
func (*MinecraftServerContainer) DeleteServer ¶ added in v1.1.0
func (m *MinecraftServerContainer) DeleteServer(id string) error
删除服务端
func (*MinecraftServerContainer) DestructCallBack ¶
func (m *MinecraftServerContainer) DestructCallBack()
func (*MinecraftServerContainer) GetAllServerConf ¶
func (m *MinecraftServerContainer) GetAllServerConf() []*models.ServerConf
获取所有服务端的配置
func (*MinecraftServerContainer) GetAllServerObj ¶
func (m *MinecraftServerContainer) GetAllServerObj() map[string]server.MinecraftServer
获取所有服务端对象实例
func (*MinecraftServerContainer) GetMirrorServerById ¶
func (m *MinecraftServerContainer) GetMirrorServerById(id string) (server.MinecraftServer, error)
func (*MinecraftServerContainer) GetServerById ¶
func (m *MinecraftServerContainer) GetServerById(id string) (server.MinecraftServer, error)
func (*MinecraftServerContainer) HandleMcFile ¶
func (m *MinecraftServerContainer) HandleMcFile(filePath, name string, port, memory int64, side string, comment string) *models.ServerConf
处理mc服务端文件
func (*MinecraftServerContainer) InitCallBack ¶
func (m *MinecraftServerContainer) InitCallBack()
func (*MinecraftServerContainer) RegisterAllServerCloseCallback ¶
func (m *MinecraftServerContainer) RegisterAllServerCloseCallback(f func(string))
统一注册关闭回调
func (*MinecraftServerContainer) RegisterAllServerOpenCallback ¶
func (m *MinecraftServerContainer) RegisterAllServerOpenCallback(f func(string))
统一注册开启回调
func (*MinecraftServerContainer) RegisterAllServerSaveCallback ¶
func (m *MinecraftServerContainer) RegisterAllServerSaveCallback(f func(string))
统一注册保存回调
func (*MinecraftServerContainer) RestartById ¶
func (m *MinecraftServerContainer) RestartById(id string) error
根据id重启服务端
func (*MinecraftServerContainer) StartAll ¶
func (m *MinecraftServerContainer) StartAll() error
func (*MinecraftServerContainer) StartById ¶
func (m *MinecraftServerContainer) StartById(id string) error
根据id启动服务端
func (*MinecraftServerContainer) StopAll ¶
func (m *MinecraftServerContainer) StopAll() error
停止所有服务端
func (*MinecraftServerContainer) StopById ¶
func (m *MinecraftServerContainer) StopById(id string) error
根据id停止服务端
type MonitorServer ¶
type MonitorServer struct {
// contains filtered or unexported fields
}
func (*MonitorServer) ChangeConfCallBack ¶
func (m *MonitorServer) ChangeConfCallBack()
func (*MonitorServer) DestructCallBack ¶
func (m *MonitorServer) DestructCallBack()
func (*MonitorServer) GetMessageChan ¶
func (m *MonitorServer) GetMessageChan() chan *models.MonitorMessage
func (*MonitorServer) GetMonitorMessage ¶
func (m *MonitorServer) GetMonitorMessage()
func (*MonitorServer) InitCallBack ¶
func (m *MonitorServer) InitCallBack()
func (*MonitorServer) Restart ¶
func (m *MonitorServer) Restart() error
func (*MonitorServer) Start ¶
func (m *MonitorServer) Start() error
func (*MonitorServer) Stop ¶
func (m *MonitorServer) Stop() error
type PluginContainer ¶
type PluginContainer struct {
// contains filtered or unexported fields
}
func (*PluginContainer) ChangeConfCallBack ¶
func (c *PluginContainer) ChangeConfCallBack()
func (*PluginContainer) DestructCallBack ¶
func (c *PluginContainer) DestructCallBack()
func (*PluginContainer) InitCallBack ¶
func (c *PluginContainer) InitCallBack()
func (*PluginContainer) NewPluginManager ¶
func (c *PluginContainer) NewPluginManager(mcServer server.MinecraftServer) plugin_interface.PluginManager
func (*PluginContainer) RegisterPlugin ¶
func (c *PluginContainer) RegisterPlugin(p plugin_interface.Plugin)
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
func (*PluginManager) AddPlugin ¶
func (m *PluginManager) AddPlugin(p plugin_interface.Plugin)
动态添加插件
func (*PluginManager) BanPlugin ¶
func (m *PluginManager) BanPlugin(pluginId string)
func (*PluginManager) ChangeConfCallBack ¶
func (m *PluginManager) ChangeConfCallBack()
func (*PluginManager) DestructCallBack ¶
func (m *PluginManager) DestructCallBack()
func (*PluginManager) GetAblePlugins ¶
func (m *PluginManager) GetAblePlugins() map[string]plugin_interface.Plugin
func (*PluginManager) GetDisablePlugins ¶
func (m *PluginManager) GetDisablePlugins() map[string]plugin_interface.Plugin
func (*PluginManager) HandleMessage ¶
func (m *PluginManager) HandleMessage(msg *models.ReciveMessage)
func (*PluginManager) InitCallBack ¶
func (m *PluginManager) InitCallBack()
func (*PluginManager) UnbanPlugin ¶
func (m *PluginManager) UnbanPlugin(pluginId string)
type ServerAdapter ¶ added in v1.1.0
type ServerAdapter struct {
// contains filtered or unexported fields
}
func (*ServerAdapter) GetGameSaveRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetGameSaveRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
游戏保存(结束)
func (*ServerAdapter) GetGameStartRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetGameStartRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
游戏开始
func (*ServerAdapter) GetGameTypeRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetGameTypeRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
获取游戏模式
func (*ServerAdapter) GetMessageRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetMessageRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
=================================游戏事件 解析服务器消息
func (*ServerAdapter) GetPlayerAdvancementRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetPlayerAdvancementRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
获得成就
func (*ServerAdapter) GetPlayerDeathRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetPlayerDeathRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
玩家死亡
func (*ServerAdapter) GetPlayerJoinRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetPlayerJoinRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
加入游戏
func (*ServerAdapter) GetPlayerLeftRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetPlayerLeftRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
离开游戏
func (*ServerAdapter) GetVersionRegularExpression ¶ added in v1.1.0
func (sa *ServerAdapter) GetVersionRegularExpression(originMsg string) (res *models.ReciveMessage, ok bool)
获取版本
Source Files ¶
Click to show internal directories.
Click to hide internal directories.