竞技馆房间解散问题
This commit is contained in:
parent
d769605d09
commit
4eee248f20
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家掉线
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Reference in New Issue