1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

Update changelog and minor fixes

This commit is contained in:
tobspr 2020-10-31 12:19:51 +01:00
parent 785eb31c8d
commit b17cb6952b
3 changed files with 27 additions and 2 deletions

View File

@ -5,6 +5,8 @@ export const CHANGELOG = [
entries: [
"Fixed stacking bug for level 26 which required restarting the game",
"Fix reward notification being too long sometimes (by LeopoldTal)",
"Use locale decimal separator on belt reader display (by LeopoldTal)",
"Vastly improved performance when saving games (by LeopoldTal)",
"Updated translations",
],
},

View File

@ -26,7 +26,8 @@ export const THIRDPARTY_URLS = {
},
};
export const A_B_TESTING_LINK_TYPE = Math.random() > 0.5 ? "steam_1_pr" : "steam_2_npr";
// export const A_B_TESTING_LINK_TYPE = Math.random() > 0.95 ? "steam_1_pr" : "steam_2_npr";
export const A_B_TESTING_LINK_TYPE = "steam_2_npr";
export const globalConfig = {
// Size of a single tile in Pixels.

View File

@ -59,6 +59,12 @@ if (G_IS_DEV) {
}
}
/**
* @param {any} obj
* @param {Map} keys
* @param {Map} values
* @returns {any[]|object|number|string}
*/
function compressObjectInternal(obj, keys, values) {
if (Array.isArray(obj)) {
let result = [];
@ -89,14 +95,21 @@ function compressObjectInternal(obj, keys, values) {
return obj;
}
/**
* @param {Map} hashMap
* @returns {Array}
*/
function indexMapToArray(hashMap) {
const result = [];
const result = new Array(hashMap.size);
hashMap.forEach((index, key) => {
result[index] = key;
});
return result;
}
/**
* @param {object} obj
*/
export function compressObject(obj) {
const keys = new Map();
const values = new Map();
@ -108,6 +121,12 @@ export function compressObject(obj) {
};
}
/**
* @param {object} obj
* @param {string[]} keys
* @param {any[]} values
* @returns {object}
*/
function decompressObjectInternal(obj, keys = [], values = []) {
if (Array.isArray(obj)) {
let result = [];
@ -130,6 +149,9 @@ function decompressObjectInternal(obj, keys = [], values = []) {
return obj;
}
/**
* @param {object} obj
*/
export function decompressObject(obj) {
if (obj.keys && obj.values && obj.data) {
const keys = obj.keys;