Documentation
¶
Index ¶
- func AttemptConversation(initiatorMobId int, initatorInstanceId int, initiatorName string, ...) int
- func ConvFilePath(zone string, mobId int) string
- func DeleteConversationFile(zone string, mobId int) error
- func Destroy(conversationId int)
- func GetMemoryUsage() map[string]util.MemoryResult
- func GetNextActions(convId int) (mob1 int, mob2 int, actions []string)
- func HasConverseFile(mobId int, zone string) bool
- func IsComplete(conversationId int) bool
- func SaveConversationFile(zone string, mobId int, convs []ConversationData) error
- func ZoneNameSanitize(zone string) string
- type Conversation
- type ConversationData
- type ConversationFile
- type ConversationFileContents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttemptConversation ¶
func AttemptConversation(initiatorMobId int, initatorInstanceId int, initiatorName string, participantInstanceId int, participantName string, zone string, forceIndex ...int) int
Returns a non empty ConversationId if successful
func ConvFilePath ¶ added in v0.9.8
ConvFilePath returns the absolute path for a conversation file identified by zone and mobId. The zone name is sanitized before constructing the path.
func DeleteConversationFile ¶ added in v0.9.8
DeleteConversationFile removes a conversation file from disk and invalidates the in-memory existence cache for that entry.
func GetMemoryUsage ¶ added in v0.9.8
func GetMemoryUsage() map[string]util.MemoryResult
func HasConverseFile ¶
func IsComplete ¶
func SaveConversationFile ¶ added in v0.9.8
func SaveConversationFile(zone string, mobId int, convs []ConversationData) error
SaveConversationFile validates and writes a conversation file to disk, then invalidates the in-memory existence cache for that entry.
func ZoneNameSanitize ¶
Types ¶
type Conversation ¶
type Conversation struct {
Id int
MobInstanceId1 int
MobInstanceId2 int
StartRound uint64
LastRound uint64
// What the actions are and where we are in them
Position int
ActionList [][]string
}
func (*Conversation) NextActions ¶
func (c *Conversation) NextActions(roundNow uint64) []string
type ConversationData ¶
type ConversationData struct {
// A map of lowercase names of "Initiator" (#1) to array of
// "Participant" (#2) names allowed to use this conversation.
Supported map[string][]string `yaml:"Supported"`
// A list of command lists, each prefixed with which Mob should execute
// the action (#1 or #2)
Conversation [][]string `yaml:"Conversation"`
}
type ConversationFile ¶ added in v0.9.8
ConversationFile identifies a single conversation file by zone and mob ID.
func ListConversationFiles ¶ added in v0.9.8
func ListConversationFiles() ([]ConversationFile, error)
ListConversationFiles returns a sorted list of every conversation file on disk.
type ConversationFileContents ¶ added in v0.9.8
type ConversationFileContents struct {
ConversationFile
Conversations []ConversationData `json:"conversations"`
}
ConversationFileContents pairs a file's identity with its conversation entries.
func GetConversationFile ¶ added in v0.9.8
func GetConversationFile(zone string, mobId int) (ConversationFileContents, error)
GetConversationFile reads and returns the contents of a single conversation file.