Compare commits

..

No commits in common. "4b7c552524fc4a86e6b6af027d0e85d9d6addd33" and "19dde360d65dd8921647b3f12cb4067da3a16b1e" have entirely different histories.

6 changed files with 9 additions and 20 deletions

Binary file not shown.

Binary file not shown.

View File

@ -406,19 +406,7 @@ func (cm *ConfigMgr) UpdateRoomConfig(data *webapi.RoomConfig) {
if d == nil { if d == nil {
d = make([]*webapi.RoomConfig, 0) 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 cm.GetConfig(data.GetPlatform()).RoomTypeMap[data.GetRoomType()] = d
} }
@ -426,11 +414,12 @@ func (cm *ConfigMgr) DelRoomConfig(plt string, id int32) {
d := cm.GetConfig(plt).RoomConfig[id] d := cm.GetConfig(plt).RoomConfig[id]
if d != nil { if d != nil {
b := cm.GetConfig(plt).RoomTypeMap[d.GetRoomType()] b := cm.GetConfig(plt).RoomTypeMap[d.GetRoomType()]
for i, v := range b { if b != nil {
if v.GetId() == id { for i, v := range b {
b = append(b[:i], b[i+1:]...) if v.GetId() == id {
cm.GetConfig(plt).RoomTypeMap[d.GetRoomType()] = b b = append(b[:i], b[i+1:]...)
break cm.GetConfig(plt).RoomTypeMap[d.GetRoomType()] = b
}
} }
} }
} }

2
public

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

View File

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

View File

@ -413,7 +413,6 @@ func (m *SceneMgr) CreateScene(args *CreateSceneParam) *Scene {
return nil return nil
} }
m.scenes[args.RoomId] = s m.scenes[args.RoomId] = s
s.sp.OnStart(s)
// 添加到游戏服记录中 // 添加到游戏服记录中
args.GS.AddScene(&AddSceneParam{ args.GS.AddScene(&AddSceneParam{
S: s, S: s,