diff --git a/worldsrv/etcd.go b/worldsrv/etcd.go index cca9e12..b60851a 100644 --- a/worldsrv/etcd.go +++ b/worldsrv/etcd.go @@ -93,6 +93,10 @@ func init() { etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent) // 小精灵配置 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{}) { diff --git a/worldsrv/scene.go b/worldsrv/scene.go index 333f90e..093a35e 100644 --- a/worldsrv/scene.go +++ b/worldsrv/scene.go @@ -514,8 +514,6 @@ func (this *Scene) lastScene(p *Player) { } func (this *Scene) DelPlayer(p *Player) bool { - FirePlayerLeaveScene(p, this) - this.sp.OnPlayerLeave(this, p) if p.scene != this { roomId := 0 if p.scene != nil { @@ -556,6 +554,8 @@ func (this *Scene) DelPlayer(p *Player) bool { if !p.IsRob { this.lastTime = time.Now() } + FirePlayerLeaveScene(p, this) + this.sp.OnPlayerLeave(this, p) return true }