mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
cool, now i **have** to fix the master branch. ree
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a given collection to an array.
|
* Converts a given collection to an array.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that returns the result of invoking the given
|
* Creates a function that returns the result of invoking the given
|
||||||
* functions, where each successive invocation is supplied the return
|
* functions, where each successive invocation is supplied the return
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
const inception = Date.now();
|
const inception = Date.now();
|
||||||
|
|
||||||
// Runtime detection
|
// Runtime detection
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Limits a number to the range between 'min' and 'max'.
|
* Limits a number to the range between 'min' and 'max'.
|
||||||
*/
|
*/
|
||||||
|
|||||||
6
tgui/packages/common/react.js
vendored
6
tgui/packages/common/react.js
vendored
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for conditionally adding/removing classes in React
|
* Helper for conditionally adding/removing classes in React
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { compose } from './fp';
|
import { compose } from './fp';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* This plugin saves overall about 10KB on the final bundle size, so it's
|
||||||
|
* sort of worth it.
|
||||||
|
*
|
||||||
* We are using a .cjs extension because:
|
* We are using a .cjs extension because:
|
||||||
*
|
*
|
||||||
* 1. Webpack CLI only supports CommonJS modules;
|
* 1. Webpack CLI only supports CommonJS modules;
|
||||||
@@ -9,8 +11,9 @@
|
|||||||
* We need to copy-paste the whole "multiline" function because we can't
|
* We need to copy-paste the whole "multiline" function because we can't
|
||||||
* synchronously import an ES module from a CommonJS module.
|
* synchronously import an ES module from a CommonJS module.
|
||||||
*
|
*
|
||||||
* This plugin saves overall about 10KB on the final bundle size, so it's
|
* @file
|
||||||
* sort of worth it.
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes excess whitespace and indentation from the string.
|
* Removes excess whitespace and indentation from the string.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a function, that, as long as it continues to be invoked, will
|
* Returns a function, that, as long as it continues to be invoked, will
|
||||||
* not be triggered. The function will be called after it stops being
|
* not be triggered. The function will be called after it stops being
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { map, reduce, zipWith } from './collections';
|
import { map, reduce, zipWith } from './collections';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { setupWebpack, getWebpackConfig } from './webpack.js';
|
import { setupWebpack, getWebpackConfig } from './webpack.js';
|
||||||
import { reloadByondCache } from './reloader.js';
|
import { reloadByondCache } from './reloader.js';
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
let socket;
|
let socket;
|
||||||
const queue = [];
|
const queue = [];
|
||||||
const subscribers = [];
|
const subscribers = [];
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { createLogger } from 'common/logging.js';
|
import { createLogger } from 'common/logging.js';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { basename } from 'path';
|
import { basename } from 'path';
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { createLogger, directLog } from 'common/logging.js';
|
import { createLogger, directLog } from 'common/logging.js';
|
||||||
import http from 'http';
|
import http from 'http';
|
||||||
import { inspect } from 'util';
|
import { inspect } from 'util';
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { createLogger } from 'common/logging.js';
|
import { createLogger } from 'common/logging.js';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import { basename } from 'path';
|
import { basename } from 'path';
|
||||||
import { promisify } from 'util';
|
import { promisify } from 'util';
|
||||||
import { resolveGlob, resolvePath } from './util.js';
|
import { resolveGlob, resolvePath } from './util.js';
|
||||||
|
import { regQuery } from './winreg.js';
|
||||||
|
|
||||||
const logger = createLogger('reloader');
|
const logger = createLogger('reloader');
|
||||||
|
|
||||||
@@ -40,6 +47,21 @@ export const findCacheRoot = async () => {
|
|||||||
return cacheRoot;
|
return cacheRoot;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Query the Windows Registry
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
logger.log('querying windows registry');
|
||||||
|
let userpath = await regQuery(
|
||||||
|
'HKCU\\Software\\Dantom\\BYOND',
|
||||||
|
'userpath');
|
||||||
|
if (userpath) {
|
||||||
|
cacheRoot = userpath
|
||||||
|
.replace(/\\$/, '')
|
||||||
|
.replace(/\\/g, '/')
|
||||||
|
+ '/cache';
|
||||||
|
logger.log(`found cache at '${cacheRoot}'`);
|
||||||
|
return cacheRoot;
|
||||||
|
}
|
||||||
|
}
|
||||||
logger.log('found no cache directories');
|
logger.log('found no cache directories');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import glob from 'glob';
|
import glob from 'glob';
|
||||||
import { resolve as resolvePath } from 'path';
|
import { resolve as resolvePath } from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { createLogger } from 'common/logging.js';
|
import { createLogger } from 'common/logging.js';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { createRequire } from 'module';
|
import { createRequire } from 'module';
|
||||||
|
|||||||
47
tgui/packages/tgui-dev-server/winreg.js
Normal file
47
tgui/packages/tgui-dev-server/winreg.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
* Tools for dealing with Windows Registry bullshit.
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @copyright 2020 Aleksej Komarov
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exec } from 'child_process';
|
||||||
|
import { createLogger } from 'common/logging.js';
|
||||||
|
import { promisify } from 'util';
|
||||||
|
|
||||||
|
const logger = createLogger('winreg');
|
||||||
|
|
||||||
|
export const regQuery = async (path, key) => {
|
||||||
|
if (process.platform !== 'win32') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const command = `reg query "${path}" /v ${key}`;
|
||||||
|
const { stdout } = await promisify(exec)(command);
|
||||||
|
const keyPattern = ` ${key} `;
|
||||||
|
const indexOfKey = stdout.indexOf(keyPattern);
|
||||||
|
if (indexOfKey === -1) {
|
||||||
|
logger.error('could not find the registry key');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const indexOfEol = stdout.indexOf('\r\n', indexOfKey);
|
||||||
|
if (indexOfEol === -1) {
|
||||||
|
logger.error('could not find the end of the line');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const indexOfValue = stdout.indexOf(
|
||||||
|
' ',
|
||||||
|
indexOfKey + keyPattern.length);
|
||||||
|
if (indexOfValue === -1) {
|
||||||
|
logger.error('could not find the start of the key value');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const value = stdout.substring(indexOfValue + 4, indexOfEol);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
logger.error(err);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user