From 9c1fed84e9fad798cddf646d627a74b81f28a786 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 4 Sep 2024 14:53:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E6=8A=80=E9=A6=86=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/etcd.go | 4 ++++ worldsrv/scene.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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 }