<commit_before><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
header('Cache-Control: no-store');

require_once '../models/Database.php';
require_once '../models/Room.php';

$token = filter_input(INPUT_GET, 'token', FILTER_SANITIZE_URL);

$Room = new Room($token);
$roomID = $Room->id;
$player = $Room->player;<commit_msg>Added exit clause for spectator connecting<commit_after><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
header('Cache-Control: no-store');

require_once '../models/Database.php';
require_once '../models/Room.php';

$token = filter_input(INPUT_GET, 'token', FILTER_SANITIZE_URL);

$Room = new Room($token);
$roomID = $Room->id;
$player = $Room->player;

if($player === Room::USER_SPECTATOR) {
    echo json_encode ( array( 'success' => FALSE) );
    exit;
}

{'fraction_non_alphanumeric': 0.14593077642656688, 'fraction_numerical': 0.0, 'mean_word_length': 4.631578947368421, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '3468886', 'n_tokens_mistral': 335, 'n_tokens_neox': 329, 'n_words': 100}