Skip to content

JavaScript utilities that can interact/interoperate with Desynced

License

Notifications You must be signed in to change notification settings

ribrdb/DesyncedJavaScriptUtils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Desynced JavaScript Utilities

JavaScript utilities that can interact/interoperate with Desynced

Example

See https://stagegames.github.io/DesyncedJavaScriptUtils/ and the code in index.html for a demo how to use the utilities.

Base62 Data Converter (dsconvert.js)

This contains functionality to convert between Base62 encoded Desynced strings with a Lua table (i.e. copied blueprints or behaviors) and JavaScript objects (thus also JSON). So far, this only contains a decoder. To use it, include dsconvert.js and call the function DesyncedStringToObject with a string and it will return the decoded object. Optionally, an empty object can be passed as a second argument to receive the type letter of the encoded text. If the input string is invalid, an error will be thrown.

var info = {};
var obj = DesyncedStringToObject(encoded_desynced_string, info);
var obj_as_json = JSON.stringify(obj, null, 4);
var type_text = (info.type == "B" ? "BLUEPRINT" : info.type == "C" ? "BEHAVIOR" : "UNKNOWN");

License

The code in this project is available under the MIT license.

About

JavaScript utilities that can interact/interoperate with Desynced

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 87.8%
  • HTML 12.2%