Documentation ¶
Overview ¶
Package sessions provides functions to help maintain consistency across multiple websocket connections from a single player, when the player has multiple tabs/windows open (since each tab opens a new websocket connection)
Index ¶
- func AddSocket(steamid string, so *wsevent.Client)
- func AfterDisconnectedFunc(steamid string, d time.Duration, f func())
- func ConnectedSockets(steamid string) int
- func GetSockets(steamid string) (sockets []*wsevent.Client, success bool)
- func GetSpectating(socketID string) (lobbyID uint, ok bool)
- func IsConnected(steamid string) bool
- func IsSpectating(socketID string, lobbyID uint) bool
- func RemoveSocket(sessionID, steamID string)
- func RemoveSpectator(socketID string)
- func SetSpectator(socketID string, lobbyID uint)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterDisconnectedFunc ¶
AfterDisconnectedFunc waits the duration to elapse, and if the player with the given steamid is still disconnected, calls f in it's own goroutine.
func ConnectedSockets ¶
ConnectedSockets returns the number of socket connections from steamid
func GetSockets ¶
GetSockets returns a list of sockets connected from steamid. The second return value is false if they player has no sockets connected
func GetSpectating ¶
GetSpectating returns the lobbyID of the lobby the socketID is currently spectating. ok is false if the socket is not spectating any lobby
func IsConnected ¶
IsConnected returns whether the given steamid is connected to the website
func IsSpectating ¶
IsSpectating returns whether socketID is spectating lobbyID
func RemoveSocket ¶
func RemoveSocket(sessionID, steamID string)
RemoveSocket removes so from the list of sockets connected from steamid
func RemoveSpectator ¶
func RemoveSpectator(socketID string)
RemoveSpectator indicates that socketID is no longer spectating the lobby it was earlier.
func SetSpectator ¶
SetSpectator indicates that the socket with the given socketID is now spectating lobbyID
Types ¶
This section is empty.