fix(fight): 修复技能效果
This commit is contained in:
@@ -53,6 +53,12 @@ func (h *Controller) Login(data *user.MAIN_LOGIN_IN, c gnet.Conn) (result *user.
|
||||
// <-time.After(time.Millisecond * 3000)
|
||||
share.ShareManager.SetUserOnline(data.Head.UserID, h.Port) //设置用户登录服务器
|
||||
t := player.GetPlayer(c, data.Head.UserID)
|
||||
if t == nil {
|
||||
cool.Loger.Error(context.Background(), "获取玩家失败", data.Head.UserID)
|
||||
err = errorcode.ErrorCodes.ErrLoginServerError
|
||||
defer c.Close()
|
||||
return
|
||||
}
|
||||
t.Service = blservice.NewUserService(data.Head.UserID)
|
||||
t.Info = t.Service.Person(data.Head.UserID)
|
||||
if t.Info == nil {
|
||||
|
||||
@@ -84,8 +84,12 @@ func (c *Input) GetEffect(etype EnumEffectType, id int) Effect {
|
||||
return nil
|
||||
}
|
||||
func (c *Input) StatEffect_Exist(id int) bool {
|
||||
t := c.GetEffect(EffectType.Status, id)
|
||||
if t == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return c.GetEffect(EffectType.Status, id-int(EffectType.Status)) != nil
|
||||
return t.Alive()
|
||||
}
|
||||
func (c *Input) StatEffect_Exist_all() bool {
|
||||
for _, v := range c.Effects {
|
||||
|
||||
@@ -8,7 +8,10 @@ func GetPlayer(c gnet.Conn, userid uint32) *Player { //TODO 这里待优化,可
|
||||
|
||||
//检查player初始化,是否为conn初始后取map,防止二次连接后存在两个player
|
||||
|
||||
clientdata := c.Context().(*ClientData)
|
||||
clientdata, ok := c.Context().(*ClientData)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if clientdata.Player == nil {
|
||||
|
||||
clientdata.Player = NewPlayer(
|
||||
|
||||
Reference in New Issue
Block a user