mirror of
https://github.com/djhackersdev/minime.git
synced 2026-04-25 16:20:19 -05:00
idz: Stub new UpdateStoryClearNum
This commit is contained in:
parent
83ddfcc022
commit
a3705730ce
|
|
@ -35,7 +35,10 @@ import { saveTimeAttack1, saveTimeAttack2 } from "./saveTimeAttack";
|
|||
import { saveTopic } from "./saveTopic";
|
||||
import { unlockProfile } from "./unlockProfile";
|
||||
import { updateProvisionalStoreRank } from "./updateProvisionalStoreRank";
|
||||
import { updateStoryClearNum } from "./updateStoryClearNum";
|
||||
import {
|
||||
updateStoryClearNum1,
|
||||
updateStoryClearNum2,
|
||||
} from "./updateStoryClearNum";
|
||||
import { RequestCode } from "./_defs";
|
||||
import { Request } from "../request";
|
||||
import { updateResult } from "./updateResult";
|
||||
|
|
@ -93,7 +96,8 @@ const funcList: ReaderFn[] = [
|
|||
unlockProfile,
|
||||
updateProvisionalStoreRank,
|
||||
updateResult,
|
||||
updateStoryClearNum,
|
||||
updateStoryClearNum1,
|
||||
updateStoryClearNum2,
|
||||
updateTeamPoints,
|
||||
updateUiReport,
|
||||
updateUserLog,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,29 @@
|
|||
import { RequestCode } from "./_defs";
|
||||
import { UpdateStoryClearNumRequest } from "../request/updateStoryClearNum";
|
||||
import {
|
||||
UpdateStoryClearNumRequest1,
|
||||
UpdateStoryClearNumRequest2,
|
||||
} from "../request/updateStoryClearNum";
|
||||
|
||||
updateStoryClearNum.msgCode = 0x007f as RequestCode;
|
||||
updateStoryClearNum.msgLen = 0x0010;
|
||||
updateStoryClearNum1.msgCode = 0x007f as RequestCode;
|
||||
updateStoryClearNum1.msgLen = 0x0010;
|
||||
|
||||
export function updateStoryClearNum(buf: Buffer): UpdateStoryClearNumRequest {
|
||||
export function updateStoryClearNum1(
|
||||
buf: Buffer
|
||||
): UpdateStoryClearNumRequest1 {
|
||||
return {
|
||||
type: "update_story_clear_num_req",
|
||||
format: 1,
|
||||
};
|
||||
}
|
||||
|
||||
updateStoryClearNum2.msgCode = 0x013d as RequestCode;
|
||||
updateStoryClearNum2.msgLen = 0x0010;
|
||||
|
||||
export function updateStoryClearNum2(
|
||||
buf: Buffer
|
||||
): UpdateStoryClearNumRequest2 {
|
||||
return {
|
||||
type: "update_story_clear_num_req",
|
||||
format: 2,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,36 @@
|
|||
import { UpdateStoryClearNumResponse } from "../response/updateStoryClearNum";
|
||||
import {
|
||||
UpdateStoryClearNumResponse,
|
||||
UpdateStoryClearNumResponse1,
|
||||
UpdateStoryClearNumResponse2,
|
||||
} from "../response/updateStoryClearNum";
|
||||
|
||||
export function updateStoryClearNum(res: UpdateStoryClearNumResponse) {
|
||||
export function updateStoryClearNum(res: UpdateStoryClearNumResponse): Buffer {
|
||||
switch (res.format) {
|
||||
case 1:
|
||||
return updateStoryClearNum1(res);
|
||||
|
||||
case 2:
|
||||
return updateStoryClearNum2(res);
|
||||
|
||||
default:
|
||||
const exhaust: never = res;
|
||||
|
||||
throw new Error(`Unsupported data format ${res["format"]}`);
|
||||
}
|
||||
}
|
||||
|
||||
function updateStoryClearNum1(res: UpdateStoryClearNumResponse1): Buffer {
|
||||
const buf = Buffer.alloc(0x0220);
|
||||
|
||||
buf.writeInt16LE(0x0080, 0x0000);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
function updateStoryClearNum2(res: UpdateStoryClearNumResponse2): Buffer {
|
||||
const buf = Buffer.alloc(0x04f0);
|
||||
|
||||
buf.writeInt16LE(0x013e, 0x0000);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,5 +8,6 @@ export function updateStoryClearNum(
|
|||
): UpdateStoryClearNumResponse {
|
||||
return {
|
||||
type: "update_story_clear_num_res",
|
||||
format: req.format as any,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
export interface UpdateStoryClearNumRequest {
|
||||
interface UpdateStoryClearNumRequestBase {
|
||||
type: "update_story_clear_num_req";
|
||||
}
|
||||
|
||||
export interface UpdateStoryClearNumRequest1
|
||||
extends UpdateStoryClearNumRequestBase {
|
||||
format: 1;
|
||||
}
|
||||
|
||||
export interface UpdateStoryClearNumRequest2
|
||||
extends UpdateStoryClearNumRequestBase {
|
||||
format: 2;
|
||||
}
|
||||
|
||||
export type UpdateStoryClearNumRequest =
|
||||
| UpdateStoryClearNumRequest1
|
||||
| UpdateStoryClearNumRequest2;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,18 @@
|
|||
export interface UpdateStoryClearNumResponse {
|
||||
interface UpdateStoryClearNumResponseBase {
|
||||
type: "update_story_clear_num_res";
|
||||
// TODO, looks like a table of 9 * 10 u32 fields
|
||||
}
|
||||
|
||||
export interface UpdateStoryClearNumResponse1
|
||||
extends UpdateStoryClearNumResponseBase {
|
||||
format: 1;
|
||||
}
|
||||
|
||||
export interface UpdateStoryClearNumResponse2
|
||||
extends UpdateStoryClearNumResponseBase {
|
||||
format: 2;
|
||||
}
|
||||
|
||||
export type UpdateStoryClearNumResponse =
|
||||
| UpdateStoryClearNumResponse1
|
||||
| UpdateStoryClearNumResponse2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user