本文整理匯總了Golang中github.com/Blackrush/gofus/realm/network/frontend.Client.Player方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.Player方法的具體用法?Golang Client.Player怎麽用?Golang Client.Player使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/Blackrush/gofus/realm/network/frontend.Client
的用法示例。
在下文中一共展示了Client.Player方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: handle_client_game_context_create
func handle_client_game_context_create(ctx frontend.Service, client frontend.Client, m *msg.GameContextCreateReq) {
switch m.Type {
case msg.SoloContextType:
client.Send(&msg.GameContextCreateResp{msg.SoloContextType})
p := client.Player()
client.Send(&msg.SetPlayerStats{
Experience: p.Experience.Experience,
LowerExperienceLevel: 0,
HigherExperienceLevel: 1,
Kamas: 0,
BoostStatsPts: 0,
BoostSpellsPts: 0,
AlignId: 0,
AlignLevel: 0,
AlignGrade: 0,
Honor: 0,
Dishonor: 0,
EnabledPvp: false,
Life: 0,
MaxLife: 1,
Energy: 0,
MaxEnergy: 1,
Stats: p.Stats,
})
m := client.Player().Position.Map
client.Send(&msg.SetCurrentMapData{
Id: m.Id,
Date: m.Date,
Key: m.Key,
})
case msg.FightContextType:
fallthrough
default:
log.Print("context type %d is not implemented yet", m.Type)
}
}