Skip to content

Commit

Permalink
Parse instance id info (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCondron authored Oct 5, 2023
1 parent 433d515 commit 4e550a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ export type PostFrameUpdateType = {
selfInducedSpeeds: SelfInducedSpeedsType | null;
hitlagRemaining: number | null;
animationIndex: number | null;
instanceHitBy: number | null;
instanceId: number | null;
};

export type SelfInducedSpeedsType = {
Expand Down Expand Up @@ -233,6 +235,7 @@ export type ItemUpdateType = {
chargeShotLaunched: number | null;
chargePower: number | null;
owner: number | null;
instanceId: number | null;
};

export type FrameBookendType = {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/slpReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ export function parseMessage(command: Command, payload: Uint8Array): EventPayloa
selfInducedSpeeds: selfInducedSpeeds,
hitlagRemaining: readFloat(view, 0x49),
animationIndex: readUint32(view, 0x4d),
instanceHitBy: readUint16(view, 0x51),
instanceId: readUint16(view, 0x53),
};
case Command.ITEM_UPDATE:
return {
Expand All @@ -531,6 +533,7 @@ export function parseMessage(command: Command, payload: Uint8Array): EventPayloa
chargeShotLaunched: readUint8(view, 0x28),
chargePower: readUint8(view, 0x29),
owner: readInt8(view, 0x2a),
instanceId: readUint16(view, 0x2b),
};
case Command.FRAME_BOOKEND:
return {
Expand Down

0 comments on commit 4e550a8

Please sign in to comment.