lib

package
v0.0.0-...-246bd56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteDevelopLog

func WriteDevelopLog(level string, msg string)

写入开发日志

func WriteRuntimeLog

func WriteRuntimeLog(level string, msg string, serverName string)

写入运行日志

Types

type Parser

type Parser interface {
	Parsing(string) (*command.Command, bool)
}

type Plugin

type Plugin interface {
	Handle(*command.Command, Server)
	Init(Server)
	Close()
}

type Server

type Server interface {
	Say(...interface{})                      //在服务器中全局说话
	Tell(string, ...interface{})             //对某人私聊
	Execute(string)                          //执行mc原生命令
	Close()                                  //关闭服务器(适用于单服务器)
	CloseInContainer()                       //在容器中关闭服务器
	Back(string)                             //回档
	Restart()                                //重启
	Start(string, []string, string)          //开启一个服务器实例
	Getinfo() string                         //获取服务器基本信息
	Clone(string) Server                     //克隆一个服务器实例
	GetPort() string                         //获取服务器端口
	ReloadConf()                             //重新获取配置
	RunPlugin(*command.Command)              //运行一个插件命令
	RunUniquePlugin(func())                  //在所有命令完成后执行
	WriteLog(level string, msg string)       //写入日志
	GetPluginList() map[string]Plugin        //获取可用插件列表
	GetDisablePluginList() map[string]Plugin //获取不可用插件列表
	GetParserList() []Parser                 //获取语法解释器列表
	RegParser(reg string) ([]string, bool)   //从内存读取字符串并使用正则表达式提取信息
	GetName() string                         //获取服务器名称
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL