antiCheating.go 931 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package cmd
  2. import (
  3. "fmt"
  4. "gadmin/internal/antiCheating"
  5. "github.com/spf13/cobra"
  6. "time"
  7. )
  8. var antiCheatingCmd = &cobra.Command{
  9. Use: "antiCheating",
  10. Short: "",
  11. Long: `防作弊数据分析
  12. 1. 获取玩家信息
  13. 1.1 获取玩家游戏角色卡信息
  14. 1.2 获取角色卡技能等级
  15. 2.获取战斗数据
  16. 3.计算伤害
  17. 4.将异常伤害数据及玩家信息保存
  18. 秦天明:initDps * 技能倍率 * 克制系数.`,
  19. Args: cobra.MaximumNArgs(1),
  20. Run: func(cmd *cobra.Command, args []string) {
  21. fmt.Println("antiCheating")
  22. now := time.Now()
  23. yearMonth := now.Format("200601")
  24. fmt.Printf("args:%v", args)
  25. if len(args) != 0 && args[0] != "" {
  26. _, err := time.Parse("200601", yearMonth)
  27. if err != nil {
  28. return
  29. }
  30. yearMonth = args[0]
  31. }
  32. combat := antiCheating.NewCombat(antiCheating.WithYearMonth(yearMonth))
  33. combat.Run()
  34. },
  35. }
  36. func init() {
  37. rootCmd.AddCommand(antiCheatingCmd)
  38. }