mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 18:22:26 +08:00
完善文档
This commit is contained in:
@@ -36,6 +36,16 @@ func Run(ctx context.Context, configFile string) error {
|
||||
return err
|
||||
}
|
||||
APPID = rsp.GetAppId()
|
||||
go func() {
|
||||
ticker := time.NewTicker(time.Second * 15)
|
||||
for {
|
||||
<-ticker.C
|
||||
_, _ = client.Discovery.KeepaliveServer(context.TODO(), &api.KeepaliveServerReq{
|
||||
ServerType: api.FIGHT,
|
||||
AppId: APPID,
|
||||
})
|
||||
}
|
||||
}()
|
||||
defer func() {
|
||||
_, _ = client.Discovery.CancelServer(context.TODO(), &api.CancelServerReq{
|
||||
ServerType: api.FIGHT,
|
||||
|
||||
@@ -238,6 +238,10 @@ func (f *FightRoutine) attackHandle(gameMsg *mq.GameMsg) {
|
||||
continue
|
||||
}
|
||||
attackResult := hitInfo.AttackResult
|
||||
if attackResult == nil {
|
||||
logger.Error("attackResult is nil")
|
||||
continue
|
||||
}
|
||||
// logger.Debug("run attack handler, attackResult: %v", attackResult)
|
||||
target := f.entityMap[attackResult.DefenseId]
|
||||
if target == nil {
|
||||
|
||||
Reference in New Issue
Block a user