server

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const SYSTEM_CALL_REQUEST = 0x00001000

Variables

This section is empty.

Functions

This section is empty.

Types

type IBaseServer

type IBaseServer interface {
	IsFrozen() bool
	Opcodes() Opcodes
	ActorsCount() int
	IncrementActorsCount(IActor)
	Scheduler() IScheduler
	Logger() ILogger
	Localizer() ILocalizer
	Push(IActor, messaging.IPushMessage) error
	Broadcast(uint64, Pointer) error
	BroadcastSpecific(uint64, map[string]Pointer) error
}

type IPipeline added in v1.14.0

type IPipeline interface {
	Actor() IActor
	Operation() IOperation
	Serializer() ISerializer
	Opcode() uint64
	RequestId() uint64
	ResultType() uint64
	ContentType() string
	ApiVersion() int32
	ServerVersion() int32
	ClientVersion() int32
	ClientLatestVersion() int32
	ClientName() string
	IsFrozen() bool
	IsSystemCall() bool
	Sign([]byte) string
	Signature() string
	IsAcceptable(IOperationResult) bool

	ServiceUnavailable(...error) IOperationResult
	InternalServerError(...error) IOperationResult
	NotImplemented(...error) IOperationResult
	Unauthorized(...error) IOperationResult
	BadRequest(...error) IOperationResult
}

type IServer

type IServer interface {
	IBaseServer

	Start()
	Shutdown()

	OnServerStarted(func())
	OnActorConnected(func(string))
	OnActorDisconnected(func(string))

	SetSecurityHandler(ISecurityHandler)

	Version() int32
	RegisterClientVersion(string, int32)
	ResolveClientVersion(string) int32
	Configuration() IConfiguration

	ActiveEndpoint() string
	PassiveEndpoint() string

	OnStorageUpdated() func(...string)

	Serializers() map[string]ISerializer
	Serializer(IWriter) ISerializer

	MeasurementsProvider() IMeasurementsProvider
	SetMeasurementsProvider(IMeasurementsProvider)

	EmailProvider() IEmailProvider
	SetEmailProvider(IEmailProvider)

	SMSProvider() ISMSProvider
	SetSMSProvider(ISMSProvider)

	Actor(string) (IActor, error)
	Session(string) (ISystemObject, error)
	SetSession(string, ISystemObject) error

	OnData(IActor, []byte) IOperationResult
	OnOperationRequest(IPipeline, IOperationRequest) IOperationResult

	OnSocketConnected(IActor)
	OnSocketDisconnected(IActor)

	RegisterOperation(IOperation) error
	RegisterOperations(...IOperation) error

	RegisterHttpHandler(IHttpHandler) error
	RegisterHttpHandlers(...IHttpHandler) error

	SetAsciiArt(string)
	SetHUDEnabled(bool)
}

type IServerError

type IServerError interface {
	GetMessage() string
	GetDescription() string
}

type Opcodes

type Opcodes map[uint64]string

Jump to

Keyboard shortcuts

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