server

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BINARY_REQUEST = 0
	TEXT_REQUEST   = 1

	BINARY_RESULT = 3
	TEXT_RESULT   = 4
)

noinspection GoSnakeCaseUsage

Variables

This section is empty.

Functions

This section is empty.

Types

type IBaseServer

type IBaseServer interface {
	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 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

	TextSerializer() ITextSerializer
	BinarySerializer() IBinarySerializer

	TrafficRecorder() ITrafficRecorder

	MeasurementsProvider() IMeasurementsProvider
	SetMeasurementsProvider(IMeasurementsProvider)

	EmailProvider() IEmailProvider
	SetEmailProvider(IEmailProvider)

	SMSProvider() ISMSProvider
	SetSMSProvider(ISMSProvider)

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

	OnActorBinaryData(IActor, []byte) IOperationResult
	OnActorTextData(IActor, string) IOperationResult
	OnActorOperationRequest(IActor, 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 ITrafficRecorder

type ITrafficRecorder interface {
	Record(uint32, ...interface{})
	Start()
	Stop() error
	Load(string) error
	Replay(IServer, float32) error
}

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