From 9674ae585d32f60c58d7d0fe1c2725c9411a9e31 Mon Sep 17 00:00:00 2001 From: tomas Date: Thu, 27 Feb 2025 17:30:33 +0800 Subject: [PATCH] fix script --- gamesrv/slotspkg/external/ExportGoConfig-mac.sh | 3 ++- gamesrv/slotspkg/slots/handler.go | 3 +++ gamesrv/slotspkg/slots/machine/machine.go | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gamesrv/slotspkg/external/ExportGoConfig-mac.sh b/gamesrv/slotspkg/external/ExportGoConfig-mac.sh index 9b911a2..e8b2d1b 100644 --- a/gamesrv/slotspkg/external/ExportGoConfig-mac.sh +++ b/gamesrv/slotspkg/external/ExportGoConfig-mac.sh @@ -13,8 +13,9 @@ else echo "converter already exists." fi +cd ../../../ # 执行 converter 文件 -./converter go /excel ../internal/exported/excel2go .. +./gamesrv/slotspkg/external/converter go gamesrv/slotspkg/external/excel gamesrv/slotspkg/internal/exported/excel2go .. echo "Done." read -p "Press [Enter] to exit..." diff --git a/gamesrv/slotspkg/slots/handler.go b/gamesrv/slotspkg/slots/handler.go index bba4649..e8fa689 100644 --- a/gamesrv/slotspkg/slots/handler.go +++ b/gamesrv/slotspkg/slots/handler.go @@ -127,6 +127,9 @@ func (sm *SlotsMgr) Play(s *base.SlotsSession, req *base.SpinReq) (*cli.SlotsPla if !global.Mock { defer player.PushPlayer(s) } + if res.IsEnd { + m.Close() + } return res, nil } func (*SlotsMgr) PushPlayer(s *base.SlotsSession) map[string]string { diff --git a/gamesrv/slotspkg/slots/machine/machine.go b/gamesrv/slotspkg/slots/machine/machine.go index 76459ed..6d01b44 100644 --- a/gamesrv/slotspkg/slots/machine/machine.go +++ b/gamesrv/slotspkg/slots/machine/machine.go @@ -24,6 +24,11 @@ func NewMachine(s *base.SlotsSession, theme string, shell *shell.Shell, isFree b m := &Machine{} m.Entity = entity.NewEntity(s, theme, m, shell, isFree) m.Init() + oldMachineInter := m.Session.Value(key.SessionMachine) + if oldMachineInter != nil { + oldMachine := oldMachineInter.(*Machine) + m.Data = oldMachine.Data + } m.Session.Set(key.SessionMachine, m) return m }