补全过滤入口与直接兑换,优化兑换分类和 WSS 建连
- GUI 接线 Exchange 绑定:新增「直接兑换」按钮,结果带 category/message 并进入结果面板 - 补 -max-price/-min-left(CLI 与 GUI 设置),Target 的价格与库存过滤不再悬空 - 删除死代码 sendUpdateUserInfo 及其请求结构体(浏览器流程不含该帧) - ClassifyExchange 改为多路判定:合并 msg/actPreCondition/exchangeInfo 文案,status=200 且有 orderId 视为成功,新增 condition 分类(precondition 门禁) - WSS 建连改为锁外 dial、锁内注册,同 uid 并发调用共享一次握手 - 默认传输层统一为 http(CLI/GUI/README),.gitignore 忽略 .DS_Store - 同步 Wails 依赖升级(2.12.0 -> 2.15.0)并重新生成前端绑定
This commit is contained in:
+9
-2
@@ -27,6 +27,8 @@ func main() {
|
||||
pids = flag.String("pids", "", "多个奖品 PID,逗号分隔")
|
||||
name = flag.String("name", "", "按奖品名包含匹配")
|
||||
names = flag.String("names", "", "多个奖品名,逗号分隔")
|
||||
maxPrice = flag.Int64("max-price", 0, "目标奖品最高积分,0 表示不限制")
|
||||
minLeft = flag.Int64("min-left", 0, "目标奖品最少剩余库存,0 表示不限制")
|
||||
autoSelect = flag.Bool("auto", false, "monitor 自动选择列表里的可兑奖品")
|
||||
loops = flag.Int("loops", 1, "monitor 循环次数")
|
||||
delayMS = flag.Int("delay", 150, "monitor 每轮间隔毫秒")
|
||||
@@ -126,7 +128,7 @@ func main() {
|
||||
waitForCommand(ctx, startAt)
|
||||
runExchange(ctx, client, accounts, int32(*sid), int32(*pid), *concurrency)
|
||||
case "monitor":
|
||||
targets := parseTargets(*pid, *pids, *name, *names, *autoSelect)
|
||||
targets := parseTargets(*pid, *pids, *name, *names, *autoSelect, *maxPrice, *minLeft)
|
||||
if len(targets) == 0 {
|
||||
exitErr(errors.New("monitor 必须提供 -pid 或 -name"))
|
||||
}
|
||||
@@ -237,7 +239,7 @@ func loadCookies(cookie, file string) ([]string, error) {
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func parseTargets(pid int, pids, name, names string, autoSelect bool) []sniper.Target {
|
||||
func parseTargets(pid int, pids, name, names string, autoSelect bool, maxPrice, minLeft int64) []sniper.Target {
|
||||
targets := make([]sniper.Target, 0)
|
||||
name = strings.TrimSpace(name)
|
||||
if pid > 0 || name != "" {
|
||||
@@ -259,6 +261,11 @@ func parseTargets(pid int, pids, name, names string, autoSelect bool) []sniper.T
|
||||
}
|
||||
targets = append(targets, sniper.Target{Name: text})
|
||||
}
|
||||
// 价格/库存过滤对所有目标统一生效。
|
||||
for i := range targets {
|
||||
targets[i].MaxPrice = maxPrice
|
||||
targets[i].MinLeft = minLeft
|
||||
}
|
||||
return targets
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user