engine

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module interface {
	// Name returns the unique identifier of the module.
	Name() string
	// Init initializes the module with the server instance.
	Init(ctx context.Context, srv *Server) error
}

Module represents a pluggable game feature module in Ultimate Game Engine.

type Server

type Server struct {
	Logger         *zap.Logger
	Config         config.Config
	DBPool         *pgxpool.Pool
	SQLDB          *sql.DB
	APIServer      *api.Server
	RuntimeManager *pkgruntime.GoRuntimeManager
	RuntimeModule  pkgruntime.RuntimeModule
	ConsoleServer  *console.Server
	CronScheduler  *pkgruntime.CronScheduler
	LuaVM          *lua.LState
	JSVM           *goja.Runtime
	// contains filtered or unexported fields
}

Server is the programmatically embeddable engine instance for Ultimate Game Engine.

func NewServer

func NewServer(cfg config.Config) (*Server, error)

NewServer initializes a new Ultimate Game Engine server instance from configuration.

func (*Server) RegisterInit

func (s *Server) RegisterInit(fn pkgruntime.InitModuleFunc)

RegisterInit registers a native Go initialization function directly.

func (*Server) Start

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

Start launches the engine listeners, modules, and runtime schedulers.

func (*Server) Stop

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

Stop gracefully shuts down all server listeners and components.

func (*Server) Use

func (s *Server) Use(mod Module)

Use adds a pluggable game feature module to the server.

Jump to

Keyboard shortcuts

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