mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-22 15:39:18 +00:00
remove unused packet chunk decoder
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import Chunk from './chunk';
|
import Chunk from './chunk';
|
||||||
import Packet from './packet';
|
|
||||||
import PacketHeaderChunk from './packet-header-chunk';
|
import PacketHeaderChunk from './packet-header-chunk';
|
||||||
|
|
||||||
import DataPacketChunk from './data/data-packet-chunk';
|
import DataPacketChunk from './data/data-packet-chunk';
|
||||||
@@ -18,7 +17,6 @@ import InfoTrackerNameChunk from './info/info-tracker-name-chunk';
|
|||||||
export const Decoders = {
|
export const Decoders = {
|
||||||
Chunk,
|
Chunk,
|
||||||
PacketHeaderChunk,
|
PacketHeaderChunk,
|
||||||
Packet,
|
|
||||||
DataPacketChunk,
|
DataPacketChunk,
|
||||||
DataTrackerChunk,
|
DataTrackerChunk,
|
||||||
DataTrackerXYZChunk,
|
DataTrackerXYZChunk,
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
import { Decoders } from '.';
|
|
||||||
import { DataPacketChunk } from '../models/data/data-packet-chunk';
|
|
||||||
import { InfoPacketChunk } from '../models/info/info-packet-chunk';
|
|
||||||
|
|
||||||
export default (buffer: Uint8Array): InfoPacketChunk | DataPacketChunk | undefined => {
|
|
||||||
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
||||||
const chunkId = view.getUint16(0, true);
|
|
||||||
|
|
||||||
switch (chunkId) {
|
|
||||||
case 0x6756:
|
|
||||||
return Decoders.InfoPacketChunk(buffer);
|
|
||||||
case 0x6755:
|
|
||||||
return Decoders.DataPacketChunk(buffer);
|
|
||||||
default:
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user