Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

satisfactory-json

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

satisfactory-json - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

lib/cli/json2sav.d.ts

3

lib/index.d.ts

@@ -1,3 +0,2 @@

export { Sav2Json } from './sav2json';
export { Json2Sav } from './json2sav';
export { sav2json, json2sav } from './transform';
export * from './types';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var sav2json_1 = require("./sav2json");
exports.Sav2Json = sav2json_1.Sav2Json;
var json2sav_1 = require("./json2sav");
exports.Json2Sav = json2sav_1.Json2Sav;
var transform_1 = require("./transform");
exports.sav2json = transform_1.sav2json;
exports.json2sav = transform_1.json2sav;

@@ -246,3 +246,7 @@ "use strict";

this.buffer.writeLengthPrefixedString(structProperty.value.type, false);
this.buffer.writeHex(structProperty.structUnknown, false);
this.buffer.writeInt(0, false);
this.buffer.writeInt(0, false);
this.buffer.writeInt(0, false);
this.buffer.writeInt(0, false);
this.buffer.writeByte(0, false);
const structType = structProperty.value.type;

@@ -352,3 +356,4 @@ switch (structType) {

this.buffer.writeLengthPrefixedString(arrayProperty.structInnerType, false);
this.buffer.writeHex(arrayProperty.structUnknown, false);
this.buffer.writeHex(arrayProperty.value.unknown, false);
this.buffer.writeByte(0, false);
for (const prop of property.value.values) {

@@ -426,2 +431,3 @@ const obj = prop;

case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
// tslint:enable

@@ -480,3 +486,3 @@ this.writeConveyorBeltExtra(entity);

writeVehicleExtra(entity) {
this.buffer.writeInt(entity.extra.objects.count);
this.buffer.writeInt(entity.extra.objects.length);
for (const object of entity.extra.objects) {

@@ -488,3 +494,3 @@ this.buffer.writeLengthPrefixedString(object.name);

writeConveyorBeltExtra(entity) {
/*this.buffer.writeInt(entity.extra.items.count);
this.buffer.writeInt(entity.extra.items.length);
for (const item of entity.extra.items) {

@@ -496,3 +502,3 @@ this.buffer.writeInt(0);

this.buffer.writeFloat(item.position);
}*/
}
}

@@ -499,0 +505,0 @@ error(message) {

@@ -255,4 +255,4 @@ "use strict";

entity.missing = buffer.readHex(missing);
/*console.warn('missing data found in entity of type ' + className +
': ' + entity.missing);*/
console.warn('missing data found in entity of type ' + className +
': ' + entity.missing);
}

@@ -381,3 +381,7 @@ else if (missing < 0) {

const type = buffer.readLengthPrefixedString();
const unknown = buffer.readHex(17);
this.buffer.assertNullInt();
this.buffer.assertNullInt();
this.buffer.assertNullInt();
this.buffer.assertNullInt();
this.buffer.assertNullByte();
switch (type) {

@@ -390,3 +394,2 @@ case 'Vector':

index,
structUnknown: unknown,
value: {

@@ -406,3 +409,2 @@ type,

index,
structUnknown: unknown,
value: {

@@ -430,3 +432,2 @@ type,

index,
structUnknown: unknown,
value: {

@@ -447,3 +448,2 @@ type,

index,
structUnknown: unknown,
value: {

@@ -466,3 +466,2 @@ type,

index,
structUnknown: unknown,
value: {

@@ -480,3 +479,2 @@ type,

index,
structUnknown: unknown,
value: {

@@ -494,18 +492,16 @@ type,

case 'InventoryStack':
case 'ProjectileData':
{
const props = [];
while (this.readProperty(buffer, props)) { }
properties.push({
name,
type: prop,
index,
structUnknown: unknown,
value: {
type,
properties: props
}
});
break;
}
case 'ProjectileData': {
const props = [];
while (this.readProperty(buffer, props)) { }
properties.push({
name,
type: prop,
index,
value: {
type,
properties: props
}
});
break;
}
case 'InventoryItem': {

@@ -523,3 +519,2 @@ const unk1 = buffer.readLengthPrefixedString();

index,
structUnknown: unknown,
value: {

@@ -541,3 +536,2 @@ type,

index,
structUnknown: unknown,
value: {

@@ -558,3 +552,2 @@ type,

index,
structUnknown: unknown,
value: {

@@ -609,3 +602,9 @@ type,

const structInnerType = buffer.readLengthPrefixedString();
const structUnknown = buffer.readHex(17); // TODO
// is not just 0s in BP_PlayerState -> mShoppingList
const unknown = this.buffer.readHex(16);
if (unknown !== '00000000000000000000000000000000') {
console.warn(unknown);
console.warn('Unknown data in inner struct ' + name);
}
this.buffer.assertNullByte();
for (let j = 0; j < count; j++) {

@@ -625,5 +624,5 @@ const props = [];

structInnerType,
structUnknown,
value: {
type: itemType,
unknown,
values

@@ -717,2 +716,3 @@ }

case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
// tslint:enable

@@ -819,16 +819,13 @@ this.readConveyorBeltExtra(entity, length);

readConveyorBeltExtra(entity, length) {
/*const itemCount = this.buffer.readInt();
const items: any[] = [];
const itemCount = this.buffer.readInt();
const items = [];
// ignore item count
while (this.buffer.bytesRead < length) {
//for (let i = 0; i < itemCount; i++) {
// while (this.buffer.bytesRead < length) {
for (let i = 0; i < itemCount; i++) {
if (this.buffer.bytesRead >= length) {
//console.warn('Item count is ' + itemCount +
//' while there are only ' + i + ' items in there');
console.warn('Item count is ' + itemCount +
' while there are only ' + i + ' items in there');
break;
}
console.log(length - this.buffer.bytesRead + ' left ' + itemCount);
// console.log(length - this.buffer.bytesRead + ' left ' + itemCount);
this.buffer.assertNullInt();

@@ -838,3 +835,2 @@ const name = this.buffer.readLengthPrefixedString();

this.buffer.assertNullInt();
items.push({

@@ -847,3 +843,3 @@ name,

items
};*/
};
}

@@ -850,0 +846,0 @@ error(message) {

{
"name": "satisfactory-json",
"version": "0.0.15",
"version": "0.0.16",
"description": "Convert Satisfactory save files to JSON and back",

@@ -12,2 +12,3 @@ "main": "lib/index.js",

"@types/node": "^12.0.4",
"ts-node": "^8.3.0",
"tslint": "^5.17.0",

@@ -21,7 +22,16 @@ "typescript": "^3.5.1"

"prepublish": "yarn build",
"postversion": "git push && git push --tags"
"postversion": "git push && git push --tags",
"sav2json": "ts-node src/cli/sav2json.ts",
"json2sav": "ts-node src/cli/json2sav.ts"
},
"files": [
"lib/**/*"
]
],
"bin": {
"sav2json": "./lib/sav2json.js",
"json2sav": "./lib/json2sav.js"
},
"dependencies": {
"commander": "^2.20.0"
}
}
# satisfactory-json
Library to convert from Satisfactory save files to a JSON format and back.
Library to convert from Satisfactory save files to a JSON format and back.
## Usage
```ts
import { SaveGame, sav2json, json2sav} from 'satisfactory-json';
const saveFileData: Buffer;
// convert sav -> json
const saveGame: SaveGame = sav2json(saveFileData);
// convert json -> sav
const saveData: string = json2sav(saveGame);
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc