竞技馆房间解散问题
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) {
|
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)
|
sceneEx.OnPlayerLeave(p, reason)
|
||||||
s.FirePlayerEvent(p, base.PlayerEventLeave, []int64{int64(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)
|
sp.CostPayment(scene, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code = gamehall.OpResultCode_Game_OPRC_Sucess_Game
|
||||||
pack = &gamehall.SCCreatePrivateRoom{
|
pack = &gamehall.SCCreatePrivateRoom{
|
||||||
OpRetCode: gamehall.OpResultCode_Game_OPRC_Sucess_Game,
|
|
||||||
GameFreeId: msg.GetGameFreeId(),
|
GameFreeId: msg.GetGameFreeId(),
|
||||||
RoomTypeId: msg.GetRoomTypeId(),
|
RoomTypeId: msg.GetRoomTypeId(),
|
||||||
RoomConfigId: msg.GetRoomConfigId(),
|
RoomConfigId: msg.GetRoomConfigId(),
|
||||||
|
|
|
||||||
|
|
@ -174,8 +174,8 @@ func (this *GameSession) AddScene(args *AddSceneParam) {
|
||||||
Match: args.S.MatchParam,
|
Match: args.S.MatchParam,
|
||||||
Params: args.S.params,
|
Params: args.S.params,
|
||||||
}
|
}
|
||||||
if args.S.GetRoomTypeId() != 0 {
|
if args.S.GetRoomConfigId() != 0 {
|
||||||
cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomTypeId()]
|
cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomConfigId()]
|
||||||
if cfg != nil {
|
if cfg != nil {
|
||||||
for _, v := range cfg.GetReward() {
|
for _, v := range cfg.GetReward() {
|
||||||
msg.Items = append(msg.Items, &server_proto.Item{
|
msg.Items = append(msg.Items, &server_proto.Item{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue