完成授书游戏节点功能

This commit is contained in:
2024-11-21 17:23:07 +08:00
parent 4ea0af5bd7
commit 88f7d55930
11 changed files with 240 additions and 123 deletions

View File

@@ -1,26 +1,27 @@
package routes
import (
"context"
"game-driver/internal/routes/play"
"game-driver/leaf"
)
func PlayRouter(location string, point int) leaf.HandlerFunc {
func PlayRouter(ctx context.Context, location string, point int) leaf.HandlerFunc {
switch location {
case "wushan":
return switchPoint(point)
return switchPoint(ctx, point)
default:
return play.Default
}
}
func switchPoint(point int) leaf.HandlerFunc {
func switchPoint(ctx context.Context, point int) leaf.HandlerFunc {
switch point {
case 2: // 镇水塔点位
return play.OnlyVideo
case 4:
// 4号点位(发卡机)
return play.PushCard()
return play.PushCard(ctx)
default:
return play.Default
}