Class server
Class defined in:server.js:11
SAGE2 server
appFileSaveRequest
( wsio, data
)
server.js:10650
Method handling a file save request from a SAGE2_App
Parameters:appLaunchHelperGetPathOfApp
( appName
)
server.js:10054
Used to get the full path of an app starting with appName in the FileName.
Parameters:-
appName
<Object>- Folder name to check for the app.
Either it gets the full path or null to indicate not available.
closeWebSocketClient
( wsio
)
server.js:747
Callback when a client closes
Parameters:-
wsio
<Websocket>websocket of the client
createPartition
( dims, color
)
server.js:10919
Create a new partition with a given set of dimensions and a color
Parameters:createPartition
( id
)
server.js:10946
Create a new partition with a given set of dimensions and a color
Parameters:-
id
<String>- The id of the partition to be deleted
doOverlap
( x_1, y_1, width_1, height_1, x_2, y_2, width_2, height_2
)
server.js:1880
Test if two rectangles overlap (axis-aligned)
Parameters:-
x_1
<Integer>x coordinate first rectangle
-
y_1
<Integer>y coordinate first rectangle
-
width_1
<Integer>width first rectangle
-
height_1
<Integer>height first rectangle
-
x_2
<Integer>x coordinate second rectangle
-
y_2
<Integer>y coordinate second rectangle
-
width_2
<Integer>width second rectangle
-
height_2
<Integer>height second rectangle
true if rectangles overlap
emitLog
( data
)
server.js:662
Print a message to all the web consoles
Parameters:-
data
<Object>object to print
fillContextMenuWithShareSites
( contextMenu, appId
)
server.js:9829
Given a context menu, will fill with appropriate share sites.
Parameters:hideRadialMenu
( uniqueID
)
server.js:9581
Hides radial menu and enables interactivity
Parameters:-
uniqueID
<Integer>radial menu ID
initializeExistingAppsAudio
( wsio
)
server.js:1221
Ensures that new audioManager instances get metadata about all existing apps
Parameters:-
wsio
<Websocket>client's websocket
initializeExistingControls
( wsio
)
server.js:1234
Rebuilds the application widgets for a given client
Parameters:-
wsio
<Websocket>client's websocket
initializeExistingSagePointers
( wsio
)
server.js:1291
Rebuilds the pointers for a given client
Parameters:-
wsio
<Websocket>client's websocket
initializeExistingWallUI
( wsio
)
server.js:1306
Rebuilds the wall radial menu for a given client
Parameters:-
wsio
<Websocket>client's websocket
initializeWSClient
( wsio, reqConfig, reqVersion, reqTime, reqConsole
)
server.js:946
Sends the first messages when client built
Parameters:-
wsio
<Websocket>client's websocket
-
reqConfig
<Bool>client requests configuration
-
reqVersion
<Bool>client requests version
-
reqTime
<Bool>client requests time information
-
reqConsole
<Bool>client requests console messages
moveRadialMenu
( uniqueID, pointerX, pointerY
)
server.js:9523
Translates position of a radial menu by an offset
Parameters:-
uniqueID
<Integer>radial menu ID
-
pointerX
<Float>offset x position
-
pointerY
<Float>offset y position
openWebSocketClient
( wsio
)
server.js:736
Callback when a client connects
Parameters:-
wsio
<Websocket>The websocket for this client
partitionsGrabAllContent
(
)
server.js:10901
Cause all apps to be associated with a partition if it is above one
ReportIfCanWallScreenshot
(
)
server.js:10269
Calculate if we have enough screenshot-capable display clients and send message to UI clients to enable the screenshot menu
setRadialMenuPosition
( uniqueID, pointerX, pointerY
)
server.js:9543
Sets the absolute position of a radial menu
Parameters:-
uniqueID
<Integer>radial menu ID
-
pointerX
<Float>x position
-
pointerY
<Float>y position
setupListeners
( wsio
)
server.js:1016
Installs all the message callbacks on a websocket
Parameters:-
wsio
<Websocket>concerned websocket
shareApplicationWithRemoteSite
( uniqueID, app, remote
)
server.js:8114
Shares an application with a remote site
Parameters:showRadialMenu
( uniqueID
)
server.js:9565
Shows radial menu and enables interactivity
Parameters:-
uniqueID
<Integer>radial menu ID
wsAddClient
( wsio, data
)
server.js:835
Callback that configures a new client
Parameters:-
wsio
<Websocket>client's websocket
-
data
<Object>initialization data
wsAppContextMenuContents
( wsio, data
)
server.js:9869
Received from a display client, apps will send their context menu after completing their initialization.
Parameters:wsCallFunctionOnApp
( wsio, data
)
server.js:9882
Will call a function on each display client's app that matches id. Expected usage with context menu. But can be used in other cases. There are some special functionality cases like: SAGE2DeleteElement, SAGE2SendToBack, SAGE2Maximize These do not send message to app.
Parameters:wsCreatePartition
( data
)
server.js:10783
Create a new screen partition with dimensions specified in data
Parameters:-
data
<Object>- The dimensions of the partition to be created
wsDisplayHardware
( wsio, data
)
server.js:10533
Receive data from Electron display client about their hardware
Parameters:-
wsio
<> The wsio
-
data
<> The data
wsLaunchAppWithValues
( wsio, data
)
server.js:10002
Will launch app with specified name and call the given function after. The function doesn't need to be called to give the parameters.
Parameters:wsPartitionScreen
( data
)
server.js:10798
Create a new screen partition with dimensions specified in data
Parameters:-
data
<Object>- Contains the layout specificiation with which partitions will be created
wsPartitionsGrabAllContent
(
)
server.js:10890
Cause all apps to be associated with a partition if it is above one (WebSocket method)
wsPerformanceData
( wsio, data
)
server.js:10545
Receive data from Electron display client about their hardware
Parameters:-
wsio
<> The wsio
-
data
<> The data
wsRequestAppContextMenu
( wsio, data
)
server.js:9775
Asks server for the context menu of an app. Server will send the current known menu. Menus must be sumitted by app, or the default "Not yet loaded" will be displayed. To use context menu an app MUST have been loaded on a master display.
Parameters:-
wsio
<Object>- The websocket of sender.
-
data
<Object>- The object needed to get menu, properties described below.
x
<Integer>- Pointer x, corresponds to on entire wall.
y
<Integer>- Pointer y, corresponds to on entire wall.
xClick
<Integer>- Where client clicked on their screen, because this is async.
yClick
<Integer>- Where client clicked on their screen, because this is async.
wsSaveDataOnServer
( wsio, data
)
server.js:10107
Used to write files into the media folders. Writes to a joined location of mainFolder.path(~/Documents/SAGE2_media)
Parameters:wsSendDataToClient
( wsio, data
)
server.js:10075
Sends data to a specific client or set.
Parameters:wsServerDataGetAllTrackedDescriptions
( wsio, data
)
server.js:10241
Will respond back once to the app giving the func an array of tracked descriptions. They will be in an array of objects with properties nameOfValue and description.
Parameters:wsServerDataGetAllTrackedValues
( wsio, data
)
server.js:10226
Will respond back once to the app giving the func an array of tracked values. They will be in an array of objects with properties nameOfValue and value. NOTE: the values in the array could be huge.
Parameters:wsServerDataGetValue
( wsio, data
)
server.js:10187
Checks if there is a value, and if so will send the value. If the value doesn't exist, it will not return anything.
Parameters:wsServerDataRemoveValue
( wsio, data
)
server.js:10199
Removes variable from server. Expected usage is this is called when an app closes. Made for the sake of cleanup as apps open and close.
Parameters:wsServerDataSetValue
( wsio, data
)
server.js:10176
Sets the value of specified server data. If it doesn't exist, will create it.
Parameters:wsServerDataSubscribeToNewValueNotification
( wsio, data
)
server.js:10255
Will add the websocket to subscriber list of new value notifications. The subscriber will get an object with nameOfValue and description.
Parameters:wsServerDataSubscribeToValue
( wsio, data
)
server.js:10211
Add the app to the named values a subscriber. If the value doesn't exist, it will create a "blank" value and subscribe to it.
Parameters:wsStartWallScreenshot
( wsio, data
)
server.js:10290
Sent from UI, server gets it and tells displays to send back screenshots. Only happens if a screenshot is not already in progress to prevent spam. The masterDisplay check in array is reset (discarded) and rebuilt.
Parameters:wsVoiceToAction
( wsio, data
)
server.js:10967
Will attempt to take a transcript and use best case to activate a context menu item. All logic is performed within the src/voiceToAction.js file.
Parameters:wsWallScreenshotFromDisplay
( wsio, data
)
server.js:10330
Called when displays are sending screenshots. Displays that are not capable of screenshots will report back saying so. Performs the following: if not display, stop if display is not capable, mark status, stop get all displays in array save the current display's screenshot mark this display in the correct check in position if display has width and height, mark those locations too if all display tiles screenshots have been submitted OR all displays have submitted a screenshot or are incapable then make a screenshot done with mosaic and offset tiles based on config information stitching is done in tmp folder to avoid problems caused by the folder monitor finally reset variable to allow another screenshot
Parameters: