<commit_before><?php
require_once('../../global_functions.php');
require_once('../functions.php');
require_once('../../connections/parameters.php');

//Get the lobby options

try {
    $userID = !empty($_GET['uid']) && is_numeric($_GET['uid'])
        ? $_GET['uid']
        : NULL;

    $modGUID = !empty($_GET['mid'])
        ? $_GET['mid']
        : NULL;

    $steamID = new SteamID($userID);
    $userID = $steamID->getSteamID64();

    if (!empty($userID) && !empty($modGUID)) {
        $lobbyStatus = array();

        $db = new dbWrapper_v2($hostname_gds_site, $username_gds_site, $password_gds_site, $database_gds_site, false);
        $db->q('SET NAMES utf8;');

        if ($db) {
            $lobbyDetails = $db->q(
                'SELECT
                        ll.`lobby_id`,
                        ll.`mod_id`,
                        ll.`mod_guid`,
                        ll.`workshop_id`,
                        ll.`lobby_leader`,
                        ll.`lobby_options`
                    FROM `lobby_list` ll
                    WHERE ll.`lobby_leader` = ? AND ll.`mod_guid` = ?
                    ORDER BY `lobby_id` DESC
                    LIMIT 0,1;',
                'ss',
                $userID, $modGUID
            );

            //TODO: Timeout the options to match the TTL

            if (!empty($lobbyDetails)) {
                $lobbyDetails = $lobbyDetails[0];<commit_msg>Lobby options live for 10minutes after the last keep_alive<commit_after><?php
require_once('../../global_functions.php');
require_once('../functions.php');
require_once('../../connections/parameters.php');

//Get the lobby options

try {
    $userID = !empty($_GET['uid']) && is_numeric($_GET['uid'])
        ? $_GET['uid']
        : NULL;

    $modGUID = !empty($_GET['mid'])
        ? $_GET['mid']
        : NULL;

    $steamID = new SteamID($userID);
    $userID = $steamID->getSteamID64();

    if (!empty($userID) && !empty($modGUID)) {
        $lobbyStatus = array();

        $db = new dbWrapper_v2($hostname_gds_site, $username_gds_site, $password_gds_site, $database_gds_site, false);
        $db->q('SET NAMES utf8;');

        if ($db) {
            $lobbyDetails = $db->q(
                'SELECT
                        ll.`lobby_id`,
                        ll.`mod_id`,
                        ll.`mod_guid`,
                        ll.`workshop_id`,
                        ll.`lobby_leader`,
                        ll.`lobby_options`
                    FROM `lobby_list` ll
                    WHERE
                        ll.`date_keep_alive` > now() - INTERVAL 10 MINUTE
                        AND ll.`lobby_leader` = ?
                        AND ll.`mod_guid` = ?
                    ORDER BY `lobby_id` DESC
                    LIMIT 0,1;',
                'ss',
                $userID, $modGUID
            );

            if (!empty($lobbyDetails)) {
                $lobbyDetails = $lobbyDetails[0];
{'fraction_non_alphanumeric': 0.14872665534804755, 'fraction_numerical': 0.006112054329371817, 'mean_word_length': 1.471476510067114, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6246690', 'n_tokens_mistral': 933, 'n_tokens_neox': 880, 'n_words': 159}