本文整理汇总了Golang中github.com/Blackrush/gofus/realm/network/frontend.Client.UserInfos方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.UserInfos方法的具体用法?Golang Client.UserInfos怎么用?Golang Client.UserInfos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/Blackrush/gofus/realm/network/frontend.Client
的用法示例。
在下文中一共展示了Client.UserInfos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: HandleClientDisconnection
func HandleClientDisconnection(ctx frontend.Service, client frontend.Client) {
log.Printf("[frontend-net-client-%04d] DCONN", client.Id())
if client.UserInfos() != nil {
ctx.Backend().NotifyUserConnection(client.UserInfos().Id, false)
}
}
示例2: handle_client_create_player
func handle_client_create_player(ctx frontend.Service, client frontend.Client, m *msg.CreatePlayerReq) {
player := ctx.Players().NewPlayer(uint(client.UserInfos().Id), m.Name, m.Breed, m.Gender, m.Colors.First, m.Colors.Second, m.Colors.Third)
if inserted, success := ctx.Players().Persist(player); inserted && success {
client_send_player_list(ctx, client)
} else {
client.Send(&msg.CreatePlayerErrorResp{})
}
}
示例3: client_send_player_list
func client_send_player_list(ctx frontend.Service, client frontend.Client) {
var players []*db.Player
var ok bool
if players, ok = ctx.Players().GetByOwnerId(uint(client.UserInfos().Id)); !ok {
players = make([]*db.Player, 0, 0)
}
client.Send(&msg.PlayersResp{
ServerId: ctx.Config().ServerId,
SubscriptionEnd: client.UserInfos().SubscriptionEnd,
Players: players,
})
}