-
Notifications
You must be signed in to change notification settings - Fork 18
Info Query v7
- status: complete
- version: 7.x
The Info Query allows for the extraction of information about the state of the server via a REST API call.
Assuming your server runs on localhost and port 8080, you can execute an info query accessing the following url:
http://localhost:8080?q=PARAMETER
where PARAMETER
can take any of the following values:
Returns high-level information for every active channel.
Call:
http://localhost:8080?q=channels
Return value:
{
"ultimatum": {
"sockets":{"sio": true, "direct": true },
"accessDeniedUrl":"/ultimatum/unauth.htm",
"verbosity":100,
"getFromAdmins":true,
"enableReconnections":true,
"defaultChannel":false,
"name":"ultimatum",
"roomCounter":2,
"gameName":"ultimatum",
"open":true
}
}
Returns detailed information about the game played in every channel.
Call:
http://localhost:8080?q=games
Return value:
{
"ultimatum": {
"dir": "path/to/dir/game",
"info": { }, // Content of package.json
"settings": { // As in game.settings.js
"standard": { },
"pp": { }
},
"treatmentNames": ["standard","pp"],
"setup": { }, // As in game.setup.js
"stager": { }, // Game sequence.
"languages":{ }, // Any languages supported.
"channel": { }, // As in channel.settings.js
"waitroom":{ }, // As in waitroom.settings.js
"auth":{ }, // As in auth.settings.js
"requirements":{ }, // As in requirements.settings.js
"aliases":{} // If any defined
}
}
Returns combined info for active games and channels.
Call:
http://localhost:8080?q=info
Return value:
{
"channels": {
"ultimatum": { } // See ?q=channels
}
"games": {
"ultimatum": { } // See ?q=games
}
}
Returns current status of waiting rooms.
Call:
http://localhost:8080?q=waitroom&game=ultimatum
Select the waiting room of a particular level within the game:
http://localhost:8080?q=waitroom&game=ultimatum&level=level2
Return value:
{"nPlayers":0} // Players currently waiting.
The Info query is disabled by default. To enable the server configuration (conf/servernode.js
) file inside the nodeGame installation folder and add the following line:
servernode.enableInfoQuery = true;
In case of cyclic structures (e.g., a loaded database in game.setup.js) an error will be raised.
Go back to the wiki Home.
Copyright (C) 2021 Stefano Balietti
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.