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:
Name Type Description
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:
Name Type Description
commandObj Object Object representing a single given command/chat request
Source:

(async) prepMessage(commandObj)

Re-creates message string from processed Command Array
Parameters:
Name Type Description
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:
Name Type Description
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:
Name Type Description
commandObj Object Object representing a single given command/chat request
Source:

sanatizeCommand(commandObj) → {Boolean}

Sanatizes and Validates a single user chat message/command
Parameters:
Name Type Description
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:
Name Type Description
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:
Name Type Description
commandObj Object Object representing a single given command/chat request
Source: