竞技馆列表刷新

This commit is contained in:
sk 2024-09-06 14:00:34 +08:00
parent 0fc4b33aa4
commit fc2db94c86
6 changed files with 20 additions and 9 deletions

Binary file not shown.

Binary file not shown.

View File

@ -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
}
}
}

2
public

@ -1 +1 @@
Subproject commit 00b9fce886af5b6a926aa804d3cad33be9ea0793
Subproject commit 9d355215710228e4481fc6334f6e14b902a03e95

View File

@ -141,7 +141,6 @@ func NewScene(args *CreateSceneParam) *Scene {
if s.CustomParam == nil {
s.CustomParam = new(serverproto.CustomParam)
}
s.sp.OnStart(s)
return s
}

View File

@ -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,