竞技馆房间解散问题

This commit is contained in:
sk 2024-09-07 16:58:01 +08:00
parent d769605d09
commit 4eee248f20
4 changed files with 6 additions and 6 deletions

View File

@ -287,6 +287,9 @@ func (this *TienLenSceneData) OnPlayerLeave(p *base.Player, reason int) {
}
}
}
if !this.GetDestroyed() && this.IsCustom() && len(this.players) == 0 {
this.SceneDestroy(true)
}
}
func (this *TienLenSceneData) SceneDestroy(force bool) {

View File

@ -148,9 +148,6 @@ func (this *ScenePolicyTienLen) OnPlayerLeave(s *base.Scene, p *base.Player, rea
}
sceneEx.OnPlayerLeave(p, reason)
s.FirePlayerEvent(p, base.PlayerEventLeave, []int64{int64(reason)})
if s.IsCustom() && len(s.Players) == 0 {
s.Destroy(true)
}
}
// 玩家掉线

View File

@ -1341,8 +1341,8 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{
sp.CostPayment(scene, p)
}
code = gamehall.OpResultCode_Game_OPRC_Sucess_Game
pack = &gamehall.SCCreatePrivateRoom{
OpRetCode: gamehall.OpResultCode_Game_OPRC_Sucess_Game,
GameFreeId: msg.GetGameFreeId(),
RoomTypeId: msg.GetRoomTypeId(),
RoomConfigId: msg.GetRoomConfigId(),

View File

@ -174,8 +174,8 @@ func (this *GameSession) AddScene(args *AddSceneParam) {
Match: args.S.MatchParam,
Params: args.S.params,
}
if args.S.GetRoomTypeId() != 0 {
cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomTypeId()]
if args.S.GetRoomConfigId() != 0 {
cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomConfigId()]
if cfg != nil {
for _, v := range cfg.GetReward() {
msg.Items = append(msg.Items, &server_proto.Item{