Documentation
¶
Index ¶
- func InitializeMessage[T Message, U CreateMessageConstraint[T]](g *GMCP, raw json.RawMessage, message U) error
- type Affliction
- type BaseMessage
- type CharAfflictionsAddMessage
- type CharAfflictionsListMessage
- type CharAfflictionsRemoveMessage
- type CharDefencesAddMessage
- type CharDefencesListMessage
- type CharDefencesRemoveMessage
- type CharItemsAddMessage
- type CharItemsContentsMessage
- type CharItemsInvMessage
- type CharItemsListMessage
- type CharItemsRemoveMessage
- type CharItemsRoomMessage
- type CharItemsUpdateMessage
- type CharLoginCredentialsMessage
- type CharLoginDefaultMessage
- type CharLoginMessage
- type CharLoginResultMessage
- type CharName
- type CharNameMessage
- type CharSkillsGetMessage
- type CharSkillsGroupsMessage
- type CharSkillsInfoMessage
- type CharSkillsListMessage
- type CharStatusMessage
- type CharStatusVarsMessage
- type CharVitalsMessage
- type ClientMapMessage
- type ClientMediaDefaultMessage
- type ClientMediaLoadMessage
- type ClientMediaPlayMessage
- type ClientMediaStopMessage
- type CommChannel
- type CommChannelEnableMessage
- type CommChannelListMessage
- type CommChannelPlayersClientMessage
- type CommChannelPlayersServerMessage
- type CommChannelTextMessage
- type CommPlayer
- type CoreGoodbyeMessage
- type CoreHelloMessage
- type CoreKeepAliveMessage
- type CorePingClientMessage
- type CorePingServerMessage
- type CoreSupportsAddMessage
- type CoreSupportsRemoveMessage
- type CoreSupportsSetMessage
- type CreateMessageConstraint
- type Defence
- type ExternalDiscordGetMessage
- type ExternalDiscordHelloMessage
- type ExternalDiscordInfoMessage
- type ExternalDiscordStatusMessage
- type GMCP
- func (g *GMCP) AddPackages(pkgs ...Package) error
- func (g *GMCP) RemovePackage(pkgs ...Package) error
- func (g *GMCP) SendMessage(message Message) error
- func (g *GMCP) Subnegotiate(subnegotiation []byte) error
- func (g *GMCP) SubnegotiationString(subnegotiation []byte) (string, error)
- func (g *GMCP) TransitionLocalState(newState telnet.TelOptState) (func() error, error)
- func (g *GMCP) TransitionRemoteState(newState telnet.TelOptState) (func() error, error)
- type Item
- type ItemAttributes
- type MapMessage
- type Message
- type MessageData
- type MessageFactory
- type MessageInitialize
- type Package
- func NewPackageChar() Package
- func NewPackageCharAfflictions() Package
- func NewPackageCharDefences() Package
- func NewPackageCharItems() Package
- func NewPackageCharLogin() Package
- func NewPackageCharSkills() Package
- func NewPackageClient() Package
- func NewPackageClientMedia() Package
- func NewPackageCommChannel() Package
- func NewPackageCore() Package
- func NewPackageExternalDiscord() Package
- func NewPackageRedirect() Package
- func NewPackageRoom() Package
- type RedirectWindowMessage
- type RoomAddPlayerMessage
- type RoomInfoMessage
- type RoomPlayersMessage
- type RoomRemovePlayerMessage
- type RoomWrongDirMessage
- type UnknownMessage
- type ValueMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeMessage ¶
func InitializeMessage[T Message, U CreateMessageConstraint[T]](g *GMCP, raw json.RawMessage, message U) error
Types ¶
type Affliction ¶
type BaseMessage ¶
type BaseMessage struct {
telopts.BaseTelOptEvent `json:"-"`
// contains filtered or unexported fields
}
func (*BaseMessage) InitializeAsEvent ¶
func (m *BaseMessage) InitializeAsEvent(g *GMCP, message Message, raw json.RawMessage)
func (BaseMessage) RawMessage ¶
func (m BaseMessage) RawMessage() json.RawMessage
func (BaseMessage) String ¶
func (m BaseMessage) String() string
type CharAfflictionsAddMessage ¶
type CharAfflictionsAddMessage struct {
BaseMessage
ValueMessage[[]Affliction]
}
func (CharAfflictionsAddMessage) ID ¶
func (m CharAfflictionsAddMessage) ID() string
type CharAfflictionsListMessage ¶
type CharAfflictionsListMessage struct {
BaseMessage
ValueMessage[[]Affliction]
}
func (CharAfflictionsListMessage) ID ¶
func (m CharAfflictionsListMessage) ID() string
type CharAfflictionsRemoveMessage ¶
type CharAfflictionsRemoveMessage struct {
BaseMessage
ValueMessage[[]string]
}
func (CharAfflictionsRemoveMessage) ID ¶
func (m CharAfflictionsRemoveMessage) ID() string
type CharDefencesAddMessage ¶
type CharDefencesAddMessage struct {
BaseMessage
Defence
}
func (CharDefencesAddMessage) ID ¶
func (m CharDefencesAddMessage) ID() string
type CharDefencesListMessage ¶
type CharDefencesListMessage struct {
BaseMessage
ValueMessage[[]Defence]
}
func (CharDefencesListMessage) ID ¶
func (m CharDefencesListMessage) ID() string
type CharDefencesRemoveMessage ¶
type CharDefencesRemoveMessage struct {
BaseMessage
ValueMessage[[]string]
}
func (CharDefencesRemoveMessage) ID ¶
func (m CharDefencesRemoveMessage) ID() string
type CharItemsAddMessage ¶
type CharItemsAddMessage struct {
BaseMessage
Location string `json:"location"`
Item Item `json:"item"`
}
func (CharItemsAddMessage) ID ¶
func (m CharItemsAddMessage) ID() string
type CharItemsContentsMessage ¶
type CharItemsContentsMessage struct {
BaseMessage
ValueMessage[int]
}
func (CharItemsContentsMessage) ID ¶
func (m CharItemsContentsMessage) ID() string
type CharItemsInvMessage ¶
type CharItemsInvMessage struct {
BaseMessage
}
func (CharItemsInvMessage) ID ¶
func (m CharItemsInvMessage) ID() string
type CharItemsListMessage ¶
type CharItemsListMessage struct {
BaseMessage
Location string `json:"location"`
Items []Item `json:"items"`
}
func (CharItemsListMessage) ID ¶
func (m CharItemsListMessage) ID() string
type CharItemsRemoveMessage ¶
type CharItemsRemoveMessage struct {
BaseMessage
Location string `json:"location"`
Item Item `json:"item"`
}
func (CharItemsRemoveMessage) ID ¶
func (m CharItemsRemoveMessage) ID() string
type CharItemsRoomMessage ¶
type CharItemsRoomMessage struct {
BaseMessage
}
func (CharItemsRoomMessage) ID ¶
func (m CharItemsRoomMessage) ID() string
type CharItemsUpdateMessage ¶
type CharItemsUpdateMessage struct {
BaseMessage
Location string `json:"location"`
Item Item `json:"item"`
}
func (CharItemsUpdateMessage) ID ¶
func (m CharItemsUpdateMessage) ID() string
type CharLoginCredentialsMessage ¶
type CharLoginCredentialsMessage struct {
BaseMessage
Account string `json:"account"`
Password string `json:"password"`
}
func (CharLoginCredentialsMessage) ID ¶
func (m CharLoginCredentialsMessage) ID() string
type CharLoginDefaultMessage ¶
type CharLoginDefaultMessage struct {
BaseMessage
Type []string `json:"type"`
Location string `json:"location"`
}
func (CharLoginDefaultMessage) ID ¶
func (m CharLoginDefaultMessage) ID() string
type CharLoginMessage ¶
type CharLoginMessage struct {
BaseMessage
Name string `json:"name"`
Password string `json:"password"`
}
func (CharLoginMessage) ID ¶
func (m CharLoginMessage) ID() string
type CharLoginResultMessage ¶
type CharLoginResultMessage struct {
BaseMessage
Success bool `json:"success"`
Message string `json:"message"`
}
func (CharLoginResultMessage) ID ¶
func (m CharLoginResultMessage) ID() string
type CharNameMessage ¶
type CharNameMessage struct {
BaseMessage
CharName
}
func (CharNameMessage) ID ¶
func (m CharNameMessage) ID() string
type CharSkillsGetMessage ¶
type CharSkillsGetMessage struct {
BaseMessage
Group string `json:"group"`
Name string `json:"name"`
}
func (CharSkillsGetMessage) ID ¶
func (m CharSkillsGetMessage) ID() string
type CharSkillsGroupsMessage ¶
type CharSkillsGroupsMessage struct {
BaseMessage
Name string `json:"name"`
Rank string `json:"rank"`
}
func (CharSkillsGroupsMessage) ID ¶
func (m CharSkillsGroupsMessage) ID() string
type CharSkillsInfoMessage ¶
type CharSkillsInfoMessage struct {
BaseMessage
Group string `json:"group"`
Skill string `json:"skill"`
Info string `json:"info"`
}
func (CharSkillsInfoMessage) ID ¶
func (m CharSkillsInfoMessage) ID() string
type CharSkillsListMessage ¶
type CharSkillsListMessage struct {
BaseMessage
Group string `json:"group"`
Description []string `json:"desc"`
List []string `json:"list"`
}
func (CharSkillsListMessage) ID ¶
func (m CharSkillsListMessage) ID() string
type CharStatusMessage ¶
type CharStatusMessage struct {
BaseMessage
MapMessage
}
func (CharStatusMessage) ID ¶
func (m CharStatusMessage) ID() string
type CharStatusVarsMessage ¶
type CharStatusVarsMessage struct {
BaseMessage
MapMessage
}
func (CharStatusVarsMessage) ID ¶
func (m CharStatusVarsMessage) ID() string
type CharVitalsMessage ¶
type CharVitalsMessage struct {
BaseMessage
MapMessage
}
func (CharVitalsMessage) ID ¶
func (m CharVitalsMessage) ID() string
func (*CharVitalsMessage) StringValue ¶
func (m *CharVitalsMessage) StringValue() string
type ClientMapMessage ¶
type ClientMapMessage struct {
BaseMessage
URL string `json:"url"`
}
func (ClientMapMessage) ID ¶
func (m ClientMapMessage) ID() string
type ClientMediaDefaultMessage ¶
type ClientMediaDefaultMessage struct {
BaseMessage
URL string `json:"url"`
}
func (ClientMediaDefaultMessage) ID ¶
func (m ClientMediaDefaultMessage) ID() string
type ClientMediaLoadMessage ¶
type ClientMediaLoadMessage struct {
BaseMessage
Name string `json:"name"`
URL string `json:"url"`
}
func (ClientMediaLoadMessage) ID ¶
func (m ClientMediaLoadMessage) ID() string
type ClientMediaPlayMessage ¶
type ClientMediaPlayMessage struct {
BaseMessage
Name string `json:"name"`
URL string `json:"url"`
Type string `json:"type"`
Tag string `json:"tag"`
Volume int `json:"volume"`
FadeIn int `json:"fadein"`
FadeOut int `json:"fadeout"`
Start int `json:"start"`
Finish int `json:"finish"`
Loops int `json:"loops"`
Priority int `json:"priority"`
Continue bool `json:"continue"`
Key string `json:"key"`
}
func (ClientMediaPlayMessage) ID ¶
func (m ClientMediaPlayMessage) ID() string
type ClientMediaStopMessage ¶
type ClientMediaStopMessage struct {
BaseMessage
Name string `json:"name"`
Type string `json:"type"`
Tag string `json:"tag"`
Priority int `json:"priority"`
Key string `json:"key"`
FadeAway bool `json:"fadeaway"`
FadeOut int `json:"fadeout"`
}
func (ClientMediaStopMessage) ID ¶
func (m ClientMediaStopMessage) ID() string
type CommChannel ¶
type CommChannelEnableMessage ¶
type CommChannelEnableMessage struct {
BaseMessage
ValueMessage[string]
}
func (CommChannelEnableMessage) ID ¶
func (m CommChannelEnableMessage) ID() string
type CommChannelListMessage ¶
type CommChannelListMessage struct {
BaseMessage
ValueMessage[[]CommChannel]
}
func (CommChannelListMessage) ID ¶
func (m CommChannelListMessage) ID() string
type CommChannelPlayersClientMessage ¶
type CommChannelPlayersClientMessage struct {
BaseMessage
}
func (CommChannelPlayersClientMessage) ID ¶
func (m CommChannelPlayersClientMessage) ID() string
type CommChannelPlayersServerMessage ¶
type CommChannelPlayersServerMessage struct {
BaseMessage
ValueMessage[[]CommPlayer]
}
func (CommChannelPlayersServerMessage) ID ¶
func (m CommChannelPlayersServerMessage) ID() string
type CommChannelTextMessage ¶
type CommChannelTextMessage struct {
BaseMessage
Channel string `json:"channel"`
Talker string `json:"talker"`
Text string `json:"text"`
}
func (CommChannelTextMessage) ID ¶
func (m CommChannelTextMessage) ID() string
type CommPlayer ¶
type CoreGoodbyeMessage ¶
type CoreGoodbyeMessage struct {
BaseMessage
ValueMessage[string]
}
func (CoreGoodbyeMessage) ID ¶
func (m CoreGoodbyeMessage) ID() string
type CoreHelloMessage ¶
type CoreHelloMessage struct {
BaseMessage
Client string `json:"client"`
Version string `json:"version"`
}
func (CoreHelloMessage) ID ¶
func (m CoreHelloMessage) ID() string
type CoreKeepAliveMessage ¶
type CoreKeepAliveMessage struct {
BaseMessage
}
func (CoreKeepAliveMessage) ID ¶
func (m CoreKeepAliveMessage) ID() string
type CorePingClientMessage ¶
type CorePingClientMessage struct {
BaseMessage
ValueMessage[int]
}
func (CorePingClientMessage) ID ¶
func (m CorePingClientMessage) ID() string
type CorePingServerMessage ¶
type CorePingServerMessage struct {
BaseMessage
}
func (CorePingServerMessage) ID ¶
func (m CorePingServerMessage) ID() string
type CoreSupportsAddMessage ¶
type CoreSupportsAddMessage struct {
BaseMessage
ValueMessage[[]string]
}
func (CoreSupportsAddMessage) ID ¶
func (m CoreSupportsAddMessage) ID() string
type CoreSupportsRemoveMessage ¶
type CoreSupportsRemoveMessage struct {
BaseMessage
ValueMessage[[]string]
}
func (CoreSupportsRemoveMessage) ID ¶
func (m CoreSupportsRemoveMessage) ID() string
type CoreSupportsSetMessage ¶
type CoreSupportsSetMessage struct {
BaseMessage
ValueMessage[[]string]
}
func (CoreSupportsSetMessage) ID ¶
func (m CoreSupportsSetMessage) ID() string
type CreateMessageConstraint ¶
type CreateMessageConstraint[T Message] interface { *T MessageInitialize }
type ExternalDiscordGetMessage ¶
type ExternalDiscordGetMessage struct {
BaseMessage
}
func (ExternalDiscordGetMessage) ID ¶
func (m ExternalDiscordGetMessage) ID() string
type ExternalDiscordHelloMessage ¶
type ExternalDiscordHelloMessage struct {
BaseMessage
User string `json:"user"`
Private bool `json:"private"`
}
func (ExternalDiscordHelloMessage) ID ¶
func (m ExternalDiscordHelloMessage) ID() string
type ExternalDiscordInfoMessage ¶
type ExternalDiscordInfoMessage struct {
BaseMessage
InviteURL string `json:"inviteurl,omitempty"`
ApplicationID string `json:"applicationid,omitempty"`
}
func (ExternalDiscordInfoMessage) ID ¶
func (m ExternalDiscordInfoMessage) ID() string
type ExternalDiscordStatusMessage ¶
type ExternalDiscordStatusMessage struct {
BaseMessage
SmallImage []string `json:"smallimage"`
SmallImageText string `json:"smallimagetext"`
Details string `json:"details"`
State string `json:"state"`
PartySize int `json:"partysize"`
PartyMax int `json:"partymax"`
Game string `json:"game"`
StartTime string `json:"starttime,omitempty"`
EndTime string `json:"endtime,omitempty"`
}
func (ExternalDiscordStatusMessage) ID ¶
func (m ExternalDiscordStatusMessage) ID() string
type GMCP ¶
type GMCP struct {
telopts.BaseTelOpt
// contains filtered or unexported fields
}
func RegisterGMCP ¶
func RegisterGMCP(usage telnet.TelOptUsage, clientInfo mudopts.ClientInfo, packages ...Package) *GMCP
func (*GMCP) AddPackages ¶
func (*GMCP) RemovePackage ¶
func (*GMCP) SendMessage ¶
func (*GMCP) Subnegotiate ¶
func (*GMCP) SubnegotiationString ¶
func (*GMCP) TransitionLocalState ¶
func (g *GMCP) TransitionLocalState(newState telnet.TelOptState) (func() error, error)
func (*GMCP) TransitionRemoteState ¶
func (g *GMCP) TransitionRemoteState(newState telnet.TelOptState) (func() error, error)
type Item ¶
type Item struct {
ID int `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
Attrib ItemAttributes `json:"attrib"`
}
type ItemAttributes ¶
type ItemAttributes int
const ( ItemAttWorn ItemAttributes = 1 << iota ItemAttWearableNotWorn ItemAttWieldedLeft ItemAttWieldedRight ItemAttGroupable ItemAttContainer ItemAttRiftable ItemAttFluid ItemAttEditable ItemAttMonster ItemAttDeadMonster ItemAttTakeable ItemAttNoTarget )
func ParseItemAttributes ¶
func ParseItemAttributes(s string) ItemAttributes
func (*ItemAttributes) MarshalJSON ¶
func (i *ItemAttributes) MarshalJSON() ([]byte, error)
func (ItemAttributes) String ¶
func (a ItemAttributes) String() string
func (*ItemAttributes) UnmarshalJSON ¶
func (i *ItemAttributes) UnmarshalJSON(data []byte) error
type MapMessage ¶
type MapMessage struct {
// contains filtered or unexported fields
}
func NewMapMessage ¶
func NewMapMessage(ignoreKeys ...string) MapMessage
func (*MapMessage) Keys ¶
func (m *MapMessage) Keys(yield func(string) bool)
func (MapMessage) MarshalJSON ¶
func (m MapMessage) MarshalJSON() ([]byte, error)
func (*MapMessage) SetValue ¶
func (m *MapMessage) SetValue(key string, value any)
func (*MapMessage) UnmarshalJSON ¶
func (m *MapMessage) UnmarshalJSON(data []byte) error
type Message ¶
type Message interface {
ID() string
RawMessage() json.RawMessage
telnet.TelOptEvent
}
func CreateMessage ¶
func CreateMessage[T Message, U CreateMessageConstraint[T]](g *GMCP, raw json.RawMessage) (Message, error)
type MessageData ¶
type MessageData struct {
Sender telnet.TerminalSide
Create MessageFactory
}
type MessageFactory ¶
type MessageFactory func(g *GMCP, raw json.RawMessage) (Message, error)
type MessageInitialize ¶
type MessageInitialize interface {
InitializeAsEvent(g *GMCP, message Message, raw json.RawMessage)
}
type Package ¶
type Package struct {
ID string
Version int
Messages []MessageData
}
func NewPackageChar ¶
func NewPackageChar() Package
func NewPackageCharAfflictions ¶
func NewPackageCharAfflictions() Package
func NewPackageCharDefences ¶
func NewPackageCharDefences() Package
func NewPackageCharItems ¶
func NewPackageCharItems() Package
func NewPackageCharLogin ¶
func NewPackageCharLogin() Package
func NewPackageCharSkills ¶
func NewPackageCharSkills() Package
func NewPackageClient ¶
func NewPackageClient() Package
func NewPackageClientMedia ¶
func NewPackageClientMedia() Package
func NewPackageCommChannel ¶
func NewPackageCommChannel() Package
func NewPackageCore ¶
func NewPackageCore() Package
func NewPackageExternalDiscord ¶
func NewPackageExternalDiscord() Package
func NewPackageRedirect ¶
func NewPackageRedirect() Package
func NewPackageRoom ¶
func NewPackageRoom() Package
func (Package) AllMessages ¶
func (p Package) AllMessages(yield func(MessageData) bool)
type RedirectWindowMessage ¶
type RedirectWindowMessage struct {
BaseMessage
ValueMessage[string]
}
func (RedirectWindowMessage) ID ¶
func (m RedirectWindowMessage) ID() string
type RoomAddPlayerMessage ¶
type RoomAddPlayerMessage struct {
BaseMessage
CharName
}
func (RoomAddPlayerMessage) ID ¶
func (m RoomAddPlayerMessage) ID() string
type RoomInfoMessage ¶
type RoomInfoMessage struct {
BaseMessage
Number int `json:"num"`
Name string `json:"name"`
Area string `json:"area"`
Environment string `json:"environment"`
Coords string `json:"coords"`
Map string `json:"map"`
Details []string `json:"details"`
Exits map[string]int `json:"exits"`
}
func (RoomInfoMessage) ID ¶
func (m RoomInfoMessage) ID() string
type RoomPlayersMessage ¶
type RoomPlayersMessage struct {
BaseMessage
ValueMessage[[]CharName]
}
func (RoomPlayersMessage) ID ¶
func (m RoomPlayersMessage) ID() string
type RoomRemovePlayerMessage ¶
type RoomRemovePlayerMessage struct {
BaseMessage
ValueMessage[string]
}
func (RoomRemovePlayerMessage) ID ¶
func (m RoomRemovePlayerMessage) ID() string
type RoomWrongDirMessage ¶
type RoomWrongDirMessage struct {
BaseMessage
ValueMessage[string]
}
func (RoomWrongDirMessage) ID ¶
func (m RoomWrongDirMessage) ID() string
type UnknownMessage ¶
type UnknownMessage struct {
telopts.BaseTelOptEvent
MapMessage
// contains filtered or unexported fields
}
func (UnknownMessage) ID ¶
func (m UnknownMessage) ID() string
func (UnknownMessage) RawMessage ¶
func (m UnknownMessage) RawMessage() json.RawMessage
func (UnknownMessage) String ¶
func (m UnknownMessage) String() string
type ValueMessage ¶
type ValueMessage[T any] struct { Value T }
func (ValueMessage[T]) MarshalJSON ¶
func (m ValueMessage[T]) MarshalJSON() ([]byte, error)
func (*ValueMessage[T]) UnmarshalJSON ¶
func (m *ValueMessage[T]) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.