Class: Msgs

Msgs()

Messages that the server listens for from clients.
Includes try-catch and notification (via console) of receipt.
Corresponds to client/internal/clients/admin/shared/msgsToServer.js

Constructor

new Msgs()

Source:

Methods

getApp(socket) → {Message}

getApp - Return the app with identifier data.appId.

Parameters:
Name Type Description
data.appId String

Identifier of the app.

socket Socket

The socket which asked for the app.

Source:
Returns:

A message object, which includes callback (cb) and data fields.

Type
Message

getAppMetadatas(cb, socket) → {Message}

getAppMetadatas - Get an array of the app metadatas found on the server.

Parameters:
Name Type Description
cb String

The callback to execute when returning the metadatas to the client.

socket Socket

The socket which asked for the data.

Source:
Returns:

A message object, which includes callback (cb) and data fields.

Type
Message

otreeConvertApp()

Converts an oTree app of the catalogue to a jtree app (dialects/otree/convert.js), in a
folder beside it (-jtree, or -jtree-2, ...), which joins the catalogue; tells the
admin who asked: otreeConverted {appPath, outPath, level, report} or {appPath, error}.
Returns a promise of that.

Source:

otreeCreateSession()

Creates and starts a session from an oTree project's session config (the oTree admin's
"Create session"): {configId (a queue id, settings.py#name), numParticipants, config
(values to change in session.config), userId}. Opens it for the admin who asked.

Source:

otreeMonitor()

Sends the admin who asked where each participant of a session is (the oTree admin's
monitor): {sessionId, rows: [{code, label, app, round, page, status, secondsOnPage, payoff, payment}]}.

Source:

otreeReports()

Sends the admin who asked the admin reports of a session's oTree apps (their
admin_report.html): {sessionId, reports: [{app, round, html}]}, for the rounds started.

Source:

roomOpenSession()

Opens a session in a room: {roomId, sessionId} (see Room#openSession).

Source:

sessionAddApp(d) → {type}

sessionAddApp - Add an app to the given session.

Parameters:
Name Type Description
d Object

An object containing the session ID (sId), the app id (appPath), and options for the app (options).

Source:
Returns:
Type
type

sessionAddQueue()

Older name for Msgs#sessionAddApp, from when queues were not apps.

Source:

sessionPlayWithBots()

{sId}: plays the session to its end with bots (see Session#playWithBots).

Source:

setSessionMode()

{sId, mode}: the session's mode ('jtree', 'ztree', 'otree'), or null for the server's.

Source:

startSessionFromQueue()

Older name for Msgs#createSessionAndAddApp, from when queues were not apps.

Source:

ztreeConvertApp()

Converts a z-Tree treatment of the catalogue to a jtree app (dialects/ztree/convert.js), in a
folder beside it (-jtree, or -jtree-2, ...), which joins the catalogue; tells the admin
who asked: ztreeConverted {appPath, outPath, level, report} or {appPath, error}.

Source:

ztreeTables()

Sends the admin who asked the z-Tree tables of a session's z-Tree treatments:
ztreeTables {sessionId, apps: {<index in the session, from 1>: {periods: [{globals,
subjects, summary, contracts}], session, current (period index)}}}.

Source:

(static) names()

The messages admins may send: the methods above.

Source: