Documentation
¶
Index ¶
- Constants
- Variables
- func Broadcast(p packets.Packet, except string)
- func GenerateGUID() string
- func GetUserFriends(userID int) []int32
- func GetUserIDs() []int32
- func Handle(input []byte, output *[]byte, token string) (string, error)
- func Login(l logindata.LoginData, output *[]byte) (string, error)
- func NewPacketHandler(pack inbound.BasePacket, s *Session)
- func Prune()
- func SetUp()
- type Session
- type User
Constants ¶
View Source
const ( TypeLogin = iota TypePoll TypeChatMessage )
Request types
Variables ¶
View Source
var Sessions map[string]*Session
Sessions is a map of connections to the server via the bancho protocol.
Functions ¶
func GetUserFriends ¶
GetUserFriends returns an int32 array containing all the friends of an user, be them online or not.
func NewPacketHandler ¶
func NewPacketHandler(pack inbound.BasePacket, s *Session)
NewPacketHandler handles inbound packets, and sends them to be analysed by functions, or if it's short by a case itself.
Types ¶
type Session ¶
type Session struct { User User LastRequest time.Time Terminated bool // contains filtered or unexported fields }
Session is an alive connection of a logged in user.
type User ¶
type User struct { ID int32 Name string Token string UTCOffset byte Country byte Colour byte Position struct { Longitude float32 Latitude float32 } Rank int Username string Status common.Status }
User represents an user online on bancho.
func (User) ToUserDataInfo ¶
func (u User) ToUserDataInfo() packets.UserDataInfo
ToUserDataINfo converts a packethandler.User to a packets.UserDataInfo.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.