播放游戏时,停止待机任务

This commit is contained in:
2025-02-26 19:45:47 +08:00
parent 8b080a8081
commit 593d7758bf
19 changed files with 422 additions and 275 deletions

View File

@@ -54,7 +54,7 @@ func buildMqtt(c config.MqttConfig, r *leaf.Engine, subTopics ...string) autopah
zap.S().Infof("MQTT 连接异常: %s\n", err)
},
ClientConfig: paho.ClientConfig{
ClientID: "TestSubscriber",
ClientID: fmt.Sprintf("game-driver-%s-%v", config.C.Location, config.C.Point),
OnPublishReceived: []func(paho.PublishReceived) (bool, error){
func(pr paho.PublishReceived) (bool, error) {
r.Route(pr.Packet.Packet())
@@ -131,6 +131,7 @@ func Run() {
middleware.RunLog(),
middleware.PayloadJSON[schema.PlayModal](),
middleware.DeviceLock(device),
middleware.PauseWait(common.PassCtrl),
middleware.EmergencyStop(common.GlobalStopper),
middleware.SoundStart(),
middleware.RelayMaster(r),
@@ -145,6 +146,7 @@ func Run() {
middleware.PayloadJSON[schema.WaitModel](),
middleware.Unique(common.GlobalBgStopper),
middleware.EmergencyStop(common.GlobalBgStopper),
middleware.Pause(common.PassCtrl),
routes.WaitAction,
)
// 处理指令