Versions in this module Expand all Collapse all v0 v0.2.5 Nov 7, 2024 v0.2.4 Nov 3, 2024 v0.2.3 Nov 3, 2024 v0.2.2 Nov 3, 2024 v0.2.1 Nov 3, 2024 v0.2.0 Nov 3, 2024 Changes in this version + const AUTOEXEC_KEY + const CONSENT_EXPIRATION + const CREATE_SERVER_COOLDOWN + const DEMO_KEY + const DEMO_TTL + const DuelPhaseBattle + const DuelPhaseDone + const DuelPhaseOvertime + const DuelPhaseWarmup + const INITIAL_SCRIPT + const RUN_WAIT_TIMEOUT + const TUNNEL_MODE + const UserStatusConnected + const UserStatusConnecting + const UserStatusDisconnected + var DEMO_PATH_REGEX = regexp.MustCompile(`^/api/demo/([\w-]+)$`) + var PURGATORY []byte + func Compress(data []byte) ([]byte, error) + func EncodeDemo(startTime time.Time, messages []RecordedPacket) ([]byte, error) + func EncodeSession(startTime time.Time, messages []RecordedPacket) ([]byte, error) + func RecordSession(ctx context.Context, redis *redis.Client, shouldSave bool, user *User) error + func WriteFile(path string, data []byte) error + type Cluster struct + Users *UserOrchestrator + func NewCluster(ctx context.Context, serverManager *servers.ServerManager, ...) *Cluster + func (c *Cluster) AnnounceInServer(ctx context.Context, server *servers.GameServer, message string) + func (c *Cluster) GetDemo(ctx context.Context, id string) ([]byte, error) + func (c *Cluster) HandleTeleport(ctx context.Context, user *User, source int32) + func (c *Cluster) NotifyNameChange(ctx context.Context, user *User, name string) + func (c *Cluster) PollFromMessages(ctx context.Context, user *User) + func (c *Cluster) PollToMessages(ctx context.Context, user *User) + func (c *Cluster) PollUser(ctx context.Context, user *User) + func (c *Cluster) SendMap(ctx context.Context, user *User, name string) error + func (c *Cluster) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Cluster) HandleCommand(ctx context.Context, user *User, command string) + func (server *Cluster) CreateGame(ctx context.Context, params *CreateParams, user *User) error + func (server *Cluster) ForwardGlobalChat(ctx context.Context, sender *User, message string) + func (server *Cluster) GetClientInfo() []*servers.ClientExtInfo + func (server *Cluster) GetServerInfo() *servers.ServerInfo + func (server *Cluster) GetTeamInfo() *servers.TeamInfo + func (server *Cluster) GetUptime() int + func (server *Cluster) GivePrivateMatchHelp(ctx context.Context, user *User, gameServer *servers.GameServer) + func (server *Cluster) GreetClient(ctx context.Context, user *User) + func (server *Cluster) NotifyClientChange(ctx context.Context, user *User, joined bool) + func (server *Cluster) PollDuels(ctx context.Context) + func (server *Cluster) PollServers(ctx context.Context) + func (server *Cluster) PollUsers(ctx context.Context, newConnections chan ingress.Connection) + func (server *Cluster) Shutdown() + func (server *Cluster) StartServers(ctx context.Context) + type ConnectionEvent struct + Server *servers.GameServer + type CreateParams struct + Map opt.Option[string] + Mode opt.Option[int] + Preset opt.Option[string] + type Duel struct + A *User + B *User + Finished chan DuelDone + Manager *servers.ServerManager + Mutex sync.Mutex + Phase DuelPhase + Type config.DuelType + func (d *Duel) Cleanup() + func (d *Duel) Logger() zerolog.Logger + func (d *Duel) MonitorClient(ctx context.Context, user *User, oldServer *servers.GameServer, ...) + func (d *Duel) PollDeaths(ctx context.Context) + func (d *Duel) Respawn(ctx context.Context, user *User) + func (d *Duel) Run(ctx context.Context) + type DuelDone struct + Duel *Duel + Result DuelResult + type DuelPhase byte + type DuelQueue struct + Type string + User *User + type DuelResult struct + Disconnected bool + IsDraw bool + Loser *User + Type string + Winner *User + type ELO struct + Draws uint + Losses uint + Rating uint + Wins uint + func NewELO() *ELO + type ELOState struct + Mutex sync.Mutex + Ratings map[string]*ELO + func NewELOState(duels []config.DuelType) *ELOState + type Matchmaker struct + func NewMatchmaker(manager *servers.ServerManager, duelTypes []config.DuelType) *Matchmaker + func (m *Matchmaker) Dequeue(user *User) + func (m *Matchmaker) FindDuelType(name string) opt.Option[config.DuelType] + func (m *Matchmaker) NotifyProgress(queued *QueuedClient) + func (m *Matchmaker) Poll(ctx context.Context) + func (m *Matchmaker) Queue(user *User, typeName string) error + func (m *Matchmaker) ReceiveQueues() <-chan DuelQueue + func (m *Matchmaker) ReceiveResults() <-chan DuelResult + type QueuedClient struct + Cancel context.CancelFunc + Context context.Context + JoinTime time.Time + Type string + User *User + type RecordedPacket struct + From bool + Packet io.RawPacket + Time time.Time + func NewPacket(from bool, packet io.RawPacket) RecordedPacket + type TrackedPacket struct + Error chan error + Packet P.Packet + type User struct + Connection ingress.Connection + ELO *ELOState + From *P.MessageProxy + Id ingress.ClientID + Mutex deadlock.RWMutex + Name string + RawFrom *utils.Topic[io.RawPacket] + RawTo *utils.Topic[io.RawPacket] + Server *servers.GameServer + ServerClient *gameserver.Client + ServerSession utils.Session + Space *verse.SpaceInstance + Status UserStatus + To *P.MessageProxy + func (c *User) DelayMessages() + func (c *User) GetStatus() UserStatus + func (c *User) ReceiveConnections() <-chan ConnectionEvent + func (c *User) ReceiveToMessages() <-chan TrackedPacket + func (c *User) RestoreMessages() + func (c *User) Send(messages ...P.Message) <-chan error + func (c *User) SendChannel(channel uint8, messages ...P.Message) <-chan error + func (c *User) SendChannelSync(channel uint8, messages ...P.Message) error + func (c *User) SendSync(messages ...P.Message) error + func (u *User) AnnounceELO() + func (u *User) Connect(server *servers.GameServer) (<-chan bool, error) + func (u *User) ConnectToServer(server *servers.GameServer, target string, shouldCopy bool, isSpace bool) (<-chan bool, error) + func (u *User) ConnectToSpace(server *servers.GameServer, id string) (<-chan bool, error) + func (u *User) DisconnectFromServer() error + func (u *User) GetAutoexecKey() string + func (u *User) GetClientNum() int + func (u *User) GetFormattedName() string + func (u *User) GetFormattedReference() string + func (u *User) GetName() string + func (u *User) GetServer() *servers.GameServer + func (u *User) GetServerInfo() P.ServerInfo + func (u *User) GetServerName() string + func (u *User) GetSessionID() string + func (u *User) GetSpace() *verse.SpaceInstance + func (u *User) HasCubeScript() bool + func (u *User) IsAtHome(ctx context.Context) (bool, error) + func (u *User) IsInSpace() bool + func (u *User) Logger() zerolog.Logger + func (u *User) Message(message string) + func (u *User) RawMessage(message string) + func (u *User) Reference() string + func (u *User) Response(ctx context.Context, code P.MessageCode, messages ...P.Message) (P.Message, error) + func (u *User) ResponseTimeout(ctx context.Context, timeout time.Duration, code P.MessageCode, ...) (P.Message, error) + func (u *User) RunCubeScript(ctx context.Context, code string) error + func (u *User) ServerSessionContext() context.Context + func (u *User) SetName(ctx context.Context, name string) + type UserOrchestrator struct + Duels []config.DuelType + Mutex deadlock.RWMutex + Servers map[*servers.GameServer][]*User + Users []*User + func NewUserOrchestrator(duels []config.DuelType) *UserOrchestrator + func (u *UserOrchestrator) AddUser(ctx context.Context, connection ingress.Connection) (*User, error) + func (u *UserOrchestrator) FindUser(id ingress.ClientID) *User + func (u *UserOrchestrator) PollUser(ctx context.Context, user *User) + func (u *UserOrchestrator) RemoveUser(user *User) + type UserStatus uint8