mirror of
https://github.com/djhackersdev/minime.git
synced 2026-08-22 02:14:08 -05:00
assorted shit
This commit is contained in:
@@ -11,9 +11,9 @@ export function car(buf: Buffer): Car {
|
||||
field_00: buf.readUInt16LE(0x0000),
|
||||
field_02: buf.readUInt16LE(0x0002),
|
||||
field_04,
|
||||
model: buf.readUInt16LE(0x0044),
|
||||
color: buf.readUInt16LE(0x0046),
|
||||
transmission: buf.readUInt16LE(0x0048),
|
||||
field_44: buf.readUInt16LE(0x0044),
|
||||
field_46: buf.readUInt16LE(0x0046),
|
||||
field_48: buf.readUInt16LE(0x0048),
|
||||
field_4A: buf.readUInt16LE(0x004a),
|
||||
field_4C: buf.readUInt32LE(0x004c),
|
||||
field_50_lo: buf.readUInt32LE(0x0050),
|
||||
|
||||
@@ -32,6 +32,7 @@ import { loadTopTen } from "./loadTopTen";
|
||||
import { updateResult } from "./updateResult";
|
||||
import { updateTeamPoints } from "./updateTeamPoints";
|
||||
import { updateUiReport } from "./updateUiReport";
|
||||
import { updateUserLog } from "./updateUserLog";
|
||||
|
||||
export type ReaderFn = ((buf: Buffer) => Request) & {
|
||||
msgCode: RequestCode;
|
||||
@@ -70,6 +71,7 @@ const funcList: ReaderFn[] = [
|
||||
updateStoryClearNum,
|
||||
updateTeamPoints,
|
||||
updateUiReport,
|
||||
updateUserLog,
|
||||
];
|
||||
|
||||
const readerFns = new Map<RequestCode, ReaderFn>();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { car } from "./_car";
|
||||
import { RequestCode } from "./_defs";
|
||||
import { Id, TitleCode } from "../model/base";
|
||||
import { Profile } from "../model/profile";
|
||||
@@ -35,6 +36,7 @@ export function saveProfile(buf: Buffer): SaveProfileRequest {
|
||||
fame: buf.readUInt32LE(0x0468),
|
||||
dpoint: buf.readUInt32LE(0x0464),
|
||||
titles: bitmap(buf.slice(0x0042, 0x00f6)) as TitleCode[],
|
||||
car: car(buf.slice(0x0834, 0x0894)),
|
||||
story: {
|
||||
x: buf.readUInt16LE(0x06fc),
|
||||
y: buf.readUInt8(0x06e0),
|
||||
|
||||
9
src/idz/decoder/updateUserLog.ts
Normal file
9
src/idz/decoder/updateUserLog.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { RequestCode } from "./_defs";
|
||||
import { UpdateUserLogRequest } from "../request/updateUserLog";
|
||||
|
||||
updateUserLog.msgCode = 0x00bd as RequestCode;
|
||||
updateUserLog.msgLen = 0x0050;
|
||||
|
||||
export function updateUserLog(buf: Buffer): UpdateUserLogRequest {
|
||||
return { type: "update_user_log_req" };
|
||||
}
|
||||
@@ -13,9 +13,9 @@ export function car(car: Car): Buffer {
|
||||
);
|
||||
}
|
||||
|
||||
buf.writeUInt16LE(car.model, 0x0044);
|
||||
buf.writeUInt8(car.color, 0x0046);
|
||||
buf.writeUInt16LE(car.transmission, 0x0048);
|
||||
buf.writeUInt16LE(car.field_44, 0x0044);
|
||||
buf.writeUInt8(car.field_46, 0x0046);
|
||||
buf.writeUInt16LE(car.field_48, 0x0048);
|
||||
buf.writeUInt16LE(car.field_4A, 0x004a);
|
||||
buf.writeUInt32LE(car.field_4C, 0x004c);
|
||||
buf.writeUInt32LE(car.field_50_lo, 0x0050);
|
||||
|
||||
@@ -36,13 +36,14 @@ export function loadProfile2(res: LoadProfileResponse2) {
|
||||
}
|
||||
}
|
||||
|
||||
buf.writeInt16LE(0x0065, 0x0000);
|
||||
buf.writeInt32LE(res.profileId, 0x03b8);
|
||||
buf.writeUInt16LE(0x0065, 0x0000);
|
||||
buf.writeUInt32LE(res.profileId, 0x03b8);
|
||||
buf.writeUInt16LE(res.settings.bgMusic, 0x03c8);
|
||||
buf.writeInt16LE(res.lv, 0x03cc);
|
||||
buf.writeUInt16LE(res.lv, 0x03cc);
|
||||
buf.writeUInt32LE(res.exp, 0x03d0);
|
||||
buf.writeUInt32LE(settingsPack, 0x3d8);
|
||||
buf.writeInt32LE(res.dpoint, 0x03e8);
|
||||
buf.writeInt32LE(res.fame, 0x0404);
|
||||
buf.writeUInt32LE(res.dpoint, 0x03e8);
|
||||
buf.writeUInt32LE(res.fame, 0x0404);
|
||||
iconv.encode(res.name + "\0", "shift_jis").copy(buf, 0x03ee);
|
||||
buf.writeUInt16LE(res.story.x, 0x06bc);
|
||||
buf.writeUInt8(res.story.y, 0x0670);
|
||||
|
||||
@@ -27,6 +27,7 @@ import { updateResult } from "./updateResult";
|
||||
import { updateStoryClearNum } from "./updateStoryClearNum";
|
||||
import { updateTeamPoints } from "./updateTeamPoints";
|
||||
import { updateUiReport } from "./updateUiReport";
|
||||
import { updateUserLog } from "./updateUserLog";
|
||||
import { Request } from "../request";
|
||||
import { Response } from "../response";
|
||||
import { World } from "../world";
|
||||
@@ -123,6 +124,9 @@ export async function dispatch(w: World, req: Request): Promise<Response> {
|
||||
case "update_ui_report_req":
|
||||
return updateUiReport(w, req);
|
||||
|
||||
case "update_user_log_req":
|
||||
return updateUserLog(w, req);
|
||||
|
||||
default:
|
||||
const exhaustCheck: never = req;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ export async function loadProfile(
|
||||
name: profile.name,
|
||||
profileId: profile.id,
|
||||
lv: profile.lv,
|
||||
exp: profile.exp,
|
||||
fame: profile.fame,
|
||||
dpoint: profile.dpoint,
|
||||
teamId: profile.teamId,
|
||||
|
||||
@@ -16,6 +16,7 @@ export async function saveProfile(
|
||||
fame: req.fame,
|
||||
dpoint: req.dpoint,
|
||||
}),
|
||||
w.car().save(req.profileId, req.car),
|
||||
w.story().save(req.profileId, req.story),
|
||||
w.titles().save(req.profileId, req.titles),
|
||||
]);
|
||||
|
||||
10
src/idz/handler/updateUserLog.ts
Normal file
10
src/idz/handler/updateUserLog.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { UpdateUserLogRequest } from "../request/updateUserLog";
|
||||
import { GenericResponse } from "../response/generic";
|
||||
import { World } from "../world";
|
||||
|
||||
export function updateUserLog(
|
||||
w: World,
|
||||
req: UpdateUserLogRequest
|
||||
): GenericResponse {
|
||||
return { type: "generic_res" };
|
||||
}
|
||||
@@ -2,9 +2,9 @@ export interface Car {
|
||||
field_00: number;
|
||||
field_02: number;
|
||||
field_04: number[];
|
||||
model: number;
|
||||
color: number;
|
||||
transmission: number;
|
||||
field_44: number;
|
||||
field_46: number;
|
||||
field_48: number;
|
||||
field_4A: number;
|
||||
field_4C: number;
|
||||
field_50_lo: number;
|
||||
|
||||
@@ -28,6 +28,7 @@ import { UpdateResultRequest } from "./updateResult";
|
||||
import { UpdateStoryClearNumRequest } from "./updateStoryClearNum";
|
||||
import { UpdateTeamPointsRequest } from "./updateTeamPoints";
|
||||
import { UpdateUiReportRequest } from "./updateUiReport";
|
||||
import { UpdateUserLogRequest } from "./updateUserLog";
|
||||
|
||||
export type Request =
|
||||
| CheckRankRequest
|
||||
@@ -59,4 +60,5 @@ export type Request =
|
||||
| UpdateResultRequest
|
||||
| UpdateStoryClearNumRequest
|
||||
| UpdateTeamPointsRequest
|
||||
| UpdateUiReportRequest;
|
||||
| UpdateUiReportRequest
|
||||
| UpdateUserLogRequest;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Id, TitleCode } from "../model/base";
|
||||
import { Car } from "../model/car";
|
||||
import { Profile } from "../model/profile";
|
||||
import { Story } from "../model/story";
|
||||
|
||||
@@ -10,5 +11,6 @@ export interface SaveProfileRequest {
|
||||
fame: number;
|
||||
dpoint: number;
|
||||
titles: TitleCode[];
|
||||
car: Car;
|
||||
story: Story;
|
||||
}
|
||||
|
||||
3
src/idz/request/updateUserLog.ts
Normal file
3
src/idz/request/updateUserLog.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface UpdateUserLogRequest {
|
||||
type: "update_user_log_req";
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export interface LoadProfileResponse2 {
|
||||
name: string;
|
||||
profileId: Id<Profile>;
|
||||
lv: number;
|
||||
exp: number;
|
||||
fame: number;
|
||||
dpoint: number;
|
||||
teamId?: number;
|
||||
|
||||
Reference in New Issue
Block a user