Documentation
¶
Index ¶
- Variables
- func DeleteOldTokens(userid uint32)
- func DeleteStream(streamname string)
- func DeleteToken(token string)
- func GetLobbys(t *Token)
- func HasChannelPermission(channelname string, t *Token) bool
- func JoinChannel(channelname string, t *Token) bool
- func JoinLobby(l *Lobby, password string, t *Token)
- func LeaveChannel(channelname string) bool
- func LeaveLobby(t *Token)
- func NewLobbyC(l *Lobby, t *Token)
- func RemoveLobby(ID uint16)
- func TokenExists(token string) bool
- func UpdateMatch(l *Lobby)
- func WriteLobby(l *Lobby, h bool) []byte
- type Channel
- type ChannelInfo
- type ChannelInfoAnswer
- type ChannelPermissions
- type Lobby
- type LobbySlot
- type ReplayFrame
- type ScoreFrame
- type SpectatorFrame
- type SpectatorStream
- func (s *SpectatorStream) AddUser(t *Token)
- func (s *SpectatorStream) AlreadySpectating(t *Token) bool
- func (s *SpectatorStream) Broadcast(r io.Reader)
- func (s *SpectatorStream) BroadcastRaw(b []byte, isFrame bool, ignoreSelf *Token, onlyHost bool)
- func (s *SpectatorStream) NoMap(t *Token)
- func (s *SpectatorStream) RemoveSpectatorStream(t *Token)
- func (s *SpectatorStream) RemoveUser(t *Token)
- type Stream
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var CHANNELS []*Channel
CHANNELS Global Variable
View Source
var LOBBYS []*Lobby
View Source
var LobbyLock *sync.Mutex
View Source
var STREAMS []*Stream
View Source
var TOKENS []*Token
TOKENS Global Variable for Token array.
Functions ¶
func DeleteOldTokens ¶
func DeleteOldTokens(userid uint32)
func DeleteStream ¶
func DeleteStream(streamname string)
func DeleteToken ¶
func DeleteToken(token string)
DeleteToken deletes the given Token (String) from our TOKENS Array.
func HasChannelPermission ¶
func JoinChannel ¶
JoinChannel add a User to the Defined channel. returns bool, if Successfull return true else false
func LeaveChannel ¶
LeaveChannel remove a User from the Defined channel. returns bool, if Successfull return true else false
func LeaveLobby ¶
func LeaveLobby(t *Token)
func RemoveLobby ¶
func RemoveLobby(ID uint16)
func TokenExists ¶
TokenExists return a boolean, true if exists else false
func UpdateMatch ¶
func UpdateMatch(l *Lobby)
func WriteLobby ¶
Types ¶
type Channel ¶
type Channel struct { CInfo ChannelInfoAnswer CPerm ChannelPermissions AutoJoin bool }
func GetChannel ¶
GetChannel returns an Channel object, if not exists return nil
type ChannelInfo ¶
type ChannelInfoAnswer ¶
type ChannelPermissions ¶
type Lobby ¶
type Lobby struct { ID uint16 Running bool Type byte Mods uint32 Name string Password string BeatmapName string BeatmapID uint32 BeatmapMD5 string Slots [16]LobbySlot Host uint32 PlayMode byte ScoreType byte TeamType byte FreeMods byte Seed uint32 // or random number, idk. }
func (*Lobby) SwitchSlot ¶
type ReplayFrame ¶
type ScoreFrame ¶
type ScoreFrame struct { Time int32 ID byte Count300 uint16 Count100 uint16 Count50 uint16 CountGeki uint16 CountKatu uint16 CountMiss uint16 TotalScore int32 MaxCombo uint16 CurrentCombo uint16 FC bool HP uint8 TagByte int8 ScoreV2 bool }
func (*ScoreFrame) ScoreV2F ¶
func (s *ScoreFrame) ScoreV2F(comboPortion, bonusPortion float64) []byte
type SpectatorFrame ¶
type SpectatorFrame struct { Extra int32 ReplayFrames []ReplayFrame Action byte ScoreFrame ScoreFrame }
type SpectatorStream ¶
type SpectatorStream struct { HostToken *Token StreamTokens []*Token // contains filtered or unexported fields }
func NewSpectatorStream ¶
func NewSpectatorStream(t *Token) *SpectatorStream
func (*SpectatorStream) AddUser ¶
func (s *SpectatorStream) AddUser(t *Token)
func (*SpectatorStream) AlreadySpectating ¶
func (s *SpectatorStream) AlreadySpectating(t *Token) bool
func (*SpectatorStream) Broadcast ¶
func (s *SpectatorStream) Broadcast(r io.Reader)
func (*SpectatorStream) BroadcastRaw ¶
func (s *SpectatorStream) BroadcastRaw(b []byte, isFrame bool, ignoreSelf *Token, onlyHost bool)
func (*SpectatorStream) NoMap ¶
func (s *SpectatorStream) NoMap(t *Token)
func (*SpectatorStream) RemoveSpectatorStream ¶
func (s *SpectatorStream) RemoveSpectatorStream(t *Token)
func (*SpectatorStream) RemoveUser ¶
func (s *SpectatorStream) RemoveUser(t *Token)
type Stream ¶
type Stream struct { StreamName string StreamTemp bool Tokens []*Token // contains filtered or unexported fields }
func (*Stream) RemoveUser ¶
RemoveUser Remove user from Stream.
type Token ¶
type Token struct { Token string User *consts.User Status struct { Torney bool Beatmap constants.ClientSendUserStatusStruct Info struct { Permissions byte ClientPerm byte TimeZone byte CountryID byte Lon float64 Lat float64 Rank uint32 } } AlreadyNotified bool SpectatorStream *SpectatorStream Leaderboard *consts.Leaderboard MPLobby *Lobby MPSlot uint8 LastPing time.Time Output bytes.Buffer LockPackets *sync.Mutex }
Token data
func GetTokenByID ¶
GetTokenByID Returns a UserToken from an UserID if not exists return nil
Click to show internal directories.
Click to hide internal directories.