From 5ad20f6823be2a76d4a564a010472531ad364076 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Tue, 2 Sep 2025 07:46:46 -0400 Subject: [PATCH] Created seperate commands in build script to build client and server documentation seperately. --- package.json | 2 +- www/doc/module.exports.html | 173189 --------------- www/doc/{ => server}/activeChannel.html | 2 +- .../app_channel_activeChannel.js.html | 2 +- .../app_channel_channelManager.js.html | 2 +- www/doc/{ => server}/app_channel_chat.js.html | 2 +- .../app_channel_chatBuffer.js.html | 2 +- .../app_channel_chatHandler.js.html | 2 +- .../app_channel_commandPreprocessor.js.html | 2 +- .../app_channel_connectedUser.js.html | 2 +- .../app_channel_media_media.js.html | 2 +- .../app_channel_media_playlistHandler.js.html | 2 +- .../app_channel_media_queue.js.html | 2 +- .../app_channel_media_queuedMedia.js.html | 2 +- .../{ => server}/app_channel_tokebot.js.html | 10 +- www/doc/{ => server}/channelManager.html | 2 +- www/doc/{ => server}/chat.html | 2 +- www/doc/{ => server}/chatBuffer.html | 2 +- www/doc/{ => server}/chatHandler.html | 2 +- www/doc/{ => server}/commandPreprocessor.html | 2 +- www/doc/{ => server}/commandProcessor.html | 2 +- www/doc/{ => server}/connectedUser.html | 2 +- .../fonts/OpenSans-Bold-webfont.eot | Bin .../fonts/OpenSans-Bold-webfont.svg | 0 .../fonts/OpenSans-Bold-webfont.woff | Bin .../fonts/OpenSans-BoldItalic-webfont.eot | Bin .../fonts/OpenSans-BoldItalic-webfont.svg | 0 .../fonts/OpenSans-BoldItalic-webfont.woff | Bin .../fonts/OpenSans-Italic-webfont.eot | Bin .../fonts/OpenSans-Italic-webfont.svg | 0 .../fonts/OpenSans-Italic-webfont.woff | Bin .../fonts/OpenSans-Light-webfont.eot | Bin .../fonts/OpenSans-Light-webfont.svg | 0 .../fonts/OpenSans-Light-webfont.woff | Bin .../fonts/OpenSans-LightItalic-webfont.eot | Bin .../fonts/OpenSans-LightItalic-webfont.svg | 0 .../fonts/OpenSans-LightItalic-webfont.woff | Bin .../fonts/OpenSans-Regular-webfont.eot | Bin .../fonts/OpenSans-Regular-webfont.svg | 0 .../fonts/OpenSans-Regular-webfont.woff | Bin www/doc/{ => server}/global.html | 2 +- www/doc/{ => server}/index.html | 33 +- www/doc/{ => server}/media.html | 2 +- www/doc/{ => server}/playlistHandler.html | 2 +- www/doc/{ => server}/queue.html | 2 +- www/doc/{ => server}/queuedMedia.html | 2 +- .../schemas_channel_channelBanSchema.js.html | 2 +- ...as_channel_channelPermissionSchema.js.html | 2 +- .../schemas_channel_channelSchema.js.html | 2 +- .../schemas_channel_chatSchema.js.html | 2 +- .../schemas_channel_media_mediaSchema.js.html | 2 +- ..._channel_media_playlistMediaSchema.js.html | 2 +- ...hemas_channel_media_playlistSchema.js.html | 2 +- ...as_channel_media_queuedMediaSchema.js.html | 2 +- .../{ => server}/schemas_emoteSchema.js.html | 2 +- .../{ => server}/schemas_flairSchema.js.html | 2 +- .../schemas_permissionSchema.js.html | 2 +- .../{ => server}/schemas_statSchema.js.html | 2 +- .../schemas_tokebot_tokeCommandSchema.js.html | 2 +- .../schemas_user_emailChangeSchema.js.html | 2 +- .../schemas_user_passwordResetSchema.js.html | 2 +- .../schemas_user_userBanSchema.js.html | 2 +- .../schemas_user_userSchema.js.html | 2 +- www/doc/{ => server}/scripts/linenumber.js | 0 .../scripts/prettify/Apache-License-2.0.txt | 0 .../{ => server}/scripts/prettify/lang-css.js | 0 .../{ => server}/scripts/prettify/prettify.js | 0 www/doc/{ => server}/styles/jsdoc-default.css | 0 .../{ => server}/styles/prettify-jsdoc.css | 0 .../{ => server}/styles/prettify-tomorrow.css | 0 www/doc/{ => server}/tokebot.html | 142 +- .../{ => server}/utils_altchaUtils.js.html | 2 +- .../{ => server}/utils_configCheck.js.html | 2 +- www/doc/{ => server}/utils_hashUtils.js.html | 2 +- www/doc/{ => server}/utils_linkUtils.js.html | 2 +- .../{ => server}/utils_loggerUtils.js.html | 2 +- www/doc/{ => server}/utils_mailUtils.js.html | 2 +- .../utils_media_internetArchiveUtils.js.html | 2 +- .../{ => server}/utils_media_yanker.js.html | 2 +- .../utils_media_ytdlpUtils.js.html | 2 +- www/doc/{ => server}/utils_regexUtils.js.html | 2 +- www/doc/{ => server}/utils_scheduler.js.html | 2 +- .../{ => server}/utils_sessionUtils.js.html | 2 +- 83 files changed, 95 insertions(+), 173387 deletions(-) delete mode 100644 www/doc/module.exports.html rename www/doc/{ => server}/activeChannel.html (99%) rename www/doc/{ => server}/app_channel_activeChannel.js.html (99%) rename www/doc/{ => server}/app_channel_channelManager.js.html (99%) rename www/doc/{ => server}/app_channel_chat.js.html (99%) rename www/doc/{ => server}/app_channel_chatBuffer.js.html (99%) rename www/doc/{ => server}/app_channel_chatHandler.js.html (99%) rename www/doc/{ => server}/app_channel_commandPreprocessor.js.html (99%) rename www/doc/{ => server}/app_channel_connectedUser.js.html (99%) rename www/doc/{ => server}/app_channel_media_media.js.html (99%) rename www/doc/{ => server}/app_channel_media_playlistHandler.js.html (99%) rename www/doc/{ => server}/app_channel_media_queue.js.html (99%) rename www/doc/{ => server}/app_channel_media_queuedMedia.js.html (99%) rename www/doc/{ => server}/app_channel_tokebot.js.html (98%) rename www/doc/{ => server}/channelManager.html (99%) rename www/doc/{ => server}/chat.html (99%) rename www/doc/{ => server}/chatBuffer.html (99%) rename www/doc/{ => server}/chatHandler.html (99%) rename www/doc/{ => server}/commandPreprocessor.html (99%) rename www/doc/{ => server}/commandProcessor.html (99%) rename www/doc/{ => server}/connectedUser.html (99%) rename www/doc/{ => server}/fonts/OpenSans-Bold-webfont.eot (100%) rename www/doc/{ => server}/fonts/OpenSans-Bold-webfont.svg (100%) rename www/doc/{ => server}/fonts/OpenSans-Bold-webfont.woff (100%) rename www/doc/{ => server}/fonts/OpenSans-BoldItalic-webfont.eot (100%) rename www/doc/{ => server}/fonts/OpenSans-BoldItalic-webfont.svg (100%) rename www/doc/{ => server}/fonts/OpenSans-BoldItalic-webfont.woff (100%) rename www/doc/{ => server}/fonts/OpenSans-Italic-webfont.eot (100%) rename www/doc/{ => server}/fonts/OpenSans-Italic-webfont.svg (100%) rename www/doc/{ => server}/fonts/OpenSans-Italic-webfont.woff (100%) rename www/doc/{ => server}/fonts/OpenSans-Light-webfont.eot (100%) rename www/doc/{ => server}/fonts/OpenSans-Light-webfont.svg (100%) rename www/doc/{ => server}/fonts/OpenSans-Light-webfont.woff (100%) rename www/doc/{ => server}/fonts/OpenSans-LightItalic-webfont.eot (100%) rename www/doc/{ => server}/fonts/OpenSans-LightItalic-webfont.svg (100%) rename www/doc/{ => server}/fonts/OpenSans-LightItalic-webfont.woff (100%) rename www/doc/{ => server}/fonts/OpenSans-Regular-webfont.eot (100%) rename www/doc/{ => server}/fonts/OpenSans-Regular-webfont.svg (100%) rename www/doc/{ => server}/fonts/OpenSans-Regular-webfont.woff (100%) rename www/doc/{ => server}/global.html (99%) rename www/doc/{ => server}/index.html (67%) rename www/doc/{ => server}/media.html (99%) rename www/doc/{ => server}/playlistHandler.html (99%) rename www/doc/{ => server}/queue.html (99%) rename www/doc/{ => server}/queuedMedia.html (99%) rename www/doc/{ => server}/schemas_channel_channelBanSchema.js.html (99%) rename www/doc/{ => server}/schemas_channel_channelPermissionSchema.js.html (99%) rename www/doc/{ => server}/schemas_channel_channelSchema.js.html (99%) rename www/doc/{ => server}/schemas_channel_chatSchema.js.html (99%) rename www/doc/{ => server}/schemas_channel_media_mediaSchema.js.html (99%) rename www/doc/{ => server}/schemas_channel_media_playlistMediaSchema.js.html (99%) rename www/doc/{ => server}/schemas_channel_media_playlistSchema.js.html (99%) rename www/doc/{ => server}/schemas_channel_media_queuedMediaSchema.js.html (99%) rename www/doc/{ => server}/schemas_emoteSchema.js.html (99%) rename www/doc/{ => server}/schemas_flairSchema.js.html (99%) rename www/doc/{ => server}/schemas_permissionSchema.js.html (99%) rename www/doc/{ => server}/schemas_statSchema.js.html (99%) rename www/doc/{ => server}/schemas_tokebot_tokeCommandSchema.js.html (99%) rename www/doc/{ => server}/schemas_user_emailChangeSchema.js.html (99%) rename www/doc/{ => server}/schemas_user_passwordResetSchema.js.html (99%) rename www/doc/{ => server}/schemas_user_userBanSchema.js.html (99%) rename www/doc/{ => server}/schemas_user_userSchema.js.html (99%) rename www/doc/{ => server}/scripts/linenumber.js (100%) rename www/doc/{ => server}/scripts/prettify/Apache-License-2.0.txt (100%) rename www/doc/{ => server}/scripts/prettify/lang-css.js (100%) rename www/doc/{ => server}/scripts/prettify/prettify.js (100%) rename www/doc/{ => server}/styles/jsdoc-default.css (100%) rename www/doc/{ => server}/styles/prettify-jsdoc.css (100%) rename www/doc/{ => server}/styles/prettify-tomorrow.css (100%) rename www/doc/{ => server}/tokebot.html (88%) rename www/doc/{ => server}/utils_altchaUtils.js.html (99%) rename www/doc/{ => server}/utils_configCheck.js.html (99%) rename www/doc/{ => server}/utils_hashUtils.js.html (99%) rename www/doc/{ => server}/utils_linkUtils.js.html (99%) rename www/doc/{ => server}/utils_loggerUtils.js.html (99%) rename www/doc/{ => server}/utils_mailUtils.js.html (99%) rename www/doc/{ => server}/utils_media_internetArchiveUtils.js.html (99%) rename www/doc/{ => server}/utils_media_yanker.js.html (99%) rename www/doc/{ => server}/utils_media_ytdlpUtils.js.html (99%) rename www/doc/{ => server}/utils_regexUtils.js.html (99%) rename www/doc/{ => server}/utils_scheduler.js.html (99%) rename www/doc/{ => server}/utils_sessionUtils.js.html (99%) diff --git a/package.json b/package.json index cb166b1..5c31afb 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "scripts": { "start": "node ./src/server.js", "start:dev": "nodemon ./src/server.js", - "build": "node node_modules/jsdoc/jsdoc.js --recurse src/ --destination www/doc/" + "build": "node node_modules/jsdoc/jsdoc.js --verbose -r src/ -R README.md -d www/doc/server/ && node node_modules/jsdoc/jsdoc.js --verbose -r www/js/ -r README.md -d www/doc/client/" }, "devDependencies": { "nodemon": "^3.1.10", diff --git a/www/doc/module.exports.html b/www/doc/module.exports.html deleted file mode 100644 index 0033064..0000000 --- a/www/doc/module.exports.html +++ /dev/null @@ -1,173189 +0,0 @@ - - - - - JSDoc: Class: exports - - - - - - - - - - -
- -

Class: exports

- - - - - - -
- -
- -

exports(server, chanDB)

- -
Class representing a single active channel
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(server, chanDB)

- - - - - - -
- Instantiates an activeChannel object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
server - - -channelManager - - - - Parent Server Object
chanDB - - -Mongoose.Document - - - - chanDB to rehydrate buffer from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(io)

- -
Class containing global server-side channel connection management logic
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(io)

- - - - - - -
- Instantiates object containing global server-side channel conection management logic -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
io - - -Server - - - - Socket.io server instanced passed down from server.js
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(server)

- -
Class containing global server-side chat relay logic
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(server)

- - - - - - -
- Instantiates a chatHandler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
server - - -channelManager - - - - Parent Server Object
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(userDB, chanRank, channel, socket)

- -
Class representing a single user connected to a channel
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(userDB, chanRank, channel, socket)

- - - - - - -
- Instantiates a connectedUser object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User document to re-hydrate user from
chanRank - - -PemissionModel.chanRank - - - - Enum representing user channel rank
channel - - -String - - - - Channel the user is connecting to
socket - - -Socket - - - - Socket associated with the users connection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(title, fileName, url, id, type, duration, rawLink)

- -
Object representing a piece of media
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(title, fileName, url, id, type, duration, rawLink)

- - - - - - -
- Creates a new media object from scraped information -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
title - - -String - - - - Chosen title of media
fileName - - -String - - - - Original filename/title of media provided by source
url - - -String - - - - Original URL to file
id - - -String - - - - Video ID from source (IE: youtube watch code/archive.org file path)
type - - -String - - - - Original video source
duration - - -Number - - - - Length of media in seconds
rawLink - - -String - - - - URL to raw file copy of media, not applicable to all sources
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(server, channel)

- -
Class containing playlist management logic for a single channel
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(server, channel)

- - - - - - -
- Instantiates a new object to handle playlist management for a single channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
server - - -channelManager - - - - Parent server object
channel - - -activeChannel - - - - Parent Channel object for desired channel queue
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(server, chanDB, channel)

- -
Object represneting a single channel's media queue
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(server, chanDB, channel)

- - - - - - -
- Instantiates a new media queue for a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
server - - -channelManager - - - - Parent server object
chanDB - - -Document - - - - Related Channel Document from DB
channel - - -activeChannel - - - - Parent Channel object for desired channel queue
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(startTime, startTimeStamp, earlyEnd, uuid)

- -
Class extending media which represents a queued piece of media
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(startTime, startTimeStamp, earlyEnd, uuid)

- - - - - - -
- Creates a new queued media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
startTime - - -Number - - - - - - JS Epoch representing start time
startTimeStamp - - -Number - - - - - - 0 - - Media start time stamp in seconds (relative to duration)
earlyEnd - - -Number - - - - - - Media end timestamp in seconds (relative to duration)
uuid - - -String - - - - - - Media object's unique identifier
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - -

Extends

- - - - -
    -
  • media
  • -
- - - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - - - - -
- -
- -

exports(server, chatHandler)

- -
Class containing global server-side tokebot logic
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(server, chatHandler)

- - - - - - -
- Instantiates a tokebot object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
server - - -channelManager - - - - Parent Server Object
chatHandler - - -chatHandler - - - - Parent Chat Handler Object
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) addPersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to add a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Adds media to channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) addToPlaylistValidator(socket, URL) → {Array}

- - - - - - -
- Validates client requests to add media to a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
URL - - -String - - - - URL String handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- List of media objects which where added -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

(async) addToUserPlaylist(socket, data, userDB)

- - - - - - -
- Adds media to user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) asyncFinisher()

- - - - - - -
- This method seems to be a vestage from a bygone era. We should remove it after documenting shit. -I would now, but I don't want to break shit in a comment-only commit. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) authSocket(socket) → {Mongoose.Document}

- - - - - - -
- Global server-side authorization logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- - Authorized User Document upon success -
- - - -
-
- Type -
-
- -Mongoose.Document - - -
-
- - - - - - - - - - - - - -

(async) broadcastChanEmotes(chanDB)

- - - - - - -
- Broadcasts channel emote list to connected users -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastQueue(chanDB)

- - - - - - -
- Broadcasts channel queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) broadcastSiteEmotes()

- - - - - - -
- Broadcast global emote list -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

broadcastUserList()

- - - - - - -
- Broadcasts user list to all users -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Changes default titles for a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) changeDefaultTitlesUserPlaylist(socket, data, userDB)

- - - - - - -
- Changes default titles for a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

changeDefaultTitlesValidator(data) → {Array}

- - - - - - -
- Validates client requests to change default titles for a given playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of strings containing valid titles from the output -
- - - -
-
- Type -
-
- -Array - - -
-
- - - - - - - - - - - - - -

clearChat(user, chan)

- - - - - - -
- Clears chat for a given channel, targets specified user or entire channel if none found/specified. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - User chats to clear
chan - - -String - - - - Channel to broadcast message within
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

cooldown()

- - - - - - -
- Runs every second for 60 seconds after a toke -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

countdown()

- - - - - - -
- Called each second during the toke. Handles decrementing the timer variable, and countdown end logic. -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

crawlConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) createChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Creates a new channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

createPlaylistValidator(socket, data) → {Object}

- - - - - - -
- Validates client requests to create a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated titles -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) createUserPlaylist(socket, data, userDB)

- - - - - - -
- Creates a new user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Define Global Server-Side socket event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines global server-side chat relay event listeners -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

defineListeners(socket)

- - - - - - -
- Defines server-side socket.io listeners for newly connected sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylist(socket, data, userDB)

- - - - - - -
- Deletes a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteChannelPlaylistMedia(socket, data, chanDB)

- - - - - - -
- Deletes media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteMedia(socket, data)

- - - - - - -
- Processes client requests to delete queued media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deletePersonalEmote(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

deletePlaylistMediaValidator(socket, data)

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteRange(socket, data)

- - - - - - -
- Processes request to delete a range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylist(socket, data, chanDB)

- - - - - - -
- Deletes a Channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) deleteUserPlaylistMedia(socket, data, userDB)

- - - - - - -
- Deletes media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

disconnect(reason, type)

- - - - - - -
- Disconnects all sockets for a given user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
reason - - -String - - - - - - Reason for being disconnected
type - - -String - - - - - - Disconnected - - Disconnection Type
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

emit(eventName, data)

- - - - - - -
- Emits an event to all known sockets for a given user - -My brain keeps going back to using dynamic per-user namespaces for this -but everytime i look into it I come to the conclusion that it's a bad idea, then I toy with making chans namespaces -and using per-user channels for this, but what of gold or mod-only features? or games? -No matter what it'd probably end up hacky, as namespaces where meant for splitting app logic not user comms (like rooms). -at the end of the day there has to be some penance for decent multi-session handling on-top of a library that doesn't do it. -Having to crawl through these sockets is that. Because the other ways seem more gross somehow. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eventName - - -String - - - - Event name to emit to client sockets
data - - -Object - - - - Data to emit to client sockets
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) end(quiet, noArchive, volatile, chanDB)

- - - - - - -
- End currently playing media -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
quiet - - -Boolean - - - - - - false - - Enable to prevent ending the media client-side
noArchive - - -Boolean - - - - - - false - - Enable to prevent ended media from being written to channel archive. Deletes media if Volatile is false
volatile - - -Boolean - - - - - - false - - Enable to prevent DB Transactions
chanDB - - -Mongoose.Document - - - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) endLivestream(wasPlaying, chanDB)

- - - - - - -
- Ends running Livestream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

fromMedia(media, startTime, startTimeStamp) → {queuedMedia}

- - - - - - -
- Creates a queuedMedia object from a media object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
media - - -media - - - - Media object to queue
startTime - - -Number - - - - Start time formatted as a JS Epoch
startTimeStamp - - -Number - - - - Start time stamp in seconds
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- queuedMedia object created from given media object -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

fromMediaArray(mediaList, start)

- - - - - - -
- Converts array of media objects into array of queuedMedia objects -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaList - - -Array - - - - Array of media objects to queue
start - - -Number - - - - Start time formatted as JS Epoch
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Array of converted queued media objects -
- - - - - - - - - - - - - - - -

genUUID()

- - - - - - -
- Generates new unique identifier for queued media -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) getActiveChan(socket) → {Object}

- - - - - - -
- Gets active channel from a given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Object containing users active channel name and channel document object -
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(async) getChannelPlaylists(socket, chanDB)

- - - - - - -
- Sends channel playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getConnectedChannels(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getConnections(user, cb)

- - - - - - -
- Iterates through connections by a given username, and runs them through a given callback function/method -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to crawl connections against
cb - - -function - - - - Callback function to run active connections of a given user against
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

getEndTime(fullTime)

- - - - - - -
- return the end time of a given queuedMedia object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
fullTime - - -boolean - - - - - - false - - Overrides early ends
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- end time of given queuedMedia object -
- - - - - - - - - - - - - - - -

getItemAtEpoch(epoch) → {queuedMedia}

- - - - - - -
- Gets a media item by epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found media item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemByUUID(uuid) → {queuedMedia}

- - - - - - -
- Get Scheduled Item by UUID -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- found item -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getItemsBetweenEpochs(start, end, noUnfinished) → {queuedMedia}

- - - - - - -
- Returns scheduled media between two given datetimes -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (Millis)
end - - -Number - - - - - - End date by JS Epoch (Millis)
noUnfinished - - -Boolean - - - - - - false - - Enable to include currently playing media
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Found Media Objects -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getLastItem(epoch)

- - - - - - -
- Gets last item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Last played item -
- - - - - - - - - - - - - - - -

getNextItem(epoch) → {queuedMedia}

- - - - - - -
- Gets next item from a given epoch -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
epoch - - -Number - - - - Date to check by JS Epoch (Millis), defaults to now
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Next item on the schedule -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

getSocketInfo(socket)

- - - - - - -
- Pulls user information by socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns related user info -
- - - - - - - - - - - - - - - -

getStart(start)

- - - - - - -
- Validates start times, and replaces bad ones with 5ms in the future -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
start - - -Number - - - - Start time to validate by JS Epoch (millis)
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Start time as JS Epoch (millis) -
- - - - - - - - - - - - - - - -

(async) getUserPlaylists(socket, userDB)

- - - - - - -
- Sends user playlist data to a requesting socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
userDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) goLive(socket, data)

- - - - - - -
- Handle client request to start an HLS live stream -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleChat(socket, data)

- - - - - - -
- Handles incoming chat messages from client connections -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections to the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(socket)

- - - - - - -
- Handles global server-side initialization for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleConnection(userDB, chanDB, socket)

- - - - - - -
- Handles server-side initialization for new connections from a specific user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket)

- - - - - - -
- Handles server-side initialization for disconnecting from the channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

handleDisconnect(socket, reason)

- - - - - - -
- Global server-side logic for handling disconncted sockets -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket to check
reason - - -String - - - - Reason for disconnection
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) handleRawRefresh(mediaObj) → {queuedMedia}

- - - - - - -
- Refreshes expired raw links before media plays -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- passes through Media object with updated link upon success -
- - - -
-
- Type -
-
- -queuedMedia - - -
-
- - - - - - - - - - - - - -

kickConnections(user, reason)

- - - - - - -
- Kicks a user from all channels by username -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user - - -String - - - - Username to kick from the server
reason - - -String - - - - Reason for kick
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamOverwriteSchedule(wasPlaying, chanDB)

- - - - - - -
- Overwrites livestream over scheduled media content after it has ended -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) livestreamPushbackSchedule(wasPlaying, chanDB)

- - - - - - -
- Pushes back any missed content scheduled during Livestream after Livestream has ended. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
wasPlaying - - -queuedMedia - - - - Media object that was playing while we started the Livestream
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) moveMedia(socket, data)

- - - - - - -
- Processes request to move queued media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) preSwitch(mediaObj)

- - - - - - -
- Called 10 seconds before media begins to play -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
mediaObj - - -queuedMedia - - - - Media object that's about to play
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) prepQueue(chanDB)

- - - - - - -
- Prepares channel queue for network transmission -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- de-hydrated scehdule information -
- - - - - - - - - - - - - - - -

(async) queueChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues an entire channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

queueFromChannelPlaylistValidator(socket, data) → {Number}

- - - - - - -
- Validates client requests to queue media from a playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns validated start time on success -
- - - -
-
- Type -
-
- -Number - - -
-
- - - - - - - - - - - - - -

(async) queueFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Queues random media from a given channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueRandomFromUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues random media from a given user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueURL(socket, data)

- - - - - - -
- Accepts new URL's to queue from the client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the URL from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) queueUserPlaylist(socket, data, userDB, chanDB)

- - - - - - -
- Queues an entire user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) refreshCommands()

- - - - - - -
- Reloads toke commands from DB into RAM-based toke command store -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

refreshNextTimer(volatile)

- - - - - - -
- Calculates next item to play, and sets timer to play it at it's scheduled start -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
volatile - - -Boolean - - - - - - false - - Disables DB Transactions if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rehydrateQueue(chanDB)

- - - - - - -
- Rehydrates media schedule from DB -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Pass through Channel Document to save on DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChannelAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to a given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChat(user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - - - Channel to broadcast message within
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayChatObject(chan, chat)

- - - - - - -
- Relays an existing chat object to a channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chan - - -String - - - - Channel to broadcast message within
chat - - -chat - - - - Chat Object representing the message to broadcast to the given channel
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChat(user, flair, highLevel, msg, type, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
user - - -String - - - - - - Originating user
flair - - -String - - - - - - Flair ID to mark chat with
highLevel - - -Number - - - - - - High Level to mark chat with
msg - - -String - - - - - - Message Text Content
type - - -String - - - - - - chat - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalChatObject(chat)

- - - - - - -
- Relays an existing chat object to the entire server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chat - - -chat - - - - Chat Object representing the message to broadcast throughout the server
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayGlobalTokeWhisper(msg, links)

- - - - - - -
- Broadcasts toke whisper to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChat(socket, user, flair, highLevel, msg, type, chan, links)

- - - - - - -
- Creates a new chatObject and relays the resulting message to the given socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending a message to (sounds menacing, huh?)
user - - -String - - - - Originating user
flair - - -String - - - - Flair ID to mark chat with
highLevel - - -Number - - - - High Level to mark chat with
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
chan - - -String - - - - Channel to broadcast message within
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayPrivateChatObject(socket, data)

- - - - - - -
- Handles incoming client request to delete a personal emote -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayServerAnnouncement(msg, links)

- - - - - - -
- Broadcasts announcement to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeCallout(msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayTokeWhisper(socket, msg, links)

- - - - - - -
- Broadcasts toke callout to the server -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're sending the whisper to
msg - - -String - - - - Message Text Content
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

relayUserChat(socket, msg, type, links)

- - - - - - -
- Relays a chat message from a user to the rest of the channel based on socket -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
msg - - -String - - - - Message Text Content
type - - -String - - - - Message Type, used for client-side chat post-processing.
links - - -Array - - - - Array of URLs/Links to hand to the client-side chat post-processor to inject into the final message.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) removeMedia(uuid, socket, chanDB, noScheduling) → {Media}

- - - - - - -
- Removes a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
uuid - - -String - - - - - - UUID of item to reschedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
noScheduling - - -Boolean - - - - - - false - - Disables schedule timer refresh if true
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- Deleted Media Item -
- - - -
-
- Type -
-
- -Media - - -
-
- - - - - - - - - - - - - -

(async) removeRange(start, end, socket, noUnfinished)

- - - - - - -
- Removes range of media items from the queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
start - - -Number - - - - - - Start date by JS Epoch (millis)
end - - -Number - - - - - - End date by JS Epoch (millis)
socket - - -Socket - - - - - - Requesting Socket
noUnfinished - - -Boolean - - - - - - false - - Set to true to include items that may be currently playing
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) renameChannelPlaylist(socket, data, chanDB)

- - - - - - -
- Renames a channel playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
chanDB - - -Mongoose.Document - - - - Channel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

renameChannelPlaylistValidator(socket, data) → {String}

- - - - - - -
- Validates client requests to rename the playlist validator -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Newly connected socket to define listeners against
data - - -Object - - - - Data handed over from the client
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns escaped/trimmed name upon success -
- - - -
-
- Type -
-
- -String - - -
-
- - - - - - - - - - - - - -

(async) renameUserPlaylist(socket, data, userDB)

- - - - - - -
- Renames a user playlist -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
data - - -Object - - - - Data handed over from the client
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) rescheduleMedia(uuid, start, socket, chanDB)

- - - - - - -
- Reschedules a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -String - - - - UUID of item to reschedule
start - - -Number - - - - New start time by JS Epoch (Millis)
socket - - -Socket - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

resetToke()

- - - - - - -
- Resets toke cooldowns early upon authorized request -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) scheduleMedia(media, socket, chanDB, force, volatile, startVolatile, saveLate, noSave)

- - - - - - -
- Schedules a Media Item - -This is a fun method and I think it deserves it's own little explination... -Since we're working with a time based schedule, using start epochs as keys for our iterable seemed the best option -I don't want to store everything in a sparse array because that *feels* icky, and would probably be a pain in the ass. -Maps seem like a good choice, if it wheren't for the issue of keeping them ordered... - -That's where this comes in. You see if we temporarily store it in a sparse array and convert into a map, -we can quickly and easily create a properly sorted schedule map that, out side of adding items, behaves normally. - -Also a note on preformance: -While .forEach ONLY runs through populated items in sparse arrays, many JS implementations run through them in the background, -simply skipping them before executing the provided function. Looping through object.keys(arr), however, avoids this entirely, -since it ONLY loops through defiened items within the array. No skipped empties for your runtime to worry about. -Even more preformance benefits can be had by using a real for loop on the arrays keys, skipping the overhead of forEach entirely. -This might seem gross but it completely avoids the computational workload of a sorting algo, especially when you consider -that, no matter what, re-ordering the schedule map would've required us to iterate through and rebuild the map anyways... - - -Also it looks like due to implementation limitations, epochs stored as MS are too large for array elements, so we store them there as seconds. -This also means that our current implementation will break exactly on unix epoch 4294967295 (Feb 7, 2106 6:28:15 AM UTC) -Hopefully javascript arrays will allow for larger lengths by then. If not blame the W3C :P - -If for some reason they haven't and we're not dead, we could probably implement an object that wraps a 2d array and set/gets it using modulo/devision/multiplication - -Further Reading: -https://stackoverflow.com/questions/59480871/foreach-vs-object-keys-foreach-performance-on-sparse-arrays -https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-think-twice-using-it -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
media - - -Media - - - - - - Media item to schedule
socket - - -Socket - - - - - - Requesting Socket
chanDB - - -Mongoose.Document - - - - - - Channnel Document Passthrough to save on DB Access
force - - -Boolean - - - - - - false - - Ignore certain conditions that would prevent scehduling and play the bitch anyways, used for internal function calls
volatile - - -Boolean - - - - - - false - - Prevent DB Writes, used for internal function calls
startVolatile - - -Boolean - - - - - - false - - Runs refreshNextTimer calls without DB writes, used for internal function calls
saveLate - - -Boolean - - - - - - false - - Saves items even if they're about to, or have already started. Used for internal function calls
noSave - - -Boolean - - - - - - false - - Allows function to edit Channel Document, but not save. Used for internal function calls in which the channel document is passed through, but will be saved immediatly after the scheduleMedia() call.
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendChanEmotes(chanDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendClientMetadata(userDB, chanDB)

- - - - - - -
- Sends glut of required initial metadata to the client upon a new connection -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
chanDB - - -Mongoose.Document - - - - Channnel Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendMedia(socket)

- - - - - - -
- Send media update to a specific socket or broadcast it to the entire channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendPersonalEmotes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendSiteEmotes()

- - - - - - -
- Send copy of site emotes to the user -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) sendUsedTokes(userDB)

- - - - - - -
- Send copy of channel emotes to the user -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
userDB - - -Mongoose.Document - - - - User Document Passthrough to save on DB Access
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setFlair(socket, data)

- - - - - - -
- Handles incoming client request to change flair -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) setHighLevel(socket, data)

- - - - - - -
- Handles incoming client request to change high level -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

socketCrawl(cb)

- - - - - - -
- Iterates through all known connections for a given user, running them through a supplied callback function -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
cb - - -function - - - - Callback to call against found sockets for a given user
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) start(mediaObj, timestamp, volatile)

- - - - - - -
- Kicks off a media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
mediaObj - - -queuedMedia - - - - - - Media object that's about to play
timestamp - - -Number - - - - - - Media start timestamp in seconds
volatile - - -Boolean - - - - - - false - - Disables DB Transactions
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

stop(socket)

- - - - - - -
- Stops currently playing media item -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- returns false if there is nothing to stop -
- - - - - - - - - - - - - - - -

(async) stopMedia(socket)

- - - - - - -
- Processes requests to stop currently playing media from client -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we received the request from
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) stopScheduleTimers(noArchive)

- - - - - - -
- Clears and scheduling timers -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefaultDescription
noArchive - - -Boolean - - - - - - true - - Disables Archiving
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sync()

- - - - - - -
- Sends a syncronization ping out to client Sockets and increments the tracked timestamp by the Synchronization Delta -Called auto-magically by the Synchronization Timer -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) toggleLock(socket)

- - - - - - -
- Handle client request to (un)lock queue -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

tokeProcessor(commandObj) → {Boolean}

- - - - - - -
- Processes toke commands from Command Pre-Processor -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request, passed down from the Command Pre-Processor
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat) -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

updateFlair(flair)

- - - - - - -
- Set flair for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flair - - -String - - - - Flair string to update user's flair to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

updateHighLevel(highLevel)

- - - - - - -
- Set high level for a given user and broadcast update to clients -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
highLevel - - -Number - - - - Number to update user's high-level to
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) validateSocket(socket) → {Boolean}

- - - - - - -
- Global server-side validation logic for new connections to any channel -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Requesting Socket
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- true on success -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/www/doc/activeChannel.html b/www/doc/server/activeChannel.html similarity index 99% rename from www/doc/activeChannel.html rename to www/doc/server/activeChannel.html index 51f3d07..e550d80 100644 --- a/www/doc/activeChannel.html +++ b/www/doc/server/activeChannel.html @@ -786,7 +786,7 @@
diff --git a/www/doc/app_channel_activeChannel.js.html b/www/doc/server/app_channel_activeChannel.js.html similarity index 99% rename from www/doc/app_channel_activeChannel.js.html rename to www/doc/server/app_channel_activeChannel.js.html index 18c6698..f351621 100644 --- a/www/doc/app_channel_activeChannel.js.html +++ b/www/doc/server/app_channel_activeChannel.js.html @@ -196,7 +196,7 @@ module.exports = activeChannel;
diff --git a/www/doc/app_channel_channelManager.js.html b/www/doc/server/app_channel_channelManager.js.html similarity index 99% rename from www/doc/app_channel_channelManager.js.html rename to www/doc/server/app_channel_channelManager.js.html index 7511d25..ac28645 100644 --- a/www/doc/app_channel_channelManager.js.html +++ b/www/doc/server/app_channel_channelManager.js.html @@ -347,7 +347,7 @@ module.exports = channelManager;
diff --git a/www/doc/app_channel_chat.js.html b/www/doc/server/app_channel_chat.js.html similarity index 99% rename from www/doc/app_channel_chat.js.html rename to www/doc/server/app_channel_chat.js.html index d70c35f..12a97a2 100644 --- a/www/doc/app_channel_chat.js.html +++ b/www/doc/server/app_channel_chat.js.html @@ -81,7 +81,7 @@ module.exports = chat;
diff --git a/www/doc/app_channel_chatBuffer.js.html b/www/doc/server/app_channel_chatBuffer.js.html similarity index 99% rename from www/doc/app_channel_chatBuffer.js.html rename to www/doc/server/app_channel_chatBuffer.js.html index 2f38cfa..039412f 100644 --- a/www/doc/app_channel_chatBuffer.js.html +++ b/www/doc/server/app_channel_chatBuffer.js.html @@ -178,7 +178,7 @@ module.exports = chatBuffer;
diff --git a/www/doc/app_channel_chatHandler.js.html b/www/doc/server/app_channel_chatHandler.js.html similarity index 99% rename from www/doc/app_channel_chatHandler.js.html rename to www/doc/server/app_channel_chatHandler.js.html index c660eb2..1fa9eaa 100644 --- a/www/doc/app_channel_chatHandler.js.html +++ b/www/doc/server/app_channel_chatHandler.js.html @@ -376,7 +376,7 @@ module.exports = chatHandler;
diff --git a/www/doc/app_channel_commandPreprocessor.js.html b/www/doc/server/app_channel_commandPreprocessor.js.html similarity index 99% rename from www/doc/app_channel_commandPreprocessor.js.html rename to www/doc/server/app_channel_commandPreprocessor.js.html index 173338b..554d104 100644 --- a/www/doc/app_channel_commandPreprocessor.js.html +++ b/www/doc/server/app_channel_commandPreprocessor.js.html @@ -473,7 +473,7 @@ module.exports = commandPreprocessor;
diff --git a/www/doc/app_channel_connectedUser.js.html b/www/doc/server/app_channel_connectedUser.js.html similarity index 99% rename from www/doc/app_channel_connectedUser.js.html rename to www/doc/server/app_channel_connectedUser.js.html index 56a2999..b37162c 100644 --- a/www/doc/app_channel_connectedUser.js.html +++ b/www/doc/server/app_channel_connectedUser.js.html @@ -334,7 +334,7 @@ module.exports = connectedUser;
diff --git a/www/doc/app_channel_media_media.js.html b/www/doc/server/app_channel_media_media.js.html similarity index 99% rename from www/doc/app_channel_media_media.js.html rename to www/doc/server/app_channel_media_media.js.html index 7ac6996..08fd81b 100644 --- a/www/doc/app_channel_media_media.js.html +++ b/www/doc/server/app_channel_media_media.js.html @@ -83,7 +83,7 @@ module.exports = media;
diff --git a/www/doc/app_channel_media_playlistHandler.js.html b/www/doc/server/app_channel_media_playlistHandler.js.html similarity index 99% rename from www/doc/app_channel_media_playlistHandler.js.html rename to www/doc/server/app_channel_media_playlistHandler.js.html index 12e23ab..0a01917 100644 --- a/www/doc/app_channel_media_playlistHandler.js.html +++ b/www/doc/server/app_channel_media_playlistHandler.js.html @@ -1180,7 +1180,7 @@ module.exports = playlistHandler;
diff --git a/www/doc/app_channel_media_queue.js.html b/www/doc/server/app_channel_media_queue.js.html similarity index 99% rename from www/doc/app_channel_media_queue.js.html rename to www/doc/server/app_channel_media_queue.js.html index d1c0f3c..eb6d75f 100644 --- a/www/doc/app_channel_media_queue.js.html +++ b/www/doc/server/app_channel_media_queue.js.html @@ -1795,7 +1795,7 @@ module.exports = queue;
diff --git a/www/doc/app_channel_media_queuedMedia.js.html b/www/doc/server/app_channel_media_queuedMedia.js.html similarity index 99% rename from www/doc/app_channel_media_queuedMedia.js.html rename to www/doc/server/app_channel_media_queuedMedia.js.html index 5593036..d8ba89f 100644 --- a/www/doc/app_channel_media_queuedMedia.js.html +++ b/www/doc/server/app_channel_media_queuedMedia.js.html @@ -165,7 +165,7 @@ module.exports = queuedMedia;
diff --git a/www/doc/app_channel_tokebot.js.html b/www/doc/server/app_channel_tokebot.js.html similarity index 98% rename from www/doc/app_channel_tokebot.js.html rename to www/doc/server/app_channel_tokebot.js.html index c301d8d..f272b14 100644 --- a/www/doc/app_channel_tokebot.js.html +++ b/www/doc/server/app_channel_tokebot.js.html @@ -58,14 +58,8 @@ class tokebot{ * @param {chatHandler} chatHandler - Parent Chat Handler Object */ constructor(server, chatHandler){ - /** - * Parent channelManager object - */ + //Set parents this.server = server; - - /** - * Parent chatHandler object - */ this.chatHandler = chatHandler; //Set timeouts to null @@ -279,7 +273,7 @@ module.exports = tokebot;
diff --git a/www/doc/channelManager.html b/www/doc/server/channelManager.html similarity index 99% rename from www/doc/channelManager.html rename to www/doc/server/channelManager.html index 361136a..5cc831d 100644 --- a/www/doc/channelManager.html +++ b/www/doc/server/channelManager.html @@ -1991,7 +1991,7 @@
diff --git a/www/doc/chat.html b/www/doc/server/chat.html similarity index 99% rename from www/doc/chat.html rename to www/doc/server/chat.html index cff85f0..1103ae6 100644 --- a/www/doc/chat.html +++ b/www/doc/server/chat.html @@ -329,7 +329,7 @@
diff --git a/www/doc/chatBuffer.html b/www/doc/server/chatBuffer.html similarity index 99% rename from www/doc/chatBuffer.html rename to www/doc/server/chatBuffer.html index 925cfd4..b33a017 100644 --- a/www/doc/chatBuffer.html +++ b/www/doc/server/chatBuffer.html @@ -829,7 +829,7 @@ Left here since it seems like good form anywho, since this would be a private, o
diff --git a/www/doc/chatHandler.html b/www/doc/server/chatHandler.html similarity index 99% rename from www/doc/chatHandler.html rename to www/doc/server/chatHandler.html index d8ebdf7..534792b 100644 --- a/www/doc/chatHandler.html +++ b/www/doc/server/chatHandler.html @@ -3686,7 +3686,7 @@
diff --git a/www/doc/commandPreprocessor.html b/www/doc/server/commandPreprocessor.html similarity index 99% rename from www/doc/commandPreprocessor.html rename to www/doc/server/commandPreprocessor.html index dc93df3..999c40f 100644 --- a/www/doc/commandPreprocessor.html +++ b/www/doc/server/commandPreprocessor.html @@ -1246,7 +1246,7 @@ These arrays are used to handle further command/chat processing
diff --git a/www/doc/commandProcessor.html b/www/doc/server/commandProcessor.html similarity index 99% rename from www/doc/commandProcessor.html rename to www/doc/server/commandProcessor.html index c983344..562c247 100644 --- a/www/doc/commandProcessor.html +++ b/www/doc/server/commandProcessor.html @@ -1831,7 +1831,7 @@
diff --git a/www/doc/connectedUser.html b/www/doc/server/connectedUser.html similarity index 99% rename from www/doc/connectedUser.html rename to www/doc/server/connectedUser.html index 75681f1..8e2281c 100644 --- a/www/doc/connectedUser.html +++ b/www/doc/server/connectedUser.html @@ -1879,7 +1879,7 @@ Having to crawl through these sockets is that. Because the other ways seem more
diff --git a/www/doc/fonts/OpenSans-Bold-webfont.eot b/www/doc/server/fonts/OpenSans-Bold-webfont.eot similarity index 100% rename from www/doc/fonts/OpenSans-Bold-webfont.eot rename to www/doc/server/fonts/OpenSans-Bold-webfont.eot diff --git a/www/doc/fonts/OpenSans-Bold-webfont.svg b/www/doc/server/fonts/OpenSans-Bold-webfont.svg similarity index 100% rename from www/doc/fonts/OpenSans-Bold-webfont.svg rename to www/doc/server/fonts/OpenSans-Bold-webfont.svg diff --git a/www/doc/fonts/OpenSans-Bold-webfont.woff b/www/doc/server/fonts/OpenSans-Bold-webfont.woff similarity index 100% rename from www/doc/fonts/OpenSans-Bold-webfont.woff rename to www/doc/server/fonts/OpenSans-Bold-webfont.woff diff --git a/www/doc/fonts/OpenSans-BoldItalic-webfont.eot b/www/doc/server/fonts/OpenSans-BoldItalic-webfont.eot similarity index 100% rename from www/doc/fonts/OpenSans-BoldItalic-webfont.eot rename to www/doc/server/fonts/OpenSans-BoldItalic-webfont.eot diff --git a/www/doc/fonts/OpenSans-BoldItalic-webfont.svg b/www/doc/server/fonts/OpenSans-BoldItalic-webfont.svg similarity index 100% rename from www/doc/fonts/OpenSans-BoldItalic-webfont.svg rename to www/doc/server/fonts/OpenSans-BoldItalic-webfont.svg diff --git a/www/doc/fonts/OpenSans-BoldItalic-webfont.woff b/www/doc/server/fonts/OpenSans-BoldItalic-webfont.woff similarity index 100% rename from www/doc/fonts/OpenSans-BoldItalic-webfont.woff rename to www/doc/server/fonts/OpenSans-BoldItalic-webfont.woff diff --git a/www/doc/fonts/OpenSans-Italic-webfont.eot b/www/doc/server/fonts/OpenSans-Italic-webfont.eot similarity index 100% rename from www/doc/fonts/OpenSans-Italic-webfont.eot rename to www/doc/server/fonts/OpenSans-Italic-webfont.eot diff --git a/www/doc/fonts/OpenSans-Italic-webfont.svg b/www/doc/server/fonts/OpenSans-Italic-webfont.svg similarity index 100% rename from www/doc/fonts/OpenSans-Italic-webfont.svg rename to www/doc/server/fonts/OpenSans-Italic-webfont.svg diff --git a/www/doc/fonts/OpenSans-Italic-webfont.woff b/www/doc/server/fonts/OpenSans-Italic-webfont.woff similarity index 100% rename from www/doc/fonts/OpenSans-Italic-webfont.woff rename to www/doc/server/fonts/OpenSans-Italic-webfont.woff diff --git a/www/doc/fonts/OpenSans-Light-webfont.eot b/www/doc/server/fonts/OpenSans-Light-webfont.eot similarity index 100% rename from www/doc/fonts/OpenSans-Light-webfont.eot rename to www/doc/server/fonts/OpenSans-Light-webfont.eot diff --git a/www/doc/fonts/OpenSans-Light-webfont.svg b/www/doc/server/fonts/OpenSans-Light-webfont.svg similarity index 100% rename from www/doc/fonts/OpenSans-Light-webfont.svg rename to www/doc/server/fonts/OpenSans-Light-webfont.svg diff --git a/www/doc/fonts/OpenSans-Light-webfont.woff b/www/doc/server/fonts/OpenSans-Light-webfont.woff similarity index 100% rename from www/doc/fonts/OpenSans-Light-webfont.woff rename to www/doc/server/fonts/OpenSans-Light-webfont.woff diff --git a/www/doc/fonts/OpenSans-LightItalic-webfont.eot b/www/doc/server/fonts/OpenSans-LightItalic-webfont.eot similarity index 100% rename from www/doc/fonts/OpenSans-LightItalic-webfont.eot rename to www/doc/server/fonts/OpenSans-LightItalic-webfont.eot diff --git a/www/doc/fonts/OpenSans-LightItalic-webfont.svg b/www/doc/server/fonts/OpenSans-LightItalic-webfont.svg similarity index 100% rename from www/doc/fonts/OpenSans-LightItalic-webfont.svg rename to www/doc/server/fonts/OpenSans-LightItalic-webfont.svg diff --git a/www/doc/fonts/OpenSans-LightItalic-webfont.woff b/www/doc/server/fonts/OpenSans-LightItalic-webfont.woff similarity index 100% rename from www/doc/fonts/OpenSans-LightItalic-webfont.woff rename to www/doc/server/fonts/OpenSans-LightItalic-webfont.woff diff --git a/www/doc/fonts/OpenSans-Regular-webfont.eot b/www/doc/server/fonts/OpenSans-Regular-webfont.eot similarity index 100% rename from www/doc/fonts/OpenSans-Regular-webfont.eot rename to www/doc/server/fonts/OpenSans-Regular-webfont.eot diff --git a/www/doc/fonts/OpenSans-Regular-webfont.svg b/www/doc/server/fonts/OpenSans-Regular-webfont.svg similarity index 100% rename from www/doc/fonts/OpenSans-Regular-webfont.svg rename to www/doc/server/fonts/OpenSans-Regular-webfont.svg diff --git a/www/doc/fonts/OpenSans-Regular-webfont.woff b/www/doc/server/fonts/OpenSans-Regular-webfont.woff similarity index 100% rename from www/doc/fonts/OpenSans-Regular-webfont.woff rename to www/doc/server/fonts/OpenSans-Regular-webfont.woff diff --git a/www/doc/global.html b/www/doc/server/global.html similarity index 99% rename from www/doc/global.html rename to www/doc/server/global.html index fcb66b1..a6340bb 100644 --- a/www/doc/global.html +++ b/www/doc/server/global.html @@ -7377,7 +7377,7 @@ Warns server admin against unsafe config options.
diff --git a/www/doc/index.html b/www/doc/server/index.html similarity index 67% rename from www/doc/index.html rename to www/doc/server/index.html index fdf486a..5d31476 100644 --- a/www/doc/index.html +++ b/www/doc/server/index.html @@ -42,6 +42,37 @@ +
+

Canopy - 0.3-INDEV

+

Canopy - /ˈkæ.nə.pi/:

+
    +
  • The upper layer of foliage and branches of a forest, containing the majority of animal life.
  • +
+

Canopy is a community chat & synced video embedding web application, intended to replace fore.st as the server software for ourfore.st. +This new codebase intends to solve the following issues with the current CyTube based software:

+
    +
  • Unmaintained upstream codebase.
  • +
  • Different goals.
  • +
  • Different coding styles.
  • +
  • Obsolete Technology and Dependencies.
  • +
  • General Clunk
  • +
  • Less Unique Community Identity
  • +
+

Canopy intends to be a simple node/express.js app. It leverages yt-dlp and the internet archive REST api for metadata gathering. Persistant storage is handled by mongodb, as it's document based nature inherintly works well for cleanly storing large config documents for user/channel settings, and the low use of inter-collection references within the canopy software. All hardcore security functions like server-side input sanatization, session handling, CSRF mitigation, and password hashing are handled by industry-standard open source libraries such as validator/express-validator, express-sessions, csrf-sync, and bcrypt, however it IS hobbiest software, and it should be treated as such.

+

The Canopy codebase does not, nor will it ever contain:

+
    +
  • Advertisements (targetted or otherwise)
  • +
  • Proprietary Code
  • +
  • Cryptocurrency/Blockchain integration
  • +
  • 'Analytics/Telemtry' spyware
  • +
  • The use of video sources which require proprietary 'Digital Rights Management Ristricitons Malware' such as Widevine.
  • +
+

Thirdparty media providers may or may not contain all of the above atrocities :P (though browser-side DRM extensions will never be required), always use an ad-blocker!

+

Our current goal is to create a cleaner, more modern, purpose-built codebase that has feature-parity with the current version of fore.st, while writing improvements where possible. Once this is accomplished, and ourfore.st has been migrated, work will continue to re-create features from TTN, while also building completely new ones as well.

+

License

+

Canopy is written by the community, and provided under the GNU Affero General Public License v3 in order to prevent Canopy from being used in proprietary software or shitcoin scams.

+
+ @@ -56,7 +87,7 @@
diff --git a/www/doc/media.html b/www/doc/server/media.html similarity index 99% rename from www/doc/media.html rename to www/doc/server/media.html index 9abb2cd..e0a1b6d 100644 --- a/www/doc/media.html +++ b/www/doc/server/media.html @@ -352,7 +352,7 @@
diff --git a/www/doc/playlistHandler.html b/www/doc/server/playlistHandler.html similarity index 99% rename from www/doc/playlistHandler.html rename to www/doc/server/playlistHandler.html index 971f6c8..3efb58f 100644 --- a/www/doc/playlistHandler.html +++ b/www/doc/server/playlistHandler.html @@ -5108,7 +5108,7 @@
diff --git a/www/doc/queue.html b/www/doc/server/queue.html similarity index 99% rename from www/doc/queue.html rename to www/doc/server/queue.html index a61f0f1..5166e19 100644 --- a/www/doc/queue.html +++ b/www/doc/server/queue.html @@ -5805,7 +5805,7 @@ Called auto-magically by the Synchronization Timer
diff --git a/www/doc/queuedMedia.html b/www/doc/server/queuedMedia.html similarity index 99% rename from www/doc/queuedMedia.html rename to www/doc/server/queuedMedia.html index d57db67..fc2445c 100644 --- a/www/doc/queuedMedia.html +++ b/www/doc/server/queuedMedia.html @@ -936,7 +936,7 @@
diff --git a/www/doc/schemas_channel_channelBanSchema.js.html b/www/doc/server/schemas_channel_channelBanSchema.js.html similarity index 99% rename from www/doc/schemas_channel_channelBanSchema.js.html rename to www/doc/server/schemas_channel_channelBanSchema.js.html index a676c99..52c503d 100644 --- a/www/doc/schemas_channel_channelBanSchema.js.html +++ b/www/doc/server/schemas_channel_channelBanSchema.js.html @@ -101,7 +101,7 @@ module.exports = channelBanSchema;
diff --git a/www/doc/schemas_channel_channelPermissionSchema.js.html b/www/doc/server/schemas_channel_channelPermissionSchema.js.html similarity index 99% rename from www/doc/schemas_channel_channelPermissionSchema.js.html rename to www/doc/server/schemas_channel_channelPermissionSchema.js.html index d563aa5..4beb50c 100644 --- a/www/doc/schemas_channel_channelPermissionSchema.js.html +++ b/www/doc/server/schemas_channel_channelPermissionSchema.js.html @@ -169,7 +169,7 @@ module.exports = channelPermissionSchema;
diff --git a/www/doc/schemas_channel_channelSchema.js.html b/www/doc/server/schemas_channel_channelSchema.js.html similarity index 99% rename from www/doc/schemas_channel_channelSchema.js.html rename to www/doc/server/schemas_channel_channelSchema.js.html index fb7b92f..7e669b8 100644 --- a/www/doc/schemas_channel_channelSchema.js.html +++ b/www/doc/server/schemas_channel_channelSchema.js.html @@ -934,7 +934,7 @@ module.exports = mongoose.model("channel", channelSchema);
diff --git a/www/doc/schemas_channel_chatSchema.js.html b/www/doc/server/schemas_channel_chatSchema.js.html similarity index 99% rename from www/doc/schemas_channel_chatSchema.js.html rename to www/doc/server/schemas_channel_chatSchema.js.html index 33d4e2d..7fc66fc 100644 --- a/www/doc/schemas_channel_chatSchema.js.html +++ b/www/doc/server/schemas_channel_chatSchema.js.html @@ -96,7 +96,7 @@ module.exports = chatSchema;
diff --git a/www/doc/schemas_channel_media_mediaSchema.js.html b/www/doc/server/schemas_channel_media_mediaSchema.js.html similarity index 99% rename from www/doc/schemas_channel_media_mediaSchema.js.html rename to www/doc/server/schemas_channel_media_mediaSchema.js.html index 7db4172..5cf4ba9 100644 --- a/www/doc/schemas_channel_media_mediaSchema.js.html +++ b/www/doc/server/schemas_channel_media_mediaSchema.js.html @@ -96,7 +96,7 @@ module.exports = mediaSchema;
diff --git a/www/doc/schemas_channel_media_playlistMediaSchema.js.html b/www/doc/server/schemas_channel_media_playlistMediaSchema.js.html similarity index 99% rename from www/doc/schemas_channel_media_playlistMediaSchema.js.html rename to www/doc/server/schemas_channel_media_playlistMediaSchema.js.html index 8523ae3..c2e909d 100644 --- a/www/doc/schemas_channel_media_playlistMediaSchema.js.html +++ b/www/doc/server/schemas_channel_media_playlistMediaSchema.js.html @@ -124,7 +124,7 @@ module.exports = mediaSchema.discriminator('saved', playlistMediaProperties); diff --git a/www/doc/schemas_channel_media_playlistSchema.js.html b/www/doc/server/schemas_channel_media_playlistSchema.js.html similarity index 99% rename from www/doc/schemas_channel_media_playlistSchema.js.html rename to www/doc/server/schemas_channel_media_playlistSchema.js.html index 601a46c..5d9cc3b 100644 --- a/www/doc/schemas_channel_media_playlistSchema.js.html +++ b/www/doc/server/schemas_channel_media_playlistSchema.js.html @@ -174,7 +174,7 @@ module.exports = playlistSchema;
diff --git a/www/doc/schemas_channel_media_queuedMediaSchema.js.html b/www/doc/server/schemas_channel_media_queuedMediaSchema.js.html similarity index 99% rename from www/doc/schemas_channel_media_queuedMediaSchema.js.html rename to www/doc/server/schemas_channel_media_queuedMediaSchema.js.html index a384c5e..bd2431c 100644 --- a/www/doc/schemas_channel_media_queuedMediaSchema.js.html +++ b/www/doc/server/schemas_channel_media_queuedMediaSchema.js.html @@ -113,7 +113,7 @@ module.exports = mediaSchema.discriminator('queued', queuedProperties); diff --git a/www/doc/schemas_emoteSchema.js.html b/www/doc/server/schemas_emoteSchema.js.html similarity index 99% rename from www/doc/schemas_emoteSchema.js.html rename to www/doc/server/schemas_emoteSchema.js.html index aa89855..258c270 100644 --- a/www/doc/schemas_emoteSchema.js.html +++ b/www/doc/server/schemas_emoteSchema.js.html @@ -164,7 +164,7 @@ module.exports = mongoose.model("emote", emoteSchema);
diff --git a/www/doc/schemas_flairSchema.js.html b/www/doc/server/schemas_flairSchema.js.html similarity index 99% rename from www/doc/schemas_flairSchema.js.html rename to www/doc/server/schemas_flairSchema.js.html index 8443064..3329d2a 100644 --- a/www/doc/schemas_flairSchema.js.html +++ b/www/doc/server/schemas_flairSchema.js.html @@ -118,7 +118,7 @@ module.exports = mongoose.model("flair", flairSchema);
diff --git a/www/doc/schemas_permissionSchema.js.html b/www/doc/server/schemas_permissionSchema.js.html similarity index 99% rename from www/doc/schemas_permissionSchema.js.html rename to www/doc/server/schemas_permissionSchema.js.html index 5dfd02a..3659f64 100644 --- a/www/doc/schemas_permissionSchema.js.html +++ b/www/doc/server/schemas_permissionSchema.js.html @@ -356,7 +356,7 @@ module.exports = mongoose.model("permissions", permissionSchema);
diff --git a/www/doc/schemas_statSchema.js.html b/www/doc/server/schemas_statSchema.js.html similarity index 99% rename from www/doc/schemas_statSchema.js.html rename to www/doc/server/schemas_statSchema.js.html index 1d420a8..3f276ed 100644 --- a/www/doc/schemas_statSchema.js.html +++ b/www/doc/server/schemas_statSchema.js.html @@ -240,7 +240,7 @@ module.exports = mongoose.model("statistics", statSchema);
diff --git a/www/doc/schemas_tokebot_tokeCommandSchema.js.html b/www/doc/server/schemas_tokebot_tokeCommandSchema.js.html similarity index 99% rename from www/doc/schemas_tokebot_tokeCommandSchema.js.html rename to www/doc/server/schemas_tokebot_tokeCommandSchema.js.html index edfb17c..59a8416 100644 --- a/www/doc/schemas_tokebot_tokeCommandSchema.js.html +++ b/www/doc/server/schemas_tokebot_tokeCommandSchema.js.html @@ -160,7 +160,7 @@ module.exports = mongoose.model("tokeCommand", tokeCommandSchema);
diff --git a/www/doc/schemas_user_emailChangeSchema.js.html b/www/doc/server/schemas_user_emailChangeSchema.js.html similarity index 99% rename from www/doc/schemas_user_emailChangeSchema.js.html rename to www/doc/server/schemas_user_emailChangeSchema.js.html index edb5d51..a4da1f1 100644 --- a/www/doc/schemas_user_emailChangeSchema.js.html +++ b/www/doc/server/schemas_user_emailChangeSchema.js.html @@ -222,7 +222,7 @@ module.exports = mongoose.model("emailChange", emailChangeSchema);
diff --git a/www/doc/schemas_user_passwordResetSchema.js.html b/www/doc/server/schemas_user_passwordResetSchema.js.html similarity index 99% rename from www/doc/schemas_user_passwordResetSchema.js.html rename to www/doc/server/schemas_user_passwordResetSchema.js.html index 03a6c5d..16d75cc 100644 --- a/www/doc/schemas_user_passwordResetSchema.js.html +++ b/www/doc/server/schemas_user_passwordResetSchema.js.html @@ -198,7 +198,7 @@ module.exports = mongoose.model("passwordReset", passwordResetSchema);
diff --git a/www/doc/schemas_user_userBanSchema.js.html b/www/doc/server/schemas_user_userBanSchema.js.html similarity index 99% rename from www/doc/schemas_user_userBanSchema.js.html rename to www/doc/server/schemas_user_userBanSchema.js.html index 3d4ae40..c33bec5 100644 --- a/www/doc/schemas_user_userBanSchema.js.html +++ b/www/doc/server/schemas_user_userBanSchema.js.html @@ -521,7 +521,7 @@ module.exports = mongoose.model("userBan", userBanSchema);
diff --git a/www/doc/schemas_user_userSchema.js.html b/www/doc/server/schemas_user_userSchema.js.html similarity index 99% rename from www/doc/schemas_user_userSchema.js.html rename to www/doc/server/schemas_user_userSchema.js.html index 08d08b8..5b3dce6 100644 --- a/www/doc/schemas_user_userSchema.js.html +++ b/www/doc/server/schemas_user_userSchema.js.html @@ -888,7 +888,7 @@ module.exports.userModel = mongoose.model("user", userSchema);
diff --git a/www/doc/scripts/linenumber.js b/www/doc/server/scripts/linenumber.js similarity index 100% rename from www/doc/scripts/linenumber.js rename to www/doc/server/scripts/linenumber.js diff --git a/www/doc/scripts/prettify/Apache-License-2.0.txt b/www/doc/server/scripts/prettify/Apache-License-2.0.txt similarity index 100% rename from www/doc/scripts/prettify/Apache-License-2.0.txt rename to www/doc/server/scripts/prettify/Apache-License-2.0.txt diff --git a/www/doc/scripts/prettify/lang-css.js b/www/doc/server/scripts/prettify/lang-css.js similarity index 100% rename from www/doc/scripts/prettify/lang-css.js rename to www/doc/server/scripts/prettify/lang-css.js diff --git a/www/doc/scripts/prettify/prettify.js b/www/doc/server/scripts/prettify/prettify.js similarity index 100% rename from www/doc/scripts/prettify/prettify.js rename to www/doc/server/scripts/prettify/prettify.js diff --git a/www/doc/styles/jsdoc-default.css b/www/doc/server/styles/jsdoc-default.css similarity index 100% rename from www/doc/styles/jsdoc-default.css rename to www/doc/server/styles/jsdoc-default.css diff --git a/www/doc/styles/prettify-jsdoc.css b/www/doc/server/styles/prettify-jsdoc.css similarity index 100% rename from www/doc/styles/prettify-jsdoc.css rename to www/doc/server/styles/prettify-jsdoc.css diff --git a/www/doc/styles/prettify-tomorrow.css b/www/doc/server/styles/prettify-tomorrow.css similarity index 100% rename from www/doc/styles/prettify-tomorrow.css rename to www/doc/server/styles/prettify-tomorrow.css diff --git a/www/doc/tokebot.html b/www/doc/server/tokebot.html similarity index 88% rename from www/doc/tokebot.html rename to www/doc/server/tokebot.html index 3df574f..f6696dc 100644 --- a/www/doc/tokebot.html +++ b/www/doc/server/tokebot.html @@ -215,134 +215,6 @@ -

Members

- - - -

chatHandler

- - - - -
- Parent chatHandler object -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

server

- - - - -
- Parent channelManager object -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - -

Methods

@@ -406,7 +278,7 @@ I would now, but I don't want to break shit in a comment-only commit.
Source:
@@ -494,7 +366,7 @@ I would now, but I don't want to break shit in a comment-only commit.
Source:
@@ -582,7 +454,7 @@ I would now, but I don't want to break shit in a comment-only commit.
Source:
@@ -670,7 +542,7 @@ I would now, but I don't want to break shit in a comment-only commit.
Source:
@@ -758,7 +630,7 @@ I would now, but I don't want to break shit in a comment-only commit.
Source:
@@ -895,7 +767,7 @@ I would now, but I don't want to break shit in a comment-only commit.
Source:
@@ -969,7 +841,7 @@ I would now, but I don't want to break shit in a comment-only commit.
diff --git a/www/doc/utils_altchaUtils.js.html b/www/doc/server/utils_altchaUtils.js.html similarity index 99% rename from www/doc/utils_altchaUtils.js.html rename to www/doc/server/utils_altchaUtils.js.html index 90b44bc..3ce1fb9 100644 --- a/www/doc/utils_altchaUtils.js.html +++ b/www/doc/server/utils_altchaUtils.js.html @@ -118,7 +118,7 @@ module.exports.verify = async function(payload, uniqueSecret = ''){
diff --git a/www/doc/utils_configCheck.js.html b/www/doc/server/utils_configCheck.js.html similarity index 99% rename from www/doc/utils_configCheck.js.html rename to www/doc/server/utils_configCheck.js.html index 81cc912..0eb55a1 100644 --- a/www/doc/utils_configCheck.js.html +++ b/www/doc/server/utils_configCheck.js.html @@ -108,7 +108,7 @@ module.exports.securityCheck = function(){
diff --git a/www/doc/utils_hashUtils.js.html b/www/doc/server/utils_hashUtils.js.html similarity index 99% rename from www/doc/utils_hashUtils.js.html rename to www/doc/server/utils_hashUtils.js.html index cc2e43e..18c927e 100644 --- a/www/doc/utils_hashUtils.js.html +++ b/www/doc/server/utils_hashUtils.js.html @@ -103,7 +103,7 @@ module.exports.hashIP = function(ip){
diff --git a/www/doc/utils_linkUtils.js.html b/www/doc/server/utils_linkUtils.js.html similarity index 99% rename from www/doc/utils_linkUtils.js.html rename to www/doc/server/utils_linkUtils.js.html index d1c98ac..3eeb13f 100644 --- a/www/doc/utils_linkUtils.js.html +++ b/www/doc/server/utils_linkUtils.js.html @@ -146,7 +146,7 @@ module.exports.markLink = async function(link){
diff --git a/www/doc/utils_loggerUtils.js.html b/www/doc/server/utils_loggerUtils.js.html similarity index 99% rename from www/doc/utils_loggerUtils.js.html rename to www/doc/server/utils_loggerUtils.js.html index 3b30489..233351f 100644 --- a/www/doc/utils_loggerUtils.js.html +++ b/www/doc/server/utils_loggerUtils.js.html @@ -207,7 +207,7 @@ module.exports.errorMiddleware = function(err, req, res, next){
diff --git a/www/doc/utils_mailUtils.js.html b/www/doc/server/utils_mailUtils.js.html similarity index 99% rename from www/doc/utils_mailUtils.js.html rename to www/doc/server/utils_mailUtils.js.html index 3310c7d..e5abb54 100644 --- a/www/doc/utils_mailUtils.js.html +++ b/www/doc/server/utils_mailUtils.js.html @@ -140,7 +140,7 @@ module.exports.sendAddressVerification = async function(requestDB, userDB, newEm
diff --git a/www/doc/utils_media_internetArchiveUtils.js.html b/www/doc/server/utils_media_internetArchiveUtils.js.html similarity index 99% rename from www/doc/utils_media_internetArchiveUtils.js.html rename to www/doc/server/utils_media_internetArchiveUtils.js.html index 6e8c8ff..5c28a5d 100644 --- a/www/doc/utils_media_internetArchiveUtils.js.html +++ b/www/doc/server/utils_media_internetArchiveUtils.js.html @@ -154,7 +154,7 @@ module.exports.fetchMetadata = async function(fullID, title){
diff --git a/www/doc/utils_media_yanker.js.html b/www/doc/server/utils_media_yanker.js.html similarity index 99% rename from www/doc/utils_media_yanker.js.html rename to www/doc/server/utils_media_yanker.js.html index 825203f..e34f4c7 100644 --- a/www/doc/utils_media_yanker.js.html +++ b/www/doc/server/utils_media_yanker.js.html @@ -193,7 +193,7 @@ module.exports.getMediaType = async function(url){
diff --git a/www/doc/utils_media_ytdlpUtils.js.html b/www/doc/server/utils_media_ytdlpUtils.js.html similarity index 99% rename from www/doc/utils_media_ytdlpUtils.js.html rename to www/doc/server/utils_media_ytdlpUtils.js.html index 9814973..17bb3d2 100644 --- a/www/doc/utils_media_ytdlpUtils.js.html +++ b/www/doc/server/utils_media_ytdlpUtils.js.html @@ -186,7 +186,7 @@ async function ytdlpFetch(link, format = 'b'){
diff --git a/www/doc/utils_regexUtils.js.html b/www/doc/server/utils_regexUtils.js.html similarity index 99% rename from www/doc/utils_regexUtils.js.html rename to www/doc/server/utils_regexUtils.js.html index 505d037..a3db8ae 100644 --- a/www/doc/utils_regexUtils.js.html +++ b/www/doc/server/utils_regexUtils.js.html @@ -69,7 +69,7 @@ module.exports.escapeRegex = function(string){
diff --git a/www/doc/utils_scheduler.js.html b/www/doc/server/utils_scheduler.js.html similarity index 99% rename from www/doc/utils_scheduler.js.html rename to www/doc/server/utils_scheduler.js.html index 90c8742..7161597 100644 --- a/www/doc/utils_scheduler.js.html +++ b/www/doc/server/utils_scheduler.js.html @@ -105,7 +105,7 @@ module.exports.kickoff = function(){
diff --git a/www/doc/utils_sessionUtils.js.html b/www/doc/server/utils_sessionUtils.js.html similarity index 99% rename from www/doc/utils_sessionUtils.js.html rename to www/doc/server/utils_sessionUtils.js.html index 55a03eb..05c32c5 100644 --- a/www/doc/utils_sessionUtils.js.html +++ b/www/doc/server/utils_sessionUtils.js.html @@ -236,7 +236,7 @@ module.exports.maxAttempts = maxAttempts;