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