roomnode

package
v0.0.0-...-2e499f1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoClients = errors.New("no clients in the room")

Functions

func NewGameLogicByTitle

func NewGameLogicByTitle(title string) gamelogic.GameLogic

Types

type GameNodeRequester

type GameNodeRequester interface {
	RequestUpdatingRoomsJSON()
}

type RoomNode

type RoomNode struct {
	Flow runflow.RunFlow

	Clients children.MapChildren[string, *roomclient.RoomClient]
	// contains filtered or unexported fields
}

Layer of RT which is responsible for connections: RoomNode > RoomClients

func NewRoomNode

func NewRoomNode(gameTitle string) *RoomNode

func (*RoomNode) ConfirmConnectToGame

func (roomNode *RoomNode) ConfirmConnectToGame()

func (*RoomNode) ConnectedToGame

func (roomNode *RoomNode) ConnectedToGame() <-chan struct{}

func (*RoomNode) GetID

func (roomNode *RoomNode) GetID() int

func (*RoomNode) GetOwnerName

func (roomNode *RoomNode) GetOwnerName() string

func (*RoomNode) GetPlayersLimit

func (roomNode *RoomNode) GetPlayersLimit() int

func (*RoomNode) GlobalWriteMessage

func (roomNode *RoomNode) GlobalWriteMessage(msg *message.JSON)

write a message to every client

func (*RoomNode) ReadMessage

func (roomNode *RoomNode) ReadMessage(msg rtclient.MessageWithClient)

func (*RoomNode) Run

func (roomNode *RoomNode) Run(requester GameNodeRequester)

func (*RoomNode) SetRandomID

func (roomNode *RoomNode) SetRandomID()

func (*RoomNode) WriteMessageTo

func (roomNode *RoomNode) WriteMessageTo(msg *message.JSON, name string)

write a message to a single client

Jump to

Keyboard shortcuts

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