diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index eab78e7..79f8787 100644 Binary files a/data/DB_PropExchange.dat and b/data/DB_PropExchange.dat differ diff --git a/data/DB_Task.dat b/data/DB_Task.dat index ec74cda..7f78134 100644 Binary files a/data/DB_Task.dat and b/data/DB_Task.dat differ diff --git a/model/config.go b/model/config.go index 568775e..4ba254c 100644 --- a/model/config.go +++ b/model/config.go @@ -406,7 +406,19 @@ func (cm *ConfigMgr) UpdateRoomConfig(data *webapi.RoomConfig) { if d == nil { d = make([]*webapi.RoomConfig, 0) } - d = append(d, data) + + has := false + for k, v := range d { + if v.GetId() == data.GetId() { + d[k] = data + has = true + break + } + } + if !has { + d = append(d, data) + } + cm.GetConfig(data.GetPlatform()).RoomTypeMap[data.GetRoomType()] = d } @@ -414,12 +426,11 @@ func (cm *ConfigMgr) DelRoomConfig(plt string, id int32) { d := cm.GetConfig(plt).RoomConfig[id] if d != nil { b := cm.GetConfig(plt).RoomTypeMap[d.GetRoomType()] - if b != nil { - for i, v := range b { - if v.GetId() == id { - b = append(b[:i], b[i+1:]...) - cm.GetConfig(plt).RoomTypeMap[d.GetRoomType()] = b - } + for i, v := range b { + if v.GetId() == id { + b = append(b[:i], b[i+1:]...) + cm.GetConfig(plt).RoomTypeMap[d.GetRoomType()] = b + break } } } diff --git a/public b/public index 00b9fce..9d35521 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit 00b9fce886af5b6a926aa804d3cad33be9ea0793 +Subproject commit 9d355215710228e4481fc6334f6e14b902a03e95 diff --git a/worldsrv/scene.go b/worldsrv/scene.go index 093a35e..a8fcd80 100644 --- a/worldsrv/scene.go +++ b/worldsrv/scene.go @@ -141,7 +141,6 @@ func NewScene(args *CreateSceneParam) *Scene { if s.CustomParam == nil { s.CustomParam = new(serverproto.CustomParam) } - s.sp.OnStart(s) return s } diff --git a/worldsrv/scenemgr.go b/worldsrv/scenemgr.go index 185f3f5..439a945 100644 --- a/worldsrv/scenemgr.go +++ b/worldsrv/scenemgr.go @@ -413,6 +413,7 @@ func (m *SceneMgr) CreateScene(args *CreateSceneParam) *Scene { return nil } m.scenes[args.RoomId] = s + s.sp.OnStart(s) // 添加到游戏服记录中 args.GS.AddScene(&AddSceneParam{ S: s,