feat config

This commit is contained in:
2025-12-11 11:12:36 +08:00
parent d6f770fbb3
commit 71d4e593c7
19 changed files with 229 additions and 326 deletions

View File

@@ -40,7 +40,7 @@ func NewScene(sid int64, instanceID int) *Instance {
UniqueNo: utils.SnowflakeInstance().Generate().Int64(),
EventIn: make(chan proto.Message),
}
s.logger = log.GetLogger().Named(fmt.Sprintf("%v:%v", s.InstanceID, s.UniqueNo))
s.logger = log.GetLogger().Named(fmt.Sprintf("instance %v:%v", s.InstanceID, s.UniqueNo))
s.ctx, s.cancel = context.WithCancel(context.Background())
return s
}
@@ -83,7 +83,7 @@ func (i *Instance) Start(ttl int64) {
i.logger.Infof("new scene start")
}
// 网络帧
// 网络帧,将玩家的操作储存起来,到逻辑帧再处理玩家操作
func (i *Instance) onEvent(e proto.Message) {
switch v := e.(type) {
case *grpc_pb.EnterReq: