本文整理匯總了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,
})
}