habbgo/protocol/handlers/player_handlers.go

28 lines
864 B
Go
Raw Normal View History

package handlers
import (
2022-01-09 00:05:39 +00:00
"github.com/yunginnanet/habbgo/models"
"github.com/yunginnanet/habbgo/protocol/composers"
)
func GetInfo(player models.Player, packet models.IncomingPacket) {
player.Session().Send(composers.ComposeUserObj(player))
}
func GetCredits(player models.Player, packet models.IncomingPacket) {
player.Session().Send(composers.ComposeCreditBalance(player.Details().Credits()))
}
func GetAvailableBadges(player models.Player, packet models.IncomingPacket) {
player.Session().Send(composers.ComposeAvailableBadges(player))
}
func GetSoundSetting(player models.Player, packet models.IncomingPacket) {
player.Session().Send(composers.ComposeSoundSetting(player.Details().SoundEnabled()))
}
func TestLatency(player models.Player, packet models.IncomingPacket) {
l := packet.ReadInt()
player.Session().Send(composers.ComposeLatency(l))
}