<commit_before>import Chess from 'chess.js';
import Crazyhouse from 'crazyhouse.js';
import SChess from 'schess.js';
import {CLOSE_ANALYSIS} from './types';

export function sitDownBoard(details) {
    return {
        type: 'server/sit-down-board',
        payload: details
    }
}

export function joinAnalysisRoom(game, gameType) {
    game.gameType = gameType;
    game.fen = game.final_fen;
    game.numPlayers = 2;
    if(gameType === 'standard') {
        let g = new Chess();
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        g.reset();
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    } else if(gameType === 'schess') {
        let g = new SChess();
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        g.reset();
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    } else if(gameType === 'crazyhouse')  {
        let g = new Crazyhouse();
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        g.reset();
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    } else if(gameType === 'crazyhouse960') {
        let g = new Crazyhouse();
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        game.pgn[0].fen = game.initial_fen;
        g.reset();
        g.load(game.initial_fen);
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    }
    return {
        type: 'update-room',
        payload: {
            gameType,
            room: {
                private: true,
                voiceChat: false,
                maxPlayers: 10000,
                name: gameType + game._id.slice(0, 5),

            },
            times: {
                b: 2,
                w: 2,
            },<commit_msg>Setting 960 to true, crazyhouse analysis mode<commit_after>import Chess from 'chess.js';
import Crazyhouse from 'crazyhouse.js';
import SChess from 'schess.js';
import {CLOSE_ANALYSIS} from './types';

export function sitDownBoard(details) {
    return {
        type: 'server/sit-down-board',
        payload: details
    }
}

export function joinAnalysisRoom(game, gameType) {
    game.gameType = gameType;
    game.fen = game.final_fen;
    game.numPlayers = 2;
    if(gameType === 'standard') {
        let g = new Chess();
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        g.reset();
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    } else if(gameType === 'schess') {
        let g = new SChess();
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        g.reset();
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    } else if(gameType === 'crazyhouse')  {
        let g = new Crazyhouse();
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        g.reset();
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    } else if(gameType === 'crazyhouse960') {
        let g = new Crazyhouse({960: true});
        g.load_pgn(game.pgn);
        game.pgn = g.history({ verbose: true});
        game.pgn[0].fen = game.initial_fen;
        g.reset();
        g.load(game.initial_fen);
        game.pgn.map((move) => {
           g.move(move);
           move.fen = g.fen();
        });
    }
    return {
        type: 'update-room',
        payload: {
            gameType,
            room: {
                private: true,
                voiceChat: false,
                maxPlayers: 10000,
                name: gameType + game._id.slice(0, 5),

            },
            times: {
                b: 2,
                w: 2,
            },
{'fraction_non_alphanumeric': 0.15556118571066632, 'fraction_numerical': 0.008614137319483153, 'mean_word_length': 1.5569948186528497, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4077426', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1279, 'n_words': 257}