33 lines
1.8 KiB
TypeScript
33 lines
1.8 KiB
TypeScript
export default class Globals {
|
|
static DOWNLOAD_DIR = '/home/michael/Downloads'; // TODO: not hard coded
|
|
static PERSONALDB_FILE = './db/personal.db';
|
|
|
|
static DEFAULT_SOCKET_TIMEOUT = 5000; // Wait up to 5000ms for the guild to respond before rejecting/throwing an error
|
|
|
|
static MAX_CURRENT_MESSAGES = 300;
|
|
static MESSAGES_PER_REQUEST = 100;
|
|
|
|
static MAX_TEXT_MESSAGE_LENGTH = 1024 * 2; // 2 KB character message max (for readability)
|
|
static MAX_RESOURCE_SIZE = 1024 * 1024 * 10; // 10 MB max resource size (guild is 50, client-side is limited until socket.io-stream)
|
|
|
|
static MAX_AVATAR_SIZE = 1024 * 128; // 128 KB max avatar size
|
|
static MAX_DISPLAY_NAME_LENGTH = 32; // 32 char max display name length
|
|
|
|
static MAX_ICON_SIZE = 1024 * 128; // 128 KB max guild icon size
|
|
static MAX_GUILD_NAME_LENGTH = 64; // 64 char max guild name length
|
|
|
|
static MAX_CHANNEL_NAME_LENGTH = 32; // 32 char max channel name length
|
|
static MAX_CHANNEL_FLAVOR_TEXT_LENGTH = 256; // 256 char max channel flavor text length
|
|
|
|
static MAX_CACHED_CHANNEL_MESSAGES = 1000; // the 1000 most recent messages in each text channel are cached (in the sqlite db)
|
|
|
|
static MAX_GUILD_RESOURCE_CACHE_SIZE = 1024 * 1024 * 1024; // 1 GB max resource cache per guild
|
|
static MAX_CACHED_RESOURCE_SIZE = 1024 * 1024 * 4; // 4 MB is the biggest resource that will be cached
|
|
|
|
static MAX_RAM_CACHED_MESSAGES_CHANNEL_CHARACTERS = 1024 * 1024 * 64; // at most, 64 MB of channel
|
|
static MAX_RAM_CACHED_MESSAGES_TOTAL_CHARACTERS = 1024 * 1024 * 256; // at most 256 MB of total message characters in ram
|
|
|
|
static MAX_RAM_CACHED_MESSAGES_CHANNEL_SIZE = 1024 * 1024 * 64; // at most, 64 MB of messages are cached in RAM per channel
|
|
static MAX_RAM_CACHED_MESSAGES_TOTAL_SIZE = 1024 * 1024 * 256; // 256 MB max message cache (text length)
|
|
}
|