/**
  * Return the maximum number of guesses a client may submit.
  *
  * @return int Maximum number of guesses.
  *
  * @throws Exception Throws if an error occurred.
  */
 public static function getMaximumGuessesPerClient()
 {
     return (int) Registry::getValue('client.maxEntries')->getValue();
 }
Example #2
0
/**
 * Get the key of the current client session.
 *
 * @return string Session key
 *
 * @throws Exception Throws if an error occurred.
 */
function getSessionKey()
{
    // Return the key from the globals if set
    if (isset($GLOBALS['session_key'])) {
        return $GLOBALS['session_key'];
    }
    // Get the session cookie name
    $sessionCookieName = Registry::getValue('client.session.cookie.name')->getValue();
    // Get the session key
    $sessionKey = CookieManager::getCookie($sessionCookieName);
    // Set the session key global
    $GLOBALS['session_key'] = $sessionKey;
    // Return the session key
    return $sessionKey;
}