gameserver

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SettingsSize = 24
	TCPTimeout   = time.Minute * 5
)
View Source
const (
	RequestNone                = 255
	RequestSendSave            = 1
	RequestReceiveSave         = 2
	RequestSendSettings        = 3
	RequestReceiveSettings     = 4
	RequestRegisterPlayer      = 5
	RequestGetRegistration     = 6
	RequestDisconnectNotice    = 7
	RequestReceiveSaveWithSize = 8
	RequestSendCustomStart     = 64 // 64-127 are custom data send slots, 128-191 are custom data receive slots
	CustomDataOffset           = 64
)
View Source
const (
	KeyInfoClient           = 0
	KeyInfoServer           = 1
	PlayerInputRequest      = 2
	KeyInfoServerGratuitous = 3
	CP0Info                 = 4
)
View Source
const (
	StatusDesync           = 1
	DisconnectTimeoutS     = 30
	NoRegID                = 255
	InputDataMax       int = 60 * 60 // One minute of input data
	CS4                    = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Socket  *websocket.Conn
	IP      net.IP
	Number  int
	InLobby bool
}

type GameData

type GameData struct {
	// contains filtered or unexported fields
}

type GameServer

type GameServer struct {
	StartTime    time.Time
	Players      map[string]Client
	PlayersMutex sync.Mutex

	Logger    logr.Logger
	GameName  string
	Password  string
	ClientSha string
	MD5       string
	Emulator  string

	Port int

	Running            bool
	Features           map[string]string
	NeedsUpdatePlayers bool
	NumberOfPlayers    int
	BufferTarget       byte
	QuitChannel        *chan bool
	// contains filtered or unexported fields
}

func (*GameServer) CloseServers

func (g *GameServer) CloseServers()

func (*GameServer) CreateNetworkServers

func (g *GameServer) CreateNetworkServers(basePort int, maxGames int, roomName string, gameName string, emulatorName string, logger logr.Logger) int

func (*GameServer) ManageBuffer

func (g *GameServer) ManageBuffer()

func (*GameServer) ManagePlayers

func (g *GameServer) ManagePlayers()

type InputData

type InputData struct {
	// contains filtered or unexported fields
}

type Registration

type Registration struct {
	// contains filtered or unexported fields
}

type TCPData

type TCPData struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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