conversations

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

func ConvFilePath(zone string, mobId int) string

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

func DeleteConversationFile(zone string, mobId int) error

DeleteConversationFile removes a conversation file from disk and invalidates the in-memory existence cache for that entry.

func Destroy

func Destroy(conversationId int)

func GetMemoryUsage added in v0.9.8

func GetMemoryUsage() map[string]util.MemoryResult

func GetNextActions

func GetNextActions(convId int) (mob1 int, mob2 int, actions []string)

func HasConverseFile

func HasConverseFile(mobId int, zone string) bool

func IsComplete

func IsComplete(conversationId int) bool

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

func ZoneNameSanitize(zone string) string

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

type ConversationFile struct {
	Zone  string `json:"zone"`
	MobId int    `json:"mob_id"`
}

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.

Jump to

Keyboard shortcuts

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