Documentation
¶
Index ¶
- Constants
- Variables
- func GroupRule(ctx *zero.Ctx) bool
- type BaseComponent
- type BaseMessageEvent
- type BaseNoticeEvent
- type BasePlayer
- type ClickEvent
- type ClickEventAction
- type Color
- type Config
- type ForwardServer
- type Group
- type HoverEntity
- type HoverEvent
- type HoverEventAction
- type HoverItem
- type MessageData
- type MessageSegment
- type MinecraftBot
- type RCONClientConn
- type RCONConn
- func (r *RCONConn) AcceptCmd() (string, error)
- func (r *RCONConn) AcceptLogin(password string) error
- func (r *RCONConn) Cmd(cmd string) error
- func (r *RCONConn) ReadPacket() (RequestID, Type int32, Payload string, err error)
- func (r *RCONConn) Resp() (resp string, err error)
- func (r *RCONConn) RespCmd(resp string) error
- func (r *RCONConn) WritePacket(RequestID, Type int32, Payload string) error
- type RCONListener
- type RCONServerConn
- type Server
- type TextComponent
- type WebsocketData
Constants ¶
const MaxRCONPackageSize = 4096
Variables ¶
var GroupList []int64
var McBots = make(map[string]*MinecraftBot)
var PluginConfig = Config{}
Functions ¶
Types ¶
type BaseComponent ¶
type BaseComponent struct { // 加粗 Bold *bool `json:"bold,omitempty"` // 颜色 Color Color `json:"color,omitempty"` // 字体 Font *string `json:"font,omitempty"` // 插入其他内容,未测试 Insertion *string `json:"insertion,omitempty"` // 斜体 Italic *bool `json:"italic,omitempty"` // 模糊的,未测试 Obfuscated *bool `json:"obfuscated,omitempty"` // 删除线 Strikethrough *bool `json:"strikethrough,omitempty"` // 文本 Text string `json:"text"` // 下划线 Underlined *bool `json:"underlined,omitempty"` }
BaseComponent ...
type BaseMessageEvent ¶
type BaseMessageEvent struct { EventName string `json:"event_name"` ServerType string `json:"server_type"` ServerVersion string `json:"server_version"` Message string `json:"message"` MessageID string `json:"message_id"` Player BasePlayer `json:"player"` PostType string `json:"post_type"` ServerName string `json:"server_name"` SubType string `json:"sub_type"` Timestamp int64 `json:"timestamp"` }
BaseMessageEvent ...
type BaseNoticeEvent ¶
type BaseNoticeEvent struct { EventName string `json:"event_name"` Player BasePlayer `json:"player"` PostType string `json:"post_type"` ServerName string `json:"server_name"` SubType string `json:"sub_type"` Timestamp int64 `json:"timestamp"` }
BaseNoticeEvent ...
type BasePlayer ¶
type BasePlayer struct { IsOp *bool `json:"is_op,omitempty"` Nickname string `json:"nickname"` UUID *string `json:"uuid,omitempty"` }
BasePlayer ...
type ClickEvent ¶
type ClickEvent struct { // 行为 Action ClickEventAction `json:"action"` // 值 Value string `json:"value,omitempty"` }
ClickEvent ...
type ClickEventAction ¶
type ClickEventAction string
ClickEventAction ...
const ( ChangePage ClickEventAction = "change_page" CopyToClipboard ClickEventAction = "copy_to_clipboard" OpenFile ClickEventAction = "open_file" OpenURL ClickEventAction = "open_url" RunCommand ClickEventAction = "run_command" SuggestCommand ClickEventAction = "suggest_command" )
type Color ¶
type Color string
const ( Black Color = "black" DarkBlue Color = "dark_blue" DarkGreen Color = "dark_green" DarkAqua Color = "dark_aqua" DarkRed Color = "dark_red" DarkPurple Color = "dark_purple" Gold Color = "gold" Gray Color = "gray" DarkGray Color = "dark_gray" Blue Color = "blue" Green Color = "green" Aqua Color = "aqua" Red Color = "red" LightPurple Color = "light_purple" Yellow Color = "yellow" White Color = "white" )
type ForwardServer ¶
type HoverEntity ¶
type HoverEntity struct { ID string `json:"id,omitempty"` Name BaseComponent `json:"name,omitempty"` Type string `json:"type,omitempty"` }
HoverEntity ...
type HoverEvent ¶
type HoverEvent struct { Action HoverEventAction `json:"action"` Entity *HoverEntity `json:"entity,omitempty"` Item *HoverItem `json:"item,omitempty"` Text []BaseComponent `json:"text,omitempty"` }
HoverEvent ...
type HoverEventAction ¶
type HoverEventAction string
const ( ShowEntity HoverEventAction = "show_entity" ShowItem HoverEventAction = "show_item" ShowText HoverEventAction = "show_text" )
type HoverItem ¶
type HoverItem struct { Count int64 `json:"count,omitempty"` ID string `json:"id,omitempty"` Tag string `json:"tag,omitempty"` }
HoverItem ...
type MessageData ¶
type MessageData struct {
Message []MessageSegment `json:"message"`
}
type MessageSegment ¶
type MessageSegment struct { Data interface{} `json:"data"` Type string `json:"type"` }
MessageSegment ...
type MinecraftBot ¶
type MinecraftBot struct { Websocket *websocket.Conn RconClient *RCONClientConn }
type RCONClientConn ¶
type RCONClientConn interface { Cmd(cmd string) error Resp() (resp string, err error) Close() error }
func DialRCON ¶
func DialRCON(addr string, password string) (client RCONClientConn, err error)
DialRCON connect to a RCON server and return the connection after login. We promise the returned RCONClientConn is an RCONConn, so you can convert them by type assertions if you need call the ReadPacket() or WritePacket() methods.
type RCONListener ¶
func ListenRCON ¶
func ListenRCON(addr string) (*RCONListener, error)
ListenRCON announces on the local network address, accepting RCON clients.
func (*RCONListener) Accept ¶
func (r *RCONListener) Accept() (RCONServerConn, error)
Accept RCON connection for client. We promise the returned RCONServerConn is an RCONConn, so you can convert them by type assertions if you need call the ReadPacket() or WritePacket() methods.
type RCONServerConn ¶
type RCONServerConn interface { AcceptLogin(password string) error AcceptCmd() (cmd string, err error) RespCmd(resp string) error Close() error }
RCONServerConn is the connection in the server side.
type TextComponent ¶
type TextComponent struct { // 加粗 Bold *bool `json:"bold,omitempty"` // 点击事件 ClickEvent *ClickEvent `json:"click_event,omitempty"` // 颜色 Color Color `json:"color,omitempty"` // 字体 Font *string `json:"font,omitempty"` // 悬停事件 HoverEvent *HoverEvent `json:"hover_event,omitempty"` // 插入其他内容,未测试 Insertion *string `json:"insertion,omitempty"` // 斜体 Italic *bool `json:"italic,omitempty"` // 模糊的,未测试 Obfuscated *bool `json:"obfuscated,omitempty"` // 删除线 Strikethrough *bool `json:"strikethrough,omitempty"` // 文本 Text string `json:"text"` // 下划线 Underlined *bool `json:"underlined,omitempty"` }
TextComponent ...
type WebsocketData ¶
WebsocketData ...