server

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LaunchRequest

type LaunchRequest struct {
	Username            string            `json:"username"`
	Password            string            `json:"password"`
	AuthServer          string            `json:"auth_server"`
	CharacterName       string            `json:"character_name"`
	RealmIndex          int               `json:"realm_index"`
	Race                uint8             `json:"race"`
	Class               uint8             `json:"class"`
	Gender              uint8             `json:"gender"`
	Mode                string            `json:"mode"`
	DungeonName         string            `json:"dungeon_name"`
	DataDir             string            `json:"data_dir"`
	PathfindingAddr     string            `json:"pathfinding_addr"`
	LuaScript           string            `json:"lua_script"`
	LuaCode             string            `json:"lua_code"`
	AIBundle            scenario.AIBundle `json:"ai_bundle"`
	BotID               string            `json:"bot_id"`
	DeleteExistingChars bool              `json:"delete_existing_chars"`
	DisableTargetCache  bool              `json:"disable_target_cache"`
	LogDecisionsToChat  bool              `json:"log_decisions_to_chat"`

	// Validation tooling (propagated from orchestrator/scenario; default false = no perf cost)
	ValidationMode      bool   `json:"validation_mode"`
	ValidationLogPath   string `json:"validation_log"`
	EnablePacketTrace   bool   `json:"enable_packet_trace"`
	EnableDetailedAuras bool   `json:"enable_detailed_auras"`
}

LaunchRequest is the request body for launching a new bot (extended for AI/Scenario support).

type LaunchResponse

type LaunchResponse struct {
	ID      string `json:"id"`
	Message string `json:"message"`
}

LaunchResponse is the response body for a launch request.

type LuaUpdateRequest

type LuaUpdateRequest struct {
	BotID   string `json:"bot_id"`
	LuaCode string `json:"lua_code"`
}

LuaUpdateRequest is the request body for updating Lua code on a running bot.

type NodeLaunchRequest

type NodeLaunchRequest struct {
	BotID               string            `json:"bot_id"`
	Username            string            `json:"username"`
	Password            string            `json:"password"`
	AuthServer          string            `json:"auth_server"`
	CharacterName       string            `json:"character_name"`
	Race                uint8             `json:"race"`
	Class               uint8             `json:"class"`
	Mode                string            `json:"mode"`
	DungeonName         string            `json:"dungeon_name"`
	DataDir             string            `json:"data_dir"`
	PathfindingAddr     string            `json:"pathfinding_addr"`
	LuaScript           string            `json:"lua_script"`
	LuaCode             string            `json:"lua_code"`
	AIBundle            scenario.AIBundle `json:"ai_bundle"`
	DeleteExistingChars bool              `json:"delete_existing_chars"`
	LogDecisionsToChat  bool              `json:"log_decisions_to_chat"`
	DisableTargetCache  bool              `json:"disable_target_cache"`

	// Validation tooling (off by default)
	ValidationMode      bool   `json:"validation_mode"`
	ValidationLogPath   string `json:"validation_log"`
	EnablePacketTrace   bool   `json:"enable_packet_trace"`
	EnableDetailedAuras bool   `json:"enable_detailed_auras"`
}

NodeLaunchRequest mirrors the orchestrator version for wire compatibility in the node/server path.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the HTTP API server for managing bot clients (node mode).

func NewServer

func NewServer() *Server

NewServer creates a new API server

func NewServerWithDefaults

func NewServerWithDefaults(dataDir, pathfindingAddress string) *Server

NewServerWithDefaults creates a node API server with node-local navigation defaults. Docker workers use this to keep container paths such as /data even when the orchestrator runs on a host with a different filesystem layout.

func (*Server) LaunchFromOrchestrator

func (s *Server) LaunchFromOrchestrator(req NodeLaunchRequest) string

LaunchFromOrchestrator starts a bot from an orchestrator request.

func (*Server) Start

func (s *Server) Start(addr string) error

Start starts the HTTP server.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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