竞技馆读取后台配置

This commit is contained in:
sk 2024-09-04 14:53:29 +08:00
parent ac86a5e294
commit 9c1fed84e9
2 changed files with 6 additions and 2 deletions

View File

@ -93,6 +93,10 @@ func init() {
etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent) etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent)
// 小精灵配置 // 小精灵配置
etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent)
// 竞技馆房间配置
etcd.Register(etcd.ETCDKEY_RoomConfig, webapi.RoomConfig{}, handlerEvent)
// 竞技馆房间类型配置
etcd.Register(etcd.ETCDKEY_RoomType, webapi.RoomType{}, handlerEvent)
} }
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) { func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {

View File

@ -514,8 +514,6 @@ func (this *Scene) lastScene(p *Player) {
} }
func (this *Scene) DelPlayer(p *Player) bool { func (this *Scene) DelPlayer(p *Player) bool {
FirePlayerLeaveScene(p, this)
this.sp.OnPlayerLeave(this, p)
if p.scene != this { if p.scene != this {
roomId := 0 roomId := 0
if p.scene != nil { if p.scene != nil {
@ -556,6 +554,8 @@ func (this *Scene) DelPlayer(p *Player) bool {
if !p.IsRob { if !p.IsRob {
this.lastTime = time.Now() this.lastTime = time.Now()
} }
FirePlayerLeaveScene(p, this)
this.sp.OnPlayerLeave(this, p)
return true return true
} }