<commit_before><html>
<head>
<script src="/socket.io/socket.io.js"></script>
<script language="JavaScript">
    function getValue(varname) {
        var url = window.location.href;
        var qparts = url.split("?");
        if (qparts.length == 0) {
            return "";
        }
        var query = qparts[1];
        var vars = query.split("&");
        var value = "";
        for (i = 0; i < vars.length; i++) {
            var parts = vars[i].split("=");
            if (parts[0] == varname) {
                value = parts[1];
                break;
            }
        }
        value = unescape(value);
        value.replace(/\+/g," ");
        return value;
    }

    var group = getValue("gid");
    var pid = getValue("pid");
    console.log("Group: " + group);
    console.log("Participant ID: " + pid);

    var socket = io.connect();
    var gameSettings = null;
    var id = null;
    var agents = null;
    var loop;
    var cCanvas;
    var cContext;
    var oCanvas;
    var oContext;
    var iCanvas;
    var iContext;
    var sailingAllowed = false;
    var fishingAllowed = false;
    var returningAllowed = false;
    var pausable = true;
    var unpausable = false;
    var readRules = false;
    var seconds;
    var fullroom = false;

    socket.on("connect", function (data) {
        socket.emit("join group", group, pid);
    });

    socket.on('gamesettings', function (gs) {
        console.log(gs);
        gameSettings = gs;
    });

    socket.on('fullroom', function (group) {
        console.log("The room was full.");
        fullroom = true;
    })

    socket.on('myID', function (myID) {
        console.log(myID);
        id = myID;
    });

    socket.on('myGroup', function (myGroup) {
        console.log(myGroup);
        group = myGroup;
    });

    socket.on('agents', function (ags) {
        console.log(ags);
        agents = ags;
    });

    socket.on('news', function (data) {
        console.log(data);
    });

    socket.on('begin', function (data) {
        console.log('Begin simulation.');
        gameSettings = data;
        sailingAllowed = true;
    });

    socket.on('readying', function (data) {
        console.log('readying');
        gameSettings = data;
        sailingAllowed = false;
        fishingAllowed = false;
    });

    socket.on('endseason', function (data) {
        console.log('Current season ended.');
        gameSettings = data;
        sailingAllowed = false;
        fishingAllowed = false;
        returningAllowed = false;
    });

    socket.on('gameover', function (data) {
        console.log('Simulation over.');
        gameSettings = data;
        sailingAllowed = false;
        fishingAllowed = false;
        returningAllowed = false;
    });

    socket.on('message',function(data) {
        console.log('Received a message from the server!', data);
    });

    socket.on('paused', function (data) {
        console.log("Simulation paused by user: " + data.id);
        pausable = false;
        if (id == data.id) {
            console.log("unpausable now");
            unpausable = true;
        }
    });

    socket.on('resumed', function (data) {
        console.log("Simulation resumed by user: " + data.id);
        pausable = true;
        unpausable = false;
    });
</script>

<title>Client - Main Screen</title>

<script language="JavaScript">

function goToSeaOnClick() {
    socket.emit('toSea', {id: id});
    sailingAllowed = false;
    fishingAllowed = true;
    returningAllowed = true;
}

function returnToPortOnClick() {<commit_msg>Remove some unnecessary functions.<commit_after><html>
<head>
<script src="/socket.io/socket.io.js"></script>
<script language="JavaScript">
    function getValue(varname) {
        var url = window.location.href;
        var qparts = url.split("?");
        if (qparts.length == 0) {
            return "";
        }
        var query = qparts[1];
        var vars = query.split("&");
        var value = "";
        for (i = 0; i < vars.length; i++) {
            var parts = vars[i].split("=");
            if (parts[0] == varname) {
                value = parts[1];
                break;
            }
        }
        value = unescape(value);
        value.replace(/\+/g," ");
        return value;
    }

    var group = getValue("gid");
    var pid = getValue("pid");
    console.log("Group: " + group);
    console.log("Participant ID: " + pid);

    var socket = io.connect();
    var gameSettings = null;
    var id = null;
    var agents = null;
    var loop;
    var cCanvas;
    var cContext;
    var oCanvas;
    var oContext;
    var iCanvas;
    var iContext;
    var sailingAllowed = false;
    var fishingAllowed = false;
    var returningAllowed = false;
    var pausable = true;
    var unpausable = false;
    var readRules = false;
    var seconds;
    var fullroom = false;

    socket.on("connect", function (data) {
        socket.emit("join group", group, pid);
    });

    socket.on('gamesettings', function (gs) {
        console.log(gs);
        gameSettings = gs;
    });

    socket.on('fullroom', function (group) {
        console.log("The room was full.");
        fullroom = true;
    })

    socket.on('myID', function (myID) {
        console.log(myID);
        id = myID;
    });

    socket.on('myGroup', function (myGroup) {
        console.log(myGroup);
        group = myGroup;
    });

    socket.on('begin', function (data) {
        console.log('Begin simulation.');
        gameSettings = data;
        sailingAllowed = true;
    });

    socket.on('readying', function (data) {
        console.log('readying');
        gameSettings = data;
        sailingAllowed = false;
        fishingAllowed = false;
    });

    socket.on('endseason', function (data) {
        console.log('Current season ended.');
        gameSettings = data;
        sailingAllowed = false;
        fishingAllowed = false;
        returningAllowed = false;
    });

    socket.on('gameover', function (data) {
        console.log('Simulation over.');
        gameSettings = data;
        sailingAllowed = false;
        fishingAllowed = false;
        returningAllowed = false;
    });

    socket.on('paused', function (data) {
        console.log("Simulation paused by user: " + data.id);
        pausable = false;
        if (id == data.id) {
            console.log("unpausable now");
            unpausable = true;
        }
    });

    socket.on('resumed', function (data) {
        console.log("Simulation resumed by user: " + data.id);
        pausable = true;
        unpausable = false;
    });
</script>

<title>Client - Main Screen</title>

<script language="JavaScript">

function goToSeaOnClick() {
    socket.emit('toSea', {id: id});
    sailingAllowed = false;
    fishingAllowed = true;
    returningAllowed = true;
}

function returnToPortOnClick() {
{'fraction_non_alphanumeric': 0.14233629867288902, 'fraction_numerical': 0.001458363715910748, 'mean_word_length': 2.071204657411554, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, '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': '3155414', 'n_tokens_mistral': 2077, 'n_tokens_neox': 2070, 'n_words': 489}