From 514b00a714fe0bbf7d611bb866c562df77523402 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Tue, 2 Sep 2025 07:32:51 -0400 Subject: [PATCH] Properly marked exported classes to fix JSDoc --- src/app/channel/activeChannel.js | 6 +- src/app/channel/channelManager.js | 6 +- src/app/channel/chatHandler.js | 6 +- src/app/channel/commandPreprocessor.js | 6 +- src/app/channel/connectedUser.js | 6 +- src/app/channel/media/media.js | 6 +- src/app/channel/media/playlistHandler.js | 6 +- src/app/channel/media/queue.js | 6 +- src/app/channel/media/queuedMedia.js | 6 +- src/app/channel/tokebot.js | 4 +- www/doc/activeChannel.html | 795 + www/doc/app_channel_activeChannel.js.html | 10 +- www/doc/app_channel_channelManager.js.html | 10 +- www/doc/app_channel_chat.js.html | 4 +- www/doc/app_channel_chatBuffer.js.html | 4 +- www/doc/app_channel_chatHandler.js.html | 10 +- .../app_channel_commandPreprocessor.js.html | 10 +- www/doc/app_channel_connectedUser.js.html | 10 +- www/doc/app_channel_media_media.js.html | 10 +- .../app_channel_media_playlistHandler.js.html | 10 +- www/doc/app_channel_media_queue.js.html | 10 +- www/doc/app_channel_media_queuedMedia.js.html | 10 +- www/doc/app_channel_tokebot.js.html | 17 +- www/doc/channelManager.html | 2000 ++ www/doc/chat.html | 6 +- www/doc/chatBuffer.html | 8 +- www/doc/chatHandler.html | 3695 ++ www/doc/commandPreprocessor.html | 1255 + www/doc/commandProcessor.html | 8 +- www/doc/connectedUser.html | 1888 + www/doc/global.html | 4 +- www/doc/index.html | 4 +- www/doc/media.html | 361 + www/doc/module.exports.html | 29269 +--------------- www/doc/playlistHandler.html | 5117 +++ www/doc/queue.html | 5814 +++ www/doc/queuedMedia.html | 945 + .../schemas_channel_channelBanSchema.js.html | 4 +- ...as_channel_channelPermissionSchema.js.html | 4 +- www/doc/schemas_channel_channelSchema.js.html | 4 +- www/doc/schemas_channel_chatSchema.js.html | 4 +- .../schemas_channel_media_mediaSchema.js.html | 4 +- ..._channel_media_playlistMediaSchema.js.html | 4 +- ...hemas_channel_media_playlistSchema.js.html | 4 +- ...as_channel_media_queuedMediaSchema.js.html | 4 +- www/doc/schemas_emoteSchema.js.html | 4 +- www/doc/schemas_flairSchema.js.html | 4 +- www/doc/schemas_permissionSchema.js.html | 4 +- www/doc/schemas_statSchema.js.html | 4 +- .../schemas_tokebot_tokeCommandSchema.js.html | 4 +- .../schemas_user_emailChangeSchema.js.html | 4 +- .../schemas_user_passwordResetSchema.js.html | 4 +- www/doc/schemas_user_userBanSchema.js.html | 4 +- www/doc/schemas_user_userSchema.js.html | 4 +- www/doc/tokebot.html | 978 + www/doc/utils_altchaUtils.js.html | 4 +- www/doc/utils_configCheck.js.html | 4 +- www/doc/utils_hashUtils.js.html | 4 +- www/doc/utils_linkUtils.js.html | 4 +- www/doc/utils_loggerUtils.js.html | 4 +- www/doc/utils_mailUtils.js.html | 4 +- .../utils_media_internetArchiveUtils.js.html | 4 +- www/doc/utils_media_yanker.js.html | 4 +- www/doc/utils_media_ytdlpUtils.js.html | 4 +- www/doc/utils_regexUtils.js.html | 4 +- www/doc/utils_scheduler.js.html | 4 +- www/doc/utils_sessionUtils.js.html | 4 +- 67 files changed, 23032 insertions(+), 29404 deletions(-) create mode 100644 www/doc/activeChannel.html create mode 100644 www/doc/channelManager.html create mode 100644 www/doc/chatHandler.html create mode 100644 www/doc/commandPreprocessor.html create mode 100644 www/doc/connectedUser.html create mode 100644 www/doc/media.html create mode 100644 www/doc/playlistHandler.html create mode 100644 www/doc/queue.html create mode 100644 www/doc/queuedMedia.html create mode 100644 www/doc/tokebot.html diff --git a/src/app/channel/activeChannel.js b/src/app/channel/activeChannel.js index a3bbd8c..4e42f8d 100644 --- a/src/app/channel/activeChannel.js +++ b/src/app/channel/activeChannel.js @@ -24,7 +24,7 @@ const playlistHandler = require('./media/playlistHandler') /** * Class representing a single active channel */ -module.exports = class{ +class activeChannel{ /** * Instantiates an activeChannel object @@ -150,4 +150,6 @@ module.exports = class{ //Broadcast that sumbitch this.server.io.in(this.name).emit('chanEmotes', emoteList); } -} \ No newline at end of file +} + +module.exports = activeChannel; \ No newline at end of file diff --git a/src/app/channel/channelManager.js b/src/app/channel/channelManager.js index 2cdf3ea..545d37e 100644 --- a/src/app/channel/channelManager.js +++ b/src/app/channel/channelManager.js @@ -30,7 +30,7 @@ const chatHandler = require('./chatHandler'); /** * Class containing global server-side channel connection management logic */ -module.exports = class{ +class channelManager{ /** * Instantiates object containing global server-side channel conection management logic * @param {Server} io - Socket.io server instanced passed down from server.js @@ -301,4 +301,6 @@ module.exports = class{ //Broadcast that sumbitch this.io.sockets.emit('siteEmotes', emoteList); } -} \ No newline at end of file +} + +module.exports = channelManager; \ No newline at end of file diff --git a/src/app/channel/chatHandler.js b/src/app/channel/chatHandler.js index 6ef532a..eafe2d9 100644 --- a/src/app/channel/chatHandler.js +++ b/src/app/channel/chatHandler.js @@ -28,7 +28,7 @@ const {userModel} = require('../../schemas/user/userSchema'); /** * Class containing global server-side chat relay logic */ -module.exports = class{ +class chatHandler{ /** * Instantiates a chatHandler object * @param {channelManager} server - Parent Server Object @@ -330,4 +330,6 @@ module.exports = class{ } } } -} \ No newline at end of file +} + +module.exports = chatHandler; \ No newline at end of file diff --git a/src/app/channel/commandPreprocessor.js b/src/app/channel/commandPreprocessor.js index 219bddd..448198d 100644 --- a/src/app/channel/commandPreprocessor.js +++ b/src/app/channel/commandPreprocessor.js @@ -26,7 +26,7 @@ const channelModel = require('../../schemas/channel/channelSchema'); /** * Class containing global server-side chat/command pre-processing logic */ -module.exports = class commandPreprocessor{ +class commandPreprocessor{ /** * Instantiates a commandPreprocessor object * @param {channelManager} server - Parent Server Object @@ -427,4 +427,6 @@ class commandProcessor{ //throw send flag return true; } -} \ No newline at end of file +} + +module.exports = commandPreprocessor; \ No newline at end of file diff --git a/src/app/channel/connectedUser.js b/src/app/channel/connectedUser.js index ff8a252..3bae407 100644 --- a/src/app/channel/connectedUser.js +++ b/src/app/channel/connectedUser.js @@ -25,7 +25,7 @@ const { userModel } = require('../../schemas/user/userSchema'); /** * Class representing a single user connected to a channel */ -module.exports = class{ +class connectedUser{ /** * Instantiates a connectedUser object * @param {Mongoose.Document} userDB - User document to re-hydrate user from @@ -288,4 +288,6 @@ module.exports = class{ this.channel.broadcastUserList(); this.sendClientMetadata(); } -} \ No newline at end of file +} + +module.exports = connectedUser; \ No newline at end of file diff --git a/src/app/channel/media/media.js b/src/app/channel/media/media.js index 172ad4c..2edad7a 100644 --- a/src/app/channel/media/media.js +++ b/src/app/channel/media/media.js @@ -17,7 +17,7 @@ along with this program. If not, see .*/ /** * Object representing a piece of media */ -module.exports = class{ +class media{ /** * Creates a new media object from scraped information * @param {String} title - Chosen title of media @@ -37,4 +37,6 @@ module.exports = class{ this.duration = duration; this.rawLink = rawLink; } -} \ No newline at end of file +} + +module.exports = media; \ No newline at end of file diff --git a/src/app/channel/media/playlistHandler.js b/src/app/channel/media/playlistHandler.js index d9ead81..7aeba35 100644 --- a/src/app/channel/media/playlistHandler.js +++ b/src/app/channel/media/playlistHandler.js @@ -27,7 +27,7 @@ const { userModel } = require('../../../schemas/user/userSchema'); /** * Class containing playlist management logic for a single channel */ -module.exports = class{ +class playlistHandler{ /** * Instantiates a new object to handle playlist management for a single channel * @param {channelManager} server - Parent server object @@ -1134,4 +1134,6 @@ module.exports = class{ return loggerUtils.socketExceptionHandler(socket, err); } } -} \ No newline at end of file +} + +module.exports = playlistHandler; \ No newline at end of file diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js index f285682..be69ddd 100644 --- a/src/app/channel/media/queue.js +++ b/src/app/channel/media/queue.js @@ -26,7 +26,7 @@ const channelModel = require('../../../schemas/channel/channelSchema'); /** * Object represneting a single channel's media queue */ -module.exports = class{ +class queue{ /** * Instantiates a new media queue for a given channel * @param {channelManager} server - Parent server object @@ -1749,4 +1749,6 @@ module.exports = class{ loggerUtils.localExceptionHandler(err); } } -} \ No newline at end of file +} + +module.exports = queue; \ No newline at end of file diff --git a/src/app/channel/media/queuedMedia.js b/src/app/channel/media/queuedMedia.js index 2ecb213..02bab6d 100644 --- a/src/app/channel/media/queuedMedia.js +++ b/src/app/channel/media/queuedMedia.js @@ -21,7 +21,7 @@ const media = require('./media'); * Class extending media which represents a queued piece of media * @extends media */ -module.exports = class extends media{ +class queuedMedia extends media{ /** * Creates a new queued media object * @param {Number} startTime - JS Epoch representing start time @@ -119,4 +119,6 @@ module.exports = class extends media{ return this.startTime + (this.earlyEnd * 1000); } } -} \ No newline at end of file +} + +module.exports = queuedMedia; \ No newline at end of file diff --git a/src/app/channel/tokebot.js b/src/app/channel/tokebot.js index fb181e2..02bbc3c 100644 --- a/src/app/channel/tokebot.js +++ b/src/app/channel/tokebot.js @@ -23,7 +23,7 @@ const statSchema = require('../../schemas/statSchema'); /** * Class containing global server-side tokebot logic */ -module.exports = class tokebot{ +class tokebot{ /** * Instantiates a tokebot object * @param {channelManager} server - Parent Server Object @@ -228,3 +228,5 @@ module.exports = class tokebot{ } } + +module.exports = tokebot; \ No newline at end of file diff --git a/www/doc/activeChannel.html b/www/doc/activeChannel.html new file mode 100644 index 0000000..51f3d07 --- /dev/null +++ b/www/doc/activeChannel.html @@ -0,0 +1,795 @@ + + + + + JSDoc: Class: activeChannel + + + + + + + + + + +
+ +

Class: activeChannel

+ + + + + + +
+ +
+ +

activeChannel(server, chanDB)

+ +
Class representing a single active channel
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new activeChannel(server, chanDB)

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

Methods

+ + + + + + + +

(async) broadcastChanEmotes(chanDB)

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

broadcastUserList()

+ + + + + + +
+ Broadcasts user list to all users +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

handleDisconnect(socket)

+ + + + + + +
+ Handles server-side initialization for disconnecting from the channel +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +Socket + + + + Requesting Socket
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/app_channel_activeChannel.js.html b/www/doc/app_channel_activeChannel.js.html index 22dd331..18c6698 100644 --- a/www/doc/app_channel_activeChannel.js.html +++ b/www/doc/app_channel_activeChannel.js.html @@ -52,7 +52,7 @@ const playlistHandler = require('./media/playlistHandler') /** * Class representing a single active channel */ -module.exports = class{ +class activeChannel{ /** * Instantiates an activeChannel object @@ -178,7 +178,9 @@ module.exports = class{ //Broadcast that sumbitch this.server.io.in(this.name).emit('chanEmotes', emoteList); } -} +} + +module.exports = activeChannel; @@ -188,13 +190,13 @@ module.exports = class{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_channelManager.js.html b/www/doc/app_channel_channelManager.js.html index f94e5ef..7511d25 100644 --- a/www/doc/app_channel_channelManager.js.html +++ b/www/doc/app_channel_channelManager.js.html @@ -58,7 +58,7 @@ const chatHandler = require('./chatHandler'); /** * Class containing global server-side channel connection management logic */ -module.exports = class{ +class channelManager{ /** * Instantiates object containing global server-side channel conection management logic * @param {Server} io - Socket.io server instanced passed down from server.js @@ -329,7 +329,9 @@ module.exports = class{ //Broadcast that sumbitch this.io.sockets.emit('siteEmotes', emoteList); } -} +} + +module.exports = channelManager; @@ -339,13 +341,13 @@ module.exports = class{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_chat.js.html b/www/doc/app_channel_chat.js.html index 9cdcac6..d70c35f 100644 --- a/www/doc/app_channel_chat.js.html +++ b/www/doc/app_channel_chat.js.html @@ -75,13 +75,13 @@ module.exports = chat;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_chatBuffer.js.html b/www/doc/app_channel_chatBuffer.js.html index 95225b3..2f38cfa 100644 --- a/www/doc/app_channel_chatBuffer.js.html +++ b/www/doc/app_channel_chatBuffer.js.html @@ -172,13 +172,13 @@ module.exports = chatBuffer;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_chatHandler.js.html b/www/doc/app_channel_chatHandler.js.html index acef38a..c660eb2 100644 --- a/www/doc/app_channel_chatHandler.js.html +++ b/www/doc/app_channel_chatHandler.js.html @@ -56,7 +56,7 @@ const {userModel} = require('../../schemas/user/userSchema'); /** * Class containing global server-side chat relay logic */ -module.exports = class{ +class chatHandler{ /** * Instantiates a chatHandler object * @param {channelManager} server - Parent Server Object @@ -358,7 +358,9 @@ module.exports = class{ } } } -} +} + +module.exports = chatHandler; @@ -368,13 +370,13 @@ module.exports = class{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_commandPreprocessor.js.html b/www/doc/app_channel_commandPreprocessor.js.html index c3fb194..173338b 100644 --- a/www/doc/app_channel_commandPreprocessor.js.html +++ b/www/doc/app_channel_commandPreprocessor.js.html @@ -54,7 +54,7 @@ const channelModel = require('../../schemas/channel/channelSchema'); /** * Class containing global server-side chat/command pre-processing logic */ -module.exports = class commandPreprocessor{ +class commandPreprocessor{ /** * Instantiates a commandPreprocessor object * @param {channelManager} server - Parent Server Object @@ -455,7 +455,9 @@ class commandProcessor{ //throw send flag return true; } -} +} + +module.exports = commandPreprocessor; @@ -465,13 +467,13 @@ class commandProcessor{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_connectedUser.js.html b/www/doc/app_channel_connectedUser.js.html index f670d7b..56a2999 100644 --- a/www/doc/app_channel_connectedUser.js.html +++ b/www/doc/app_channel_connectedUser.js.html @@ -53,7 +53,7 @@ const { userModel } = require('../../schemas/user/userSchema'); /** * Class representing a single user connected to a channel */ -module.exports = class{ +class connectedUser{ /** * Instantiates a connectedUser object * @param {Mongoose.Document} userDB - User document to re-hydrate user from @@ -316,7 +316,9 @@ module.exports = class{ this.channel.broadcastUserList(); this.sendClientMetadata(); } -} +} + +module.exports = connectedUser; @@ -326,13 +328,13 @@ module.exports = class{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_media_media.js.html b/www/doc/app_channel_media_media.js.html index 37a1490..7ac6996 100644 --- a/www/doc/app_channel_media_media.js.html +++ b/www/doc/app_channel_media_media.js.html @@ -45,7 +45,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/ /** * Object representing a piece of media */ -module.exports = class{ +class media{ /** * Creates a new media object from scraped information * @param {String} title - Chosen title of media @@ -65,7 +65,9 @@ module.exports = class{ this.duration = duration; this.rawLink = rawLink; } -} +} + +module.exports = media; @@ -75,13 +77,13 @@ module.exports = class{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_media_playlistHandler.js.html b/www/doc/app_channel_media_playlistHandler.js.html index 5773a86..12e23ab 100644 --- a/www/doc/app_channel_media_playlistHandler.js.html +++ b/www/doc/app_channel_media_playlistHandler.js.html @@ -55,7 +55,7 @@ const { userModel } = require('../../../schemas/user/userSchema'); /** * Class containing playlist management logic for a single channel */ -module.exports = class{ +class playlistHandler{ /** * Instantiates a new object to handle playlist management for a single channel * @param {channelManager} server - Parent server object @@ -1162,7 +1162,9 @@ module.exports = class{ return loggerUtils.socketExceptionHandler(socket, err); } } -} +} + +module.exports = playlistHandler; @@ -1172,13 +1174,13 @@ module.exports = class{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_media_queue.js.html b/www/doc/app_channel_media_queue.js.html index 6c98c13..d1c0f3c 100644 --- a/www/doc/app_channel_media_queue.js.html +++ b/www/doc/app_channel_media_queue.js.html @@ -54,7 +54,7 @@ const channelModel = require('../../../schemas/channel/channelSchema'); /** * Object represneting a single channel's media queue */ -module.exports = class{ +class queue{ /** * Instantiates a new media queue for a given channel * @param {channelManager} server - Parent server object @@ -1777,7 +1777,9 @@ module.exports = class{ loggerUtils.localExceptionHandler(err); } } -} +} + +module.exports = queue; @@ -1787,13 +1789,13 @@ module.exports = class{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_media_queuedMedia.js.html b/www/doc/app_channel_media_queuedMedia.js.html index 6add7c3..5593036 100644 --- a/www/doc/app_channel_media_queuedMedia.js.html +++ b/www/doc/app_channel_media_queuedMedia.js.html @@ -49,7 +49,7 @@ const media = require('./media'); * Class extending media which represents a queued piece of media * @extends media */ -module.exports = class extends media{ +class queuedMedia extends media{ /** * Creates a new queued media object * @param {Number} startTime - JS Epoch representing start time @@ -147,7 +147,9 @@ module.exports = class extends media{ return this.startTime + (this.earlyEnd * 1000); } } -} +} + +module.exports = queuedMedia; @@ -157,13 +159,13 @@ module.exports = class extends media{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/app_channel_tokebot.js.html b/www/doc/app_channel_tokebot.js.html index cbb9662..c301d8d 100644 --- a/www/doc/app_channel_tokebot.js.html +++ b/www/doc/app_channel_tokebot.js.html @@ -51,15 +51,21 @@ const statSchema = require('../../schemas/statSchema'); /** * Class containing global server-side tokebot logic */ -module.exports = class tokebot{ +class tokebot{ /** * Instantiates a tokebot object * @param {channelManager} server - Parent Server Object * @param {chatHandler} chatHandler - Parent Chat Handler Object */ constructor(server, chatHandler){ - //Set parents + /** + * Parent channelManager object + */ this.server = server; + + /** + * Parent chatHandler object + */ this.chatHandler = chatHandler; //Set timeouts to null @@ -256,7 +262,8 @@ module.exports = class tokebot{ } } - + +module.exports = tokebot; @@ -266,13 +273,13 @@ module.exports = class tokebot{
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/channelManager.html b/www/doc/channelManager.html new file mode 100644 index 0000000..361136a --- /dev/null +++ b/www/doc/channelManager.html @@ -0,0 +1,2000 @@ + + + + + JSDoc: Class: channelManager + + + + + + + + + + +
+ +

Class: channelManager

+ + + + + + +
+ +
+ +

channelManager(io)

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

Constructor

+ + + +

new channelManager(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) 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) broadcastSiteEmotes()

+ + + + + + +
+ Broadcast global emote list +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

defineListeners(socket)

+ + + + + + +
+ Define Global Server-Side socket event listeners +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +Socket + + + + Socket to check
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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 + + +
+
+ + + + + + + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

getSocketInfo(socket)

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

(async) handleConnection(socket)

+ + + + + + +
+ Handles global server-side initialization for new connections to any 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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) 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 + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/chat.html b/www/doc/chat.html index 417f4d3..cff85f0 100644 --- a/www/doc/chat.html +++ b/www/doc/chat.html @@ -95,7 +95,7 @@ -connectedUser +connectedUser @@ -323,13 +323,13 @@
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/chatBuffer.html b/www/doc/chatBuffer.html index d5b0936..925cfd4 100644 --- a/www/doc/chatBuffer.html +++ b/www/doc/chatBuffer.html @@ -95,7 +95,7 @@ -channelManager +channelManager @@ -141,7 +141,7 @@ -activeChannel +activeChannel @@ -823,13 +823,13 @@ Left here since it seems like good form anywho, since this would be a private, o
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/chatHandler.html b/www/doc/chatHandler.html new file mode 100644 index 0000000..d8ebdf7 --- /dev/null +++ b/www/doc/chatHandler.html @@ -0,0 +1,3695 @@ + + + + + JSDoc: Class: chatHandler + + + + + + + + + + +
+ +

Class: chatHandler

+ + + + + + +
+ +
+ +

chatHandler(server)

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

Constructor

+ + + +

new chatHandler(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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

defineListeners(socket)

+ + + + + + +
+ Defines global server-side chat relay event listeners +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +Socket + + + + Requesting Socket
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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) 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/commandPreprocessor.html b/www/doc/commandPreprocessor.html new file mode 100644 index 0000000..dc93df3 --- /dev/null +++ b/www/doc/commandPreprocessor.html @@ -0,0 +1,1255 @@ + + + + + JSDoc: Class: commandPreprocessor + + + + + + + + + + +
+ +

Class: commandPreprocessor

+ + + + + + +
+ +
+ +

commandPreprocessor(server, chatHandler)

+ +
Class containing global server-side chat/command pre-processing logic
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new commandPreprocessor(server, chatHandler)

+ + + + + + +
+ Instantiates a commandPreprocessor object +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
server + + +channelManager + + + + Parent Server Object
chatHandler + + +chatHandler + + + + Parent Chat Handler Object
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + + +
+ Iterates through links in message and marks them by link type for later use by client-side post-processing +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
commandObj + + +Object + + + + Object representing a single given command/chat request
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) prepMessage(commandObj)

+ + + + + + +
+ Re-creates message string from processed Command Array +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
commandObj + + +Object + + + + Object representing a single given command/chat request
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) preprocess(socket, data)

+ + + + + + +
+ Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +Socket + + + + Socket we're receiving the request from
data + + +Object + + + + Event payload
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) processServerCommand(commandObj)

+ + + + + + +
+ Uses the server's Command Processor object to process the chat/command request. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
commandObj + + +Object + + + + Object representing a single given command/chat request
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

sanatizeCommand(commandObj) → {Boolean}

+ + + + + + +
+ Sanatizes and Validates a single user chat message/command +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
commandObj + + +Object + + + + Object representing a single given command/chat request
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ false if Command/Message is too long to send +
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

sendChat(commandObj)

+ + + + + + +
+ Relays chat to channel via parent Chat Handler object +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
commandObj + + +Object + + + + Object representing a single given command/chat request
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

splitCommand(commandObj)

+ + + + + + +
+ Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders +These arrays are used to handle further command/chat processing +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
commandObj + + +Object + + + + Object representing a single given command/chat request
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/commandProcessor.html b/www/doc/commandProcessor.html index 251dce7..c983344 100644 --- a/www/doc/commandProcessor.html +++ b/www/doc/commandProcessor.html @@ -95,7 +95,7 @@ -channelManager +channelManager @@ -118,7 +118,7 @@ -chatHandler +chatHandler @@ -1825,13 +1825,13 @@
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/connectedUser.html b/www/doc/connectedUser.html new file mode 100644 index 0000000..75681f1 --- /dev/null +++ b/www/doc/connectedUser.html @@ -0,0 +1,1888 @@ + + + + + JSDoc: Class: connectedUser + + + + + + + + + + +
+ +

Class: connectedUser

+ + + + + + +
+ +
+ +

connectedUser(userDB, chanRank, channel, socket)

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

Constructor

+ + + +

new connectedUser(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

+ + + + + + + +

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) 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/global.html b/www/doc/global.html index 038459c..fcb66b1 100644 --- a/www/doc/global.html +++ b/www/doc/global.html @@ -7371,13 +7371,13 @@ Warns server admin against unsafe config options.
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/index.html b/www/doc/index.html index 4927765..fdf486a 100644 --- a/www/doc/index.html +++ b/www/doc/index.html @@ -50,13 +50,13 @@
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/media.html b/www/doc/media.html new file mode 100644 index 0000000..9abb2cd --- /dev/null +++ b/www/doc/media.html @@ -0,0 +1,361 @@ + + + + + JSDoc: Class: media + + + + + + + + + + +
+ +

Class: media

+ + + + + + +
+ +
+ +

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

+ +
Object representing a piece of media
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new media(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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/module.exports.html b/www/doc/module.exports.html index 128de4a..0033064 100644 --- a/www/doc/module.exports.html +++ b/www/doc/module.exports.html @@ -10145,143 +10145,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -10579,143 +10442,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -10863,303 +10589,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -16726,165 +16155,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -17391,143 +16661,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -18644,144 +17777,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -30342,143 +29337,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -30776,143 +29634,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -31060,303 +29781,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -36923,165 +35347,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -37588,143 +35853,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -38841,144 +36969,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -50539,143 +48529,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -50973,143 +48826,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -51257,303 +48973,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -57120,165 +54539,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -57785,143 +55045,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -59038,20364 +56161,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
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 chat/command pre-processing logic
- - -
- -
-
- - - - -

Constructor

- - - -

new exports(server, chatHandler)

- - - - - - -
- Instantiates a commandPreprocessor 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:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
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) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
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) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(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:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - - - - - - - -

(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:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
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:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -91025,143 +67790,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -91459,143 +68087,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -91743,303 +68234,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -97606,165 +73800,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -98271,143 +74306,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -99524,144 +75422,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -111360,143 +87120,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -111794,143 +87417,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -112078,303 +87564,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -117941,165 +93130,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -118606,143 +93636,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -119859,144 +94752,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -131580,143 +106335,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -132014,143 +106632,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -132298,303 +106779,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -138161,165 +112345,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -138826,143 +112851,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -140079,144 +113967,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -151823,143 +125573,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -152257,143 +125870,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -152541,303 +126017,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -158404,165 +131583,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -159069,143 +132089,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -160322,144 +133205,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -172120,143 +144865,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -172554,143 +145162,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -172838,303 +145309,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -178701,165 +150875,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -179366,143 +151381,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -180619,144 +152497,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -192340,143 +164080,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - - - - - - - - -
- Iterates through links in message and marks them by link type for later use by client-side post-processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -192774,143 +164377,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) prepMessage(commandObj)

- - - - - - -
- Re-creates message string from processed Command Array -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -193058,303 +164524,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

(async) preprocess(socket, data)

- - - - - - -
- Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
socket - - -Socket - - - - Socket we're receiving the request from
data - - -Object - - - - Event payload
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

(async) processServerCommand(commandObj)

- - - - - - -
- Uses the server's Command Processor object to process the chat/command request. -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -198921,165 +170090,6 @@ Having to crawl through these sockets is that. Because the other ways seem more - - - - - - -

sanatizeCommand(commandObj) → {Boolean}

- - - - - - -
- Sanatizes and Validates a single user chat message/command -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- false if Command/Message is too long to send -
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - - - @@ -199586,143 +170596,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

sendChat(commandObj)

- - - - - - -
- Relays chat to channel via parent Chat Handler object -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -200839,144 +171712,6 @@ https://community.appsmith.com/content/blog/dark-side-foreach-why-you-should-thi - - - - - - -

splitCommand(commandObj)

- - - - - - -
- Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders -These arrays are used to handle further command/chat processing -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
commandObj - - -Object - - - - Object representing a single given command/chat request
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -202439,13 +173174,13 @@ Called auto-magically by the Synchronization Timer
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:42 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:17:22 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/playlistHandler.html b/www/doc/playlistHandler.html new file mode 100644 index 0000000..971f6c8 --- /dev/null +++ b/www/doc/playlistHandler.html @@ -0,0 +1,5117 @@ + + + + + JSDoc: Class: playlistHandler + + + + + + + + + + +
+ +

Class: playlistHandler

+ + + + + + +
+ +
+ +

playlistHandler(server, channel)

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

Constructor

+ + + +

new playlistHandler(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) 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) 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 + + +
+
+ + + + + + + + + + + + + +

(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)

+ + + + + + +
+ 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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) 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(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) 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) 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) 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/queue.html b/www/doc/queue.html new file mode 100644 index 0000000..a61f0f1 --- /dev/null +++ b/www/doc/queue.html @@ -0,0 +1,5814 @@ + + + + + JSDoc: Class: queue + + + + + + + + + + +
+ +

Class: queue

+ + + + + + +
+ +
+ +

queue(server, chanDB, channel)

+ +
Object represneting a single channel's media queue
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new queue(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) broadcastQueue(chanDB)

+ + + + + + +
+ Broadcasts channel queue +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chanDB + + +Mongoose.Document + + + + Pass through Channel Document to save on DB Transactions
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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) deleteMedia(socket, data)

+ + + + + + +
+ Processes client requests to delete queued media +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +Socket + + + + Requesting socket
data + + +Object + + + + Event payload
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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) 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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 + + +
+
+ + + + + + + + + + + + + +

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) goLive(socket, data)

+ + + + + + +
+ Handle client request to start an HLS live stream +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +Socket + + + + Requesting socket
data + + +Object + + + + Event payload
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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 + + +
+
+ + + + + + + + + + + + + +

(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) 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(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) 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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

sendMedia(socket)

+ + + + + + +
+ Send media update to a specific socket or broadcast it to the entire channel +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +Socket + + + + Requesting Socket
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/queuedMedia.html b/www/doc/queuedMedia.html new file mode 100644 index 0000000..d57db67 --- /dev/null +++ b/www/doc/queuedMedia.html @@ -0,0 +1,945 @@ + + + + + JSDoc: Class: queuedMedia + + + + + + + + + + +
+ +

Class: queuedMedia

+ + + + + + +
+ +
+ +

queuedMedia(startTime, startTimeStamp, earlyEnd, uuid)

+ +
Class extending media which represents a queued piece of media
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new queuedMedia(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

+ + + + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

genUUID()

+ + + + + + +
+ Generates new unique identifier for queued media +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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 +
+ + + + + + + + + + + + + + + +

(static) 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 + + +
+
+ + + + + + + + + + + + + +

(static) 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 +
+ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/schemas_channel_channelBanSchema.js.html b/www/doc/schemas_channel_channelBanSchema.js.html index 4aaa763..a676c99 100644 --- a/www/doc/schemas_channel_channelBanSchema.js.html +++ b/www/doc/schemas_channel_channelBanSchema.js.html @@ -95,13 +95,13 @@ module.exports = channelBanSchema;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_channel_channelPermissionSchema.js.html b/www/doc/schemas_channel_channelPermissionSchema.js.html index 234d334..d563aa5 100644 --- a/www/doc/schemas_channel_channelPermissionSchema.js.html +++ b/www/doc/schemas_channel_channelPermissionSchema.js.html @@ -163,13 +163,13 @@ module.exports = channelPermissionSchema;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_channel_channelSchema.js.html b/www/doc/schemas_channel_channelSchema.js.html index 32ef99f..fb7b92f 100644 --- a/www/doc/schemas_channel_channelSchema.js.html +++ b/www/doc/schemas_channel_channelSchema.js.html @@ -928,13 +928,13 @@ module.exports = mongoose.model("channel", channelSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_channel_chatSchema.js.html b/www/doc/schemas_channel_chatSchema.js.html index 218f637..33d4e2d 100644 --- a/www/doc/schemas_channel_chatSchema.js.html +++ b/www/doc/schemas_channel_chatSchema.js.html @@ -90,13 +90,13 @@ module.exports = chatSchema;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_channel_media_mediaSchema.js.html b/www/doc/schemas_channel_media_mediaSchema.js.html index 8f31ede..7db4172 100644 --- a/www/doc/schemas_channel_media_mediaSchema.js.html +++ b/www/doc/schemas_channel_media_mediaSchema.js.html @@ -90,13 +90,13 @@ module.exports = mediaSchema;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_channel_media_playlistMediaSchema.js.html b/www/doc/schemas_channel_media_playlistMediaSchema.js.html index 9d43cd0..8523ae3 100644 --- a/www/doc/schemas_channel_media_playlistMediaSchema.js.html +++ b/www/doc/schemas_channel_media_playlistMediaSchema.js.html @@ -118,13 +118,13 @@ module.exports = mediaSchema.discriminator('saved', playlistMediaProperties);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_channel_media_playlistSchema.js.html b/www/doc/schemas_channel_media_playlistSchema.js.html index 1db3493..601a46c 100644 --- a/www/doc/schemas_channel_media_playlistSchema.js.html +++ b/www/doc/schemas_channel_media_playlistSchema.js.html @@ -168,13 +168,13 @@ module.exports = playlistSchema;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_channel_media_queuedMediaSchema.js.html b/www/doc/schemas_channel_media_queuedMediaSchema.js.html index 2395723..a384c5e 100644 --- a/www/doc/schemas_channel_media_queuedMediaSchema.js.html +++ b/www/doc/schemas_channel_media_queuedMediaSchema.js.html @@ -107,13 +107,13 @@ module.exports = mediaSchema.discriminator('queued', queuedProperties);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_emoteSchema.js.html b/www/doc/schemas_emoteSchema.js.html index 6860191..aa89855 100644 --- a/www/doc/schemas_emoteSchema.js.html +++ b/www/doc/schemas_emoteSchema.js.html @@ -158,13 +158,13 @@ module.exports = mongoose.model("emote", emoteSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_flairSchema.js.html b/www/doc/schemas_flairSchema.js.html index 4a4c8c3..8443064 100644 --- a/www/doc/schemas_flairSchema.js.html +++ b/www/doc/schemas_flairSchema.js.html @@ -112,13 +112,13 @@ module.exports = mongoose.model("flair", flairSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_permissionSchema.js.html b/www/doc/schemas_permissionSchema.js.html index 8d3f904..5dfd02a 100644 --- a/www/doc/schemas_permissionSchema.js.html +++ b/www/doc/schemas_permissionSchema.js.html @@ -350,13 +350,13 @@ module.exports = mongoose.model("permissions", permissionSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_statSchema.js.html b/www/doc/schemas_statSchema.js.html index 010df6d..1d420a8 100644 --- a/www/doc/schemas_statSchema.js.html +++ b/www/doc/schemas_statSchema.js.html @@ -234,13 +234,13 @@ module.exports = mongoose.model("statistics", statSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_tokebot_tokeCommandSchema.js.html b/www/doc/schemas_tokebot_tokeCommandSchema.js.html index fc81b54..edfb17c 100644 --- a/www/doc/schemas_tokebot_tokeCommandSchema.js.html +++ b/www/doc/schemas_tokebot_tokeCommandSchema.js.html @@ -154,13 +154,13 @@ module.exports = mongoose.model("tokeCommand", tokeCommandSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_user_emailChangeSchema.js.html b/www/doc/schemas_user_emailChangeSchema.js.html index 0a1f2c8..edb5d51 100644 --- a/www/doc/schemas_user_emailChangeSchema.js.html +++ b/www/doc/schemas_user_emailChangeSchema.js.html @@ -216,13 +216,13 @@ module.exports = mongoose.model("emailChange", emailChangeSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_user_passwordResetSchema.js.html b/www/doc/schemas_user_passwordResetSchema.js.html index 1a3fff1..03a6c5d 100644 --- a/www/doc/schemas_user_passwordResetSchema.js.html +++ b/www/doc/schemas_user_passwordResetSchema.js.html @@ -192,13 +192,13 @@ module.exports = mongoose.model("passwordReset", passwordResetSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_user_userBanSchema.js.html b/www/doc/schemas_user_userBanSchema.js.html index 3db347e..3d4ae40 100644 --- a/www/doc/schemas_user_userBanSchema.js.html +++ b/www/doc/schemas_user_userBanSchema.js.html @@ -515,13 +515,13 @@ module.exports = mongoose.model("userBan", userBanSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/schemas_user_userSchema.js.html b/www/doc/schemas_user_userSchema.js.html index e5c04b0..08d08b8 100644 --- a/www/doc/schemas_user_userSchema.js.html +++ b/www/doc/schemas_user_userSchema.js.html @@ -882,13 +882,13 @@ module.exports.userModel = mongoose.model("user", userSchema);
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/tokebot.html b/www/doc/tokebot.html new file mode 100644 index 0000000..3df574f --- /dev/null +++ b/www/doc/tokebot.html @@ -0,0 +1,978 @@ + + + + + JSDoc: Class: tokebot + + + + + + + + + + +
+ +

Class: tokebot

+ + + + + + +
+ +
+ +

tokebot(server, chatHandler)

+ +
Class containing global server-side tokebot logic
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new tokebot(server, chatHandler)

+ + + + + + +
+ Instantiates a tokebot object +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
server + + +channelManager + + + + Parent Server Object
chatHandler + + +chatHandler + + + + Parent Chat Handler Object
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

chatHandler

+ + + + +
+ Parent chatHandler object +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

server

+ + + + +
+ Parent channelManager object +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) refreshCommands()

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

resetToke()

+ + + + + + +
+ Resets toke cooldowns early upon authorized request +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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 + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:59 GMT-0400 (Eastern Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/www/doc/utils_altchaUtils.js.html b/www/doc/utils_altchaUtils.js.html index 827d344..90b44bc 100644 --- a/www/doc/utils_altchaUtils.js.html +++ b/www/doc/utils_altchaUtils.js.html @@ -112,13 +112,13 @@ module.exports.verify = async function(payload, uniqueSecret = ''){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_configCheck.js.html b/www/doc/utils_configCheck.js.html index 93fea81..81cc912 100644 --- a/www/doc/utils_configCheck.js.html +++ b/www/doc/utils_configCheck.js.html @@ -102,13 +102,13 @@ module.exports.securityCheck = function(){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_hashUtils.js.html b/www/doc/utils_hashUtils.js.html index 21dcb02..cc2e43e 100644 --- a/www/doc/utils_hashUtils.js.html +++ b/www/doc/utils_hashUtils.js.html @@ -97,13 +97,13 @@ module.exports.hashIP = function(ip){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_linkUtils.js.html b/www/doc/utils_linkUtils.js.html index baff084..d1c98ac 100644 --- a/www/doc/utils_linkUtils.js.html +++ b/www/doc/utils_linkUtils.js.html @@ -140,13 +140,13 @@ module.exports.markLink = async function(link){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_loggerUtils.js.html b/www/doc/utils_loggerUtils.js.html index 9c85192..3b30489 100644 --- a/www/doc/utils_loggerUtils.js.html +++ b/www/doc/utils_loggerUtils.js.html @@ -201,13 +201,13 @@ module.exports.errorMiddleware = function(err, req, res, next){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_mailUtils.js.html b/www/doc/utils_mailUtils.js.html index 38d831e..3310c7d 100644 --- a/www/doc/utils_mailUtils.js.html +++ b/www/doc/utils_mailUtils.js.html @@ -134,13 +134,13 @@ module.exports.sendAddressVerification = async function(requestDB, userDB, newEm
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_media_internetArchiveUtils.js.html b/www/doc/utils_media_internetArchiveUtils.js.html index be4210f..6e8c8ff 100644 --- a/www/doc/utils_media_internetArchiveUtils.js.html +++ b/www/doc/utils_media_internetArchiveUtils.js.html @@ -148,13 +148,13 @@ module.exports.fetchMetadata = async function(fullID, title){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_media_yanker.js.html b/www/doc/utils_media_yanker.js.html index e070b5d..825203f 100644 --- a/www/doc/utils_media_yanker.js.html +++ b/www/doc/utils_media_yanker.js.html @@ -187,13 +187,13 @@ module.exports.getMediaType = async function(url){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_media_ytdlpUtils.js.html b/www/doc/utils_media_ytdlpUtils.js.html index 460ede2..9814973 100644 --- a/www/doc/utils_media_ytdlpUtils.js.html +++ b/www/doc/utils_media_ytdlpUtils.js.html @@ -180,13 +180,13 @@ async function ytdlpFetch(link, format = 'b'){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_regexUtils.js.html b/www/doc/utils_regexUtils.js.html index 53407f9..505d037 100644 --- a/www/doc/utils_regexUtils.js.html +++ b/www/doc/utils_regexUtils.js.html @@ -63,13 +63,13 @@ module.exports.escapeRegex = function(string){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_scheduler.js.html b/www/doc/utils_scheduler.js.html index ad2f750..90c8742 100644 --- a/www/doc/utils_scheduler.js.html +++ b/www/doc/utils_scheduler.js.html @@ -99,13 +99,13 @@ module.exports.kickoff = function(){
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)
diff --git a/www/doc/utils_sessionUtils.js.html b/www/doc/utils_sessionUtils.js.html index 3b73c64..55a03eb 100644 --- a/www/doc/utils_sessionUtils.js.html +++ b/www/doc/utils_sessionUtils.js.html @@ -230,13 +230,13 @@ module.exports.maxAttempts = maxAttempts;
- Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:08:41 GMT-0400 (Eastern Daylight Time) + Documentation generated by JSDoc 4.0.4 on Tue Sep 02 2025 07:28:58 GMT-0400 (Eastern Daylight Time)