<commit_before>class ClientEngine {

    constructor(socket, gameEngine){
        var that = this;
        this.socket = socket;
        this.gameEngine = gameEngine;


        this.messageIndex = 0;
        this.pendingInput = []; //holds all the input yet to be processed by the server
        this.outboundMessages = [];


        this.socket.on('playerJoined', function(playerData) {
            that.playerId = playerData.playerId;
        });
    }

    start(){
        var that = this;

        this.socket.on('worldUpdate', function(worldData) {
            that.onServerStep(worldData);
        });

        //todo, rename, shouldn't work on setInterval
        this.outboundMessageInterval = setInterval(this.handleOutboundInput.bind(this),16);

        this.gameEngine.start();
    }

    step(){
        this.gameEngine.step();
    }

    sendInput(input){
        var message = {
            command: 'move',<commit_msg>hopefully fix local player lag<commit_after>class ClientEngine {

    constructor(socket, gameEngine){
        var that = this;
        this.socket = socket;
        this.gameEngine = gameEngine;


        this.messageIndex = 0;
        this.pendingInput = []; //holds all the input yet to be processed by the server
        this.outboundMessages = [];


        this.socket.on('playerJoined', function(playerData) {
            that.playerId = playerData.playerId;
        });
    }

    start(){
        var that = this;

        this.socket.on('worldUpdate', function(worldData) {
            that.onServerStep(worldData);
        });

        this.gameEngine.start();
    }

    step(){
        this.handleOutboundInput();
        this.gameEngine.step();
    }

    sendInput(input){
        var message = {
            command: 'move',
{'fraction_non_alphanumeric': 0.11555806087936867, 'fraction_numerical': 0.002254791431792559, 'mean_word_length': 2.049828178694158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '309666', 'n_tokens_mistral': 503, 'n_tokens_neox': 475, 'n_words': 102}