new socket_server(io, setting, openspace)
OpenSpace WebSocket related communication method
Parameters:
| Name | Type | Description |
|---|---|---|
io |
library | socket.io library |
setting |
object | The configuration object |
openspace |
library | lib/openspace library |
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
io |
library | socket.io library |
config |
object | The configuration object stored from the parameter |
userList |
array | The list of connected clients |
cameraAccess |
array | The list of clients who can access camera |
planetAccess |
array | The list of clients who can access planet change |
adminID |
array | The socket id of admin |
Methods
-
initAdmin(type, socket)
-
Function to initialize admin frontend content
Parameters:
Name Type Description typestring 'add' / 'remove' / 'init' / 'refresh'
socketobject The socket object
- Source:
-
initUser(socket, io, id, target, content)
-
Function to initialize user frontend content
Parameters:
Name Type Description socketobject The socket object
iolibrary socket.io library
idint The user id
targetstring The frontend DOM id
contentstring The frontend content
- Source:
-
checkAccess(socket, type)
-
Function to check if a user can access certain control
Parameters:
Name Type Description socketobject The socket object
typestring The type of control
- Source: