This commit is contained in:
by 2024-12-19 18:03:03 +08:00
commit 09a609b1b3
2 changed files with 7 additions and 9 deletions

View File

@ -180,6 +180,11 @@ func (this *CSEnterRoomHandler) Process(s *netlib.Session, packetid int, data in
p.matchCtx = mc
}
}
if scene.IsCustom() {
if scene.CustomParam.GetCostType() == 1 {
sp.CostPayment(scene, p.SnId)
}
}
if !scene.PlayerEnter(p, -1, true) {
code = gamehall.OpResultCode_Game_OPRC_Error_Game
@ -1342,15 +1347,13 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{
csp.AddScene(scene)
sp.CostPayment(scene, p.SnId)
if !scene.PlayerEnter(p, -1, true) {
send()
return nil
}
if costType == 2 {
sp.CostPayment(scene, p.SnId)
}
code = gamehall.OpResultCode_Game_OPRC_Sucess_Game
pack = &gamehall.SCCreatePrivateRoom{
GameFreeId: msg.GetGameFreeId(),

View File

@ -57,11 +57,6 @@ func (spd *ScenePolicyData) OnTick(s *Scene) {
func (spd *ScenePolicyData) OnPlayerEnter(s *Scene, snid int32) {
s.NotifyPrivateRoom(common.ListModify)
if s.IsCustom() {
if s.CustomParam.GetCostType() == 1 { // AA
spd.CostPayment(s, snid)
}
}
}
func (spd *ScenePolicyData) OnPlayerLeave(s *Scene, snid int32) {