mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
优化代码
This commit is contained in:
@@ -57,6 +57,9 @@ func Run(ctx context.Context, configFile string) error {
|
||||
|
||||
logger.InitLogger("fight_" + APPID)
|
||||
logger.Warn("fight start, appid: %v", APPID)
|
||||
defer func() {
|
||||
logger.CloseLogger()
|
||||
}()
|
||||
|
||||
messageQueue := mq.NewMessageQueue(api.FIGHT, APPID, client)
|
||||
defer messageQueue.Close()
|
||||
@@ -74,7 +77,6 @@ func Run(ctx context.Context, configFile string) error {
|
||||
switch s {
|
||||
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
|
||||
logger.Warn("fight exit, appid: %v", APPID)
|
||||
time.Sleep(time.Second)
|
||||
return nil
|
||||
case syscall.SIGHUP:
|
||||
default:
|
||||
|
||||
@@ -228,7 +228,7 @@ func (f *FightRoutine) attackHandle(gameMsg *mq.GameMsg) {
|
||||
continue
|
||||
}
|
||||
hitInfo := new(proto.EvtBeingHitInfo)
|
||||
if config.CONF.Hk4e.ClientProtoProxyEnable {
|
||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
||||
clientProtoObj := GetClientProtoObjByName("EvtBeingHitInfo")
|
||||
if clientProtoObj == nil {
|
||||
logger.Error("get client proto obj is nil")
|
||||
@@ -303,7 +303,7 @@ func (f *FightRoutine) getAllPlayer(entityMap map[uint32]*Entity) []uint32 {
|
||||
var ClientCmdProtoMap *client_proto.ClientCmdProtoMap
|
||||
|
||||
func initClientCmdProtoMap() {
|
||||
if config.CONF.Hk4e.ClientProtoProxyEnable {
|
||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
||||
ClientCmdProtoMap = client_proto.NewClientCmdProtoMap()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user