Draft: poop

This commit is contained in:
2025-11-10 13:16:29 +08:00
parent dbd2ed6469
commit 30fb3d8c73
18 changed files with 503 additions and 44 deletions

32
cmds/game.go Normal file
View File

@@ -0,0 +1,32 @@
package cmds
import (
"inp2025/workflows"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.uber.org/zap"
)
var gameCmd = &cobra.Command{
Use: "game",
Run: func(cmd *cobra.Command, args []string) {
router := workflows.GameServer()
err := router.Listen(":" + viper.GetString("port"))
if err != nil {
panic(err)
}
zap.L().Info("server up",
zap.String("addr", router.ListenAddr()))
if err := router.WaitFor(); err != nil {
panic(err)
}
},
}
func init() {
gameCmd.Flags().
String("port", "12345", "")
}