Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastMessage ¶
type BroadcastMessage struct { Type messages.MessageType Message interface{} }
type BroadcastMessageWorker ¶
type BroadcastMessageWorker struct {
// contains filtered or unexported fields
}
func NewBroadcastMessageWorker ¶
func NewBroadcastMessageWorker(opts NewBroadcastMessageWorkerOptions) *BroadcastMessageWorker
func (*BroadcastMessageWorker) Start ¶
func (w *BroadcastMessageWorker) Start(ctx context.Context)
type ConnectionEventWorker ¶
type ConnectionEventWorker struct {
// contains filtered or unexported fields
}
func NewConnectionEventWorker ¶
func NewConnectionEventWorker(opts NewConnectionEventWorkerOptions) *ConnectionEventWorker
NewConnectionEventWorker creates a new ConnectionEventWorker. The worker processes client events like connect and disconnect and writes server events to a queue for the game loop to process.
func (*ConnectionEventWorker) Start ¶
func (w *ConnectionEventWorker) Start(ctx context.Context)
type NewBroadcastMessageWorkerOptions ¶
type NewBroadcastMessageWorkerOptions struct { ClientManager *network.ClientManager BroadcastMessageChan <-chan BroadcastMessage }
type NewConnectionEventWorkerOptions ¶
type NewConnectionEventWorkerOptions struct { ConnectionEventChan <-chan network.ConnectionEvent Repository repositories.Repository ServerEventQueue queue.Queue }
type NewSaveGameStateWorkerOptions ¶
type NewSaveGameStateWorkerOptions struct { Repository repositories.Repository SaveStateChan <-chan SaveStateRequest }
type SaveGameStateWorker ¶
type SaveGameStateWorker struct {
// contains filtered or unexported fields
}
func NewSaveGameStateWorker ¶
func NewSaveGameStateWorker(opts NewSaveGameStateWorkerOptions) *SaveGameStateWorker
NewSaveGameStateWorker creates a new SaveGameStateWorker. The worker processes save requests from the game loop and periodically saves the game state to the repository.
func (*SaveGameStateWorker) Start ¶
func (w *SaveGameStateWorker) Start(ctx context.Context)
type SaveStateRequest ¶
type SaveStateRequest struct { Timestamp int64 Type SaveStateRequestType State interface{} }
type SaveStateRequestType ¶
type SaveStateRequestType int
const ( SaveStateRequestTypePlayer SaveStateRequestType = iota SaveStateRequestTypeGame )
Click to show internal directories.
Click to hide internal directories.