v0.4.1:新增 CK 有效性检查并修复抢购调度

This commit is contained in:
yml2213
2026-10-17 14:24:32 +08:00
parent 8b3b14654f
commit 2451466bed
13 changed files with 1210 additions and 132 deletions
+2
View File
@@ -3,6 +3,8 @@
import {gui} from '../models';
import {logger} from '../models';
export function CheckCookies(arg1:gui.Config):Promise<Array<gui.CookieCheckResult>>;
export function DefaultConfig():Promise<gui.Config>;
export function Exchange(arg1:gui.Config):Promise<Array<gui.ExchangeResult>>;
+4
View File
@@ -2,6 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function CheckCookies(arg1) {
return window['go']['gui']['App']['CheckCookies'](arg1);
}
export function DefaultConfig() {
return window['go']['gui']['App']['DefaultConfig']();
}
+72 -50
View File
@@ -1,15 +1,15 @@
export namespace gui {
export class AccountPreview {
line: number;
uid: number;
valid: boolean;
error?: string;
static createFrom(source: any = {}) {
return new AccountPreview(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.line = source["line"];
@@ -48,11 +48,11 @@ export namespace gui {
startAt: string;
windowSeconds: number;
disableAdaptiveThrottle: boolean;
static createFrom(source: any = {}) {
return new Config(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.transport = source["transport"];
@@ -86,17 +86,39 @@ export namespace gui {
this.disableAdaptiveThrottle = source["disableAdaptiveThrottle"];
}
}
export class CookieCheckResult {
line: number;
uid: number;
status: string;
message?: string;
statusCode?: number;
checkedAt: number;
static createFrom(source: any = {}) {
return new CookieCheckResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.line = source["line"];
this.uid = source["uid"];
this.status = source["status"];
this.message = source["message"];
this.statusCode = source["statusCode"];
this.checkedAt = source["checkedAt"];
}
}
export class ExchangeResult {
uid: number;
resp?: huya.ScoreExchangePrizeResp;
category?: string;
message?: string;
error?: string;
static createFrom(source: any = {}) {
return new ExchangeResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
@@ -105,7 +127,7 @@ export namespace gui {
this.message = source["message"];
this.error = source["error"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
@@ -130,11 +152,11 @@ export namespace gui {
dataDir: string;
logDir: string;
logFile: string;
static createFrom(source: any = {}) {
return new InstanceInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
@@ -150,11 +172,11 @@ export namespace gui {
dir: string;
dropped: number;
count: number;
static createFrom(source: any = {}) {
return new LogStats(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.level = source["level"];
@@ -172,11 +194,11 @@ export namespace gui {
categories: huya.PrizeTag[];
categoryStats: huya.CategoryStat[];
raw?: huya.GetActPrizeListResp;
static createFrom(source: any = {}) {
return new PrizeListResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
@@ -187,7 +209,7 @@ export namespace gui {
this.categoryStats = this.convertValues(source["categoryStats"], huya.CategoryStat);
this.raw = this.convertValues(source["raw"], huya.GetActPrizeListResp);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
@@ -211,11 +233,11 @@ export namespace gui {
records: huya.UserPrizeInfo[];
resp?: huya.GetUserPrizeRecordsResp;
error?: string;
static createFrom(source: any = {}) {
return new RecordResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
@@ -223,7 +245,7 @@ export namespace gui {
this.resp = this.convertValues(source["resp"], huya.GetUserPrizeRecordsResp);
this.error = source["error"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
@@ -247,11 +269,11 @@ export namespace gui {
score: number;
resp?: huya.GetUserScoreResp;
error?: string;
static createFrom(source: any = {}) {
return new ScoreResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
@@ -259,7 +281,7 @@ export namespace gui {
this.resp = this.convertValues(source["resp"], huya.GetUserScoreResp);
this.error = source["error"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
@@ -282,18 +304,18 @@ export namespace gui {
}
export namespace huya {
export class ActPreCondition {
condition_type: number;
condition_params?: Record<string, string>;
tip?: string;
jump_url?: string;
button_desc?: string;
static createFrom(source: any = {}) {
return new ActPreCondition(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.condition_type = source["condition_type"];
@@ -309,11 +331,11 @@ export namespace huya {
count: number;
left: number;
total: number;
static createFrom(source: any = {}) {
return new CategoryStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
@@ -327,11 +349,11 @@ export namespace huya {
pid: number;
exchange_score: number;
desc: string;
static createFrom(source: any = {}) {
return new ExchangeInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.pid = source["pid"];
@@ -343,11 +365,11 @@ export namespace huya {
id: number;
name: string;
weight: number;
static createFrom(source: any = {}) {
return new PrizeTag(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
@@ -378,11 +400,11 @@ export namespace huya {
end_time?: number;
daily_start?: string;
daily_end?: string;
static createFrom(source: any = {}) {
return new PrizeInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
@@ -415,11 +437,11 @@ export namespace huya {
prizes: PrizeInfo[];
module_id: number;
tags: PrizeTag[];
static createFrom(source: any = {}) {
return new GetActPrizeListResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
@@ -428,7 +450,7 @@ export namespace huya {
this.module_id = source["module_id"];
this.tags = this.convertValues(source["tags"], PrizeTag);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
@@ -466,11 +488,11 @@ export namespace huya {
item_id?: number;
ext?: Record<string, string>;
exchange_date?: number;
static createFrom(source: any = {}) {
return new UserPrizeInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
@@ -497,18 +519,18 @@ export namespace huya {
status: number;
msg: string;
records: UserPrizeInfo[];
static createFrom(source: any = {}) {
return new GetUserPrizeRecordsResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
this.msg = source["msg"];
this.records = this.convertValues(source["records"], UserPrizeInfo);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
@@ -536,11 +558,11 @@ export namespace huya {
new_used_score: number;
score: number;
is_open_exchange_tip: number;
static createFrom(source: any = {}) {
return new GetUserScoreResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
@@ -553,19 +575,19 @@ export namespace huya {
this.is_open_exchange_tip = source["is_open_exchange_tip"];
}
}
export class ScoreExchangePrizeResp {
status: number;
msg: string;
order_id?: string;
exchange_info: ExchangeInfo;
act_pre_condition: ActPreCondition;
static createFrom(source: any = {}) {
return new ScoreExchangePrizeResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
@@ -574,7 +596,7 @@ export namespace huya {
this.exchange_info = this.convertValues(source["exchange_info"], ExchangeInfo);
this.act_pre_condition = this.convertValues(source["act_pre_condition"], ActPreCondition);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
@@ -597,7 +619,7 @@ export namespace huya {
}
export namespace logger {
export class Entry {
id: number;
time: string;
@@ -605,11 +627,11 @@ export namespace logger {
category: string;
account: string;
message: string;
static createFrom(source: any = {}) {
return new Entry(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];