{
  "_config": {
    "port": 8070,
    "public": "./dist",
    "silent": true,
    "authorized": false
  },
  "profile": {
    "id":"cWzaLP12eSeDL68F",
    "username":"mock",
    "displayName":"Mock User",
    "provider":"mock",
    "extUserId":"mock_01",
    "email":"mock@example.com",
    "role":"user",
    "registered": true,
    "createdAt":"2020-02-21T16:42:47.432Z",
    "lastLoginAt":"2020-02-21T16:42:47.437Z"
  },
  "user,initData": {
    "id":"cWzaLP12eSeDL68F",
    "username":"mock-registered",
    "displayName":"Registered Mock User",
    "provider":"mock",
    "extUserId":"mock_01",
    "email":"mock@example.com",
    "role":"user",
    "registered": true,
    "createdAt":"2020-02-21T16:42:47.432Z",
    "lastLoginAt":"2020-02-21T16:42:47.437Z"
  },
  "authMethods": {
    "mock": {
      "name": "Mock",
      "url": "/auth/mock"
    }
  },
  "user,scripts": [],
  "user,league,submission": {
    "id": "U7aO66layk0yEqwg",
    "scriptId": "xVDPu2zXl9M4lINa",
    "ownerId": "cWzaLP12eSeDL68F",
    "ownerName": "mock",
    "scriptName": "nihnae",
    "joinedAt": "2020-02-23T08:27:42.940Z",
    "rank": 1,
    "fights_total": 343,
    "fights_win": 128,
    "fights_lose": 43,
    "score": 1092,
    "history": []
  },
  "user,league,replay": [
  {"_id":"5ed108bfdf088a19fb84fa77","id":"5ed108bfdf088a19fb84fa77","createdAt":"2020-05-29T13:06:07.890Z","expiresAt":"2020-05-29T14:06:07.890Z","ubd":"{\"version\":3,\"rngSeed\":0.6492123242742991,\"teamMode\":true,\"timeLimit\":20000,\"aiList\":[{\"name\":\"crawler\",\"team\":\"jsbattle/crawler\",\"code\":\"importScripts('lib/tank.js');\\n\\nvar turnDirection, turnTimer;\\n\\ntank.init(function(settings, info) {\\n  settings.SKIN = 'forest';\\n  // the direction where tank will turning.\\n  // 1 is clockwise, -1 is couter clockwise\\n  turnDirection = Math.random() < 0.5 ? 1 : -1;\\n  turnTimer = Math.round(Math.randomRange(0, 30));\\n});\\n\\ntank.loop(function(state, control) {\\n\\n  // when hit an obstacle, start turning until\\n  // time of turnTimer doesn't run out\\n  if(state.collisions.wall || state.collisions.enemy || state.collisions.ally) {\\n    turnTimer = Math.round(Math.randomRange(20, 50));\\n  }\\n  if(turnTimer > 0) {\\n    turnTimer--;\\n    // when turnTimer is on, do not move forward because there is\\n    // probably an obstacle in front of you. Turn instead.\\n    control.THROTTLE = 0;\\n    control.TURN = turnDirection;\\n  } else {\\n    // keep going forward at full speed\\n    control.THROTTLE = 1;\\n    control.TURN = 0;\\n  }\\n  // Shoot whenever you see an enemy\\n  if(state.radar.enemy) {\\n    control.SHOOT = 0.5;\\n  }\\n});\\n\",\"initData\":null,\"useSandbox\":true,\"executionLimit\":100},{\"name\":\"chicken\",\"team\":\"jsbattle/chicken\",\"code\":\"importScripts('lib/tank.js');\\n\\n/* moves tank in defined direction\\n* @param targetAngle - direction of movement\\n* @param state - state object of the tank\\n* @param control - control object of the tank\\n* @param done - callback executed when tank is close to the wall and the movement is over\\n*/\\nfunction goToDirection(targetAngle, state, control, done) {\\n  var angleDelta = Math.deg.normalize(targetAngle - state.angle);\\n  control.TURN = angleDelta * 0.2;\\n  // use boost to hide in corner ASAP\\n  control.BOOST = 1;\\n\\n  // if any enemy on the radar - shoot!\\n  if(state.radar.enemy) {\\n    control.SHOOT = 1;\\n  } else {\\n    control.SHOOT = 0;\\n  }\\n\\n  if(Math.abs(angleDelta) < 5) {\\n    // do not move forward if a tank is on your way\\n    if(state.collisions.enemy || state.collisions.ally) {\\n      control.THROTTLE = 0;\\n    } else {\\n      control.THROTTLE = 1;\\n    }\\n    // finish movement when close to a wall\\n    if(state.radar.wallDistance && state.radar.wallDistance < 50) {\\n      control.THROTTLE = 0;\\n      control.TURN = 0;\\n      control.BOOST = 0;\\n      done();\\n    }\\n  }\\n}\\n\\n// strategy of moving north/south\\n// used at the beginning to go close to a wall\\nfunction goVerticalStrategy(state, control) {\\n  goToDirection(verticalAngle, state, control, function() {\\n    // when done - go to a corner\\n    strategy = goHorizontalStrategy;\\n  });\\n  control.DEBUG.strategy = \\\"goVerticalStrategy:\\\" + verticalAngle;\\n}\\n\\n// strategy of moving east/west\\n// used when you are close to the wall so you can find a corner\\nfunction goHorizontalStrategy(state, control) {\\n  goToDirection(horizontalAngle, state, control, function() {\\n    // when done - start shooting\\n    strategy = shootStrategy;\\n  });\\n  control.DEBUG.strategy = \\\"goHorizontalStrategy:\\\" + horizontalAngle;\\n}\\n\\n// shoot wave of bullets\\nfunction shootStrategy(state, control) {\\n  // 20*Math.sin(timer*0.1) cause rotation +-20 degrees over the time\\n  var angleDelta = Math.deg.normalize(shootAngle + 20*Math.sin(timer*0.1) - state.angle);\\n  control.TURN = angleDelta * 0.2;\\n  control.SHOOT = 0.1;\\n  control.DEBUG.strategy = \\\"shootStrategy:\\\" + shootAngle;\\n}\\n\\n\\n// strategy function that is currently used\\nvar strategy;\\n\\n// random direction of the tank that results in vertical movement (north or south)\\nvar verticalAngle;\\n// random direction of the tank that results in horizontal movement (east or west)\\nvar horizontalAngle;\\n// best direction to shoot when the tank is hidden i battlefield's corner\\nvar shootAngle;\\n// timer used to change shooting angle over the time\\nvar timer = 0;\\n\\ntank.init(function(settings, info) {\\n  settings.SKIN = 'forest';\\n\\n  // randomize direction of tank movement\\n  verticalAngle = Math.random() < 0.5 ? -90 : +90;\\n  horizontalAngle = Math.random() < 0.5 ? 0 : -180;\\n  // find direction that is opposite to the corner where the tank is\\n  shootAngle = Math.deg.normalize(verticalAngle + horizontalAngle)/2;\\n  if(horizontalAngle == 0) {\\n    shootAngle += 180;\\n  }\\n\\n  // start from moving north/south\\n  strategy = goVerticalStrategy;\\n});\\n\\ntank.loop(function(state, control) {\\n  // execute current strategy\\n  strategy(state, control);\\n  timer++;\\n});\\n\",\"initData\":null,\"useSandbox\":true,\"executionLimit\":100},{\"name\":\"crawler\",\"team\":\"jsbattle/crawler\",\"code\":\"importScripts('lib/tank.js');\\n\\nvar turnDirection, turnTimer;\\n\\ntank.init(function(settings, info) {\\n  settings.SKIN = 'forest';\\n  // the direction where tank will turning.\\n  // 1 is clockwise, -1 is couter clockwise\\n  turnDirection = Math.random() < 0.5 ? 1 : -1;\\n  turnTimer = Math.round(Math.randomRange(0, 30));\\n});\\n\\ntank.loop(function(state, control) {\\n\\n  // when hit an obstacle, start turning until\\n  // time of turnTimer doesn't run out\\n  if(state.collisions.wall || state.collisions.enemy || state.collisions.ally) {\\n    turnTimer = Math.round(Math.randomRange(20, 50));\\n  }\\n  if(turnTimer > 0) {\\n    turnTimer--;\\n    // when turnTimer is on, do not move forward because there is\\n    // probably an obstacle in front of you. Turn instead.\\n    control.THROTTLE = 0;\\n    control.TURN = turnDirection;\\n  } else {\\n    // keep going forward at full speed\\n    control.THROTTLE = 1;\\n    control.TURN = 0;\\n  }\\n  // Shoot whenever you see an enemy\\n  if(state.radar.enemy) {\\n    control.SHOOT = 0.5;\\n  }\\n});\\n\",\"initData\":null,\"useSandbox\":true,\"executionLimit\":100},{\"name\":\"chicken\",\"team\":\"jsbattle/chicken\",\"code\":\"importScripts('lib/tank.js');\\n\\n/* moves tank in defined direction\\n* @param targetAngle - direction of movement\\n* @param state - state object of the tank\\n* @param control - control object of the tank\\n* @param done - callback executed when tank is close to the wall and the movement is over\\n*/\\nfunction goToDirection(targetAngle, state, control, done) {\\n  var angleDelta = Math.deg.normalize(targetAngle - state.angle);\\n  control.TURN = angleDelta * 0.2;\\n  // use boost to hide in corner ASAP\\n  control.BOOST = 1;\\n\\n  // if any enemy on the radar - shoot!\\n  if(state.radar.enemy) {\\n    control.SHOOT = 1;\\n  } else {\\n    control.SHOOT = 0;\\n  }\\n\\n  if(Math.abs(angleDelta) < 5) {\\n    // do not move forward if a tank is on your way\\n    if(state.collisions.enemy || state.collisions.ally) {\\n      control.THROTTLE = 0;\\n    } else {\\n      control.THROTTLE = 1;\\n    }\\n    // finish movement when close to a wall\\n    if(state.radar.wallDistance && state.radar.wallDistance < 50) {\\n      control.THROTTLE = 0;\\n      control.TURN = 0;\\n      control.BOOST = 0;\\n      done();\\n    }\\n  }\\n}\\n\\n// strategy of moving north/south\\n// used at the beginning to go close to a wall\\nfunction goVerticalStrategy(state, control) {\\n  goToDirection(verticalAngle, state, control, function() {\\n    // when done - go to a corner\\n    strategy = goHorizontalStrategy;\\n  });\\n  control.DEBUG.strategy = \\\"goVerticalStrategy:\\\" + verticalAngle;\\n}\\n\\n// strategy of moving east/west\\n// used when you are close to the wall so you can find a corner\\nfunction goHorizontalStrategy(state, control) {\\n  goToDirection(horizontalAngle, state, control, function() {\\n    // when done - start shooting\\n    strategy = shootStrategy;\\n  });\\n  control.DEBUG.strategy = \\\"goHorizontalStrategy:\\\" + horizontalAngle;\\n}\\n\\n// shoot wave of bullets\\nfunction shootStrategy(state, control) {\\n  // 20*Math.sin(timer*0.1) cause rotation +-20 degrees over the time\\n  var angleDelta = Math.deg.normalize(shootAngle + 20*Math.sin(timer*0.1) - state.angle);\\n  control.TURN = angleDelta * 0.2;\\n  control.SHOOT = 0.1;\\n  control.DEBUG.strategy = \\\"shootStrategy:\\\" + shootAngle;\\n}\\n\\n\\n// strategy function that is currently used\\nvar strategy;\\n\\n// random direction of the tank that results in vertical movement (north or south)\\nvar verticalAngle;\\n// random direction of the tank that results in horizontal movement (east or west)\\nvar horizontalAngle;\\n// best direction to shoot when the tank is hidden i battlefield's corner\\nvar shootAngle;\\n// timer used to change shooting angle over the time\\nvar timer = 0;\\n\\ntank.init(function(settings, info) {\\n  settings.SKIN = 'forest';\\n\\n  // randomize direction of tank movement\\n  verticalAngle = Math.random() < 0.5 ? -90 : +90;\\n  horizontalAngle = Math.random() < 0.5 ? 0 : -180;\\n  // find direction that is opposite to the corner where the tank is\\n  shootAngle = Math.deg.normalize(verticalAngle + horizontalAngle)/2;\\n  if(horizontalAngle == 0) {\\n    shootAngle += 180;\\n  }\\n\\n  // start from moving north/south\\n  strategy = goVerticalStrategy;\\n});\\n\\ntank.loop(function(state, control) {\\n  // execute current strategy\\n  strategy(state, control);\\n  timer++;\\n});\\n\",\"initData\":null,\"useSandbox\":true,\"executionLimit\":100},{\"name\":\"crawler\",\"team\":\"jsbattle/crawler\",\"code\":\"importScripts('lib/tank.js');\\n\\nvar turnDirection, turnTimer;\\n\\ntank.init(function(settings, info) {\\n  settings.SKIN = 'forest';\\n  // the direction where tank will turning.\\n  // 1 is clockwise, -1 is couter clockwise\\n  turnDirection = Math.random() < 0.5 ? 1 : -1;\\n  turnTimer = Math.round(Math.randomRange(0, 30));\\n});\\n\\ntank.loop(function(state, control) {\\n\\n  // when hit an obstacle, start turning until\\n  // time of turnTimer doesn't run out\\n  if(state.collisions.wall || state.collisions.enemy || state.collisions.ally) {\\n    turnTimer = Math.round(Math.randomRange(20, 50));\\n  }\\n  if(turnTimer > 0) {\\n    turnTimer--;\\n    // when turnTimer is on, do not move forward because there is\\n    // probably an obstacle in front of you. Turn instead.\\n    control.THROTTLE = 0;\\n    control.TURN = turnDirection;\\n  } else {\\n    // keep going forward at full speed\\n    control.THROTTLE = 1;\\n    control.TURN = 0;\\n  }\\n  // Shoot whenever you see an enemy\\n  if(state.radar.enemy) {\\n    control.SHOOT = 0.5;\\n  }\\n});\\n\",\"initData\":null,\"useSandbox\":true,\"executionLimit\":100},{\"name\":\"chicken\",\"team\":\"jsbattle/chicken\",\"code\":\"importScripts('lib/tank.js');\\n\\n/* moves tank in defined direction\\n* @param targetAngle - direction of movement\\n* @param state - state object of the tank\\n* @param control - control object of the tank\\n* @param done - callback executed when tank is close to the wall and the movement is over\\n*/\\nfunction goToDirection(targetAngle, state, control, done) {\\n  var angleDelta = Math.deg.normalize(targetAngle - state.angle);\\n  control.TURN = angleDelta * 0.2;\\n  // use boost to hide in corner ASAP\\n  control.BOOST = 1;\\n\\n  // if any enemy on the radar - shoot!\\n  if(state.radar.enemy) {\\n    control.SHOOT = 1;\\n  } else {\\n    control.SHOOT = 0;\\n  }\\n\\n  if(Math.abs(angleDelta) < 5) {\\n    // do not move forward if a tank is on your way\\n    if(state.collisions.enemy || state.collisions.ally) {\\n      control.THROTTLE = 0;\\n    } else {\\n      control.THROTTLE = 1;\\n    }\\n    // finish movement when close to a wall\\n    if(state.radar.wallDistance && state.radar.wallDistance < 50) {\\n      control.THROTTLE = 0;\\n      control.TURN = 0;\\n      control.BOOST = 0;\\n      done();\\n    }\\n  }\\n}\\n\\n// strategy of moving north/south\\n// used at the beginning to go close to a wall\\nfunction goVerticalStrategy(state, control) {\\n  goToDirection(verticalAngle, state, control, function() {\\n    // when done - go to a corner\\n    strategy = goHorizontalStrategy;\\n  });\\n  control.DEBUG.strategy = \\\"goVerticalStrategy:\\\" + verticalAngle;\\n}\\n\\n// strategy of moving east/west\\n// used when you are close to the wall so you can find a corner\\nfunction goHorizontalStrategy(state, control) {\\n  goToDirection(horizontalAngle, state, control, function() {\\n    // when done - start shooting\\n    strategy = shootStrategy;\\n  });\\n  control.DEBUG.strategy = \\\"goHorizontalStrategy:\\\" + horizontalAngle;\\n}\\n\\n// shoot wave of bullets\\nfunction shootStrategy(state, control) {\\n  // 20*Math.sin(timer*0.1) cause rotation +-20 degrees over the time\\n  var angleDelta = Math.deg.normalize(shootAngle + 20*Math.sin(timer*0.1) - state.angle);\\n  control.TURN = angleDelta * 0.2;\\n  control.SHOOT = 0.1;\\n  control.DEBUG.strategy = \\\"shootStrategy:\\\" + shootAngle;\\n}\\n\\n\\n// strategy function that is currently used\\nvar strategy;\\n\\n// random direction of the tank that results in vertical movement (north or south)\\nvar verticalAngle;\\n// random direction of the tank that results in horizontal movement (east or west)\\nvar horizontalAngle;\\n// best direction to shoot when the tank is hidden i battlefield's corner\\nvar shootAngle;\\n// timer used to change shooting angle over the time\\nvar timer = 0;\\n\\ntank.init(function(settings, info) {\\n  settings.SKIN = 'forest';\\n\\n  // randomize direction of tank movement\\n  verticalAngle = Math.random() < 0.5 ? -90 : +90;\\n  horizontalAngle = Math.random() < 0.5 ? 0 : -180;\\n  // find direction that is opposite to the corner where the tank is\\n  shootAngle = Math.deg.normalize(verticalAngle + horizontalAngle)/2;\\n  if(horizontalAngle == 0) {\\n    shootAngle += 180;\\n  }\\n\\n  // start from moving north/south\\n  strategy = goVerticalStrategy;\\n});\\n\\ntank.loop(function(state, control) {\\n  // execute current strategy\\n  strategy(state, control);\\n  timer++;\\n});\\n\",\"initData\":null,\"useSandbox\":true,\"executionLimit\":100}]}","description":"jsbattle/crawler vs jsbattle/chicken","meta":[{"id":"5ecd06d60b7fda5799e71069","name":"jsbattle/crawler","battleScore":92.55,"winner":false},{"id":"5ecd06d60b7fda5799e71068","name":"jsbattle/chicken","battleScore":306.8099999999994,"winner":true}]}
  ],
  "user,league": {
    "submission": {
      "id": "U7aO66layk0yEqwg",
      "scriptId": "xVDPu2zXl9M4lINa",
      "ownerId": "cWzaLP12eSeDL68F",
      "ownerName": "mock",
      "scriptName": "nihnae",
      "joinedAt": "2020-02-23T08:27:42.940Z",
      "rank": 1,
      "fights_total": 343,
      "fights_win": 128,
      "fights_lose": 43,
      "score": 1092,
      "history": []
    },
    "ranktable": [
      {
        "id": "hjkKvy79ahj34",
        "scriptId": "asdf772db8q9fasdo",
        "ownerId": "jnfao8y9ascdy",
        "ownerName": "Allegro",
        "scriptName": "killa-8",
        "joinedAt": "2020-01-28T10:27:42.940Z",
        "rank": 1,
        "fights_total": 343,
        "fights_win": 128,
        "fights_lose": 43,
        "score": 1092
      },
      {
        "id": "U7aO66layk0yEqwg",
        "scriptId": "xVDPu2zXl9M4lINa",
        "ownerId": "cWzaLP12eSeDL68F",
        "ownerName": "jerome",
        "scriptName": "nihnae",
        "joinedAt": "2020-02-23T08:27:42.940Z",
        "rank": 2,
        "fights_total": 342,
        "fights_win": 50,
        "fights_lose": 122,
        "score": 1092
      },
      {
        "id": "jhsadf90y79a3",
        "scriptId": "h84323adsfia98",
        "ownerId": "fash4u39awfh2349b",
        "ownerName": "monk",
        "scriptName": "3ll3a",
        "joinedAt": "2020-04-01T12:34:42.940Z",
        "rank": 3,
        "fights_total": 354,
        "fights_win": 128,
        "fights_lose": 43,
        "score": 1092
      }
    ],
    "history": [
        {
            "id": "5ed108bfdf088a19fb84fa77",
            "createdAt": "2020-04-01T12:34:49.940Z",
            "players": [
                {
                    "id": "DmYdtErQJnZGpp9y",
                    "name": "jsbattle/crawler",
                    "winner": true
                },
                {
                    "id": "wEnX0XSEfAIPmyOi",
                    "name": "jsbattle/chicken",
                    "winner": false
                }
            ]
        },
        {
            "id": "ORhzc8LFEoUhZg2N",
            "createdAt": "2020-04-01T12:34:48.940Z",
            "players": [
                {
                    "id": "pMaaEfDjmw65gQKR",
                    "name": "jsbattle/dodge",
                    "winner": true
                },
                {
                    "id": "DmYdtErQJnZGpp9y",
                    "name": "jsbattle/crawler",
                    "winner": false
                }
            ]
        },
        {
            "id": "QokqNqarUwI1lxpo",
            "createdAt": "2020-04-01T12:34:47.940Z",
            "players": [
                {
                    "id": "iVl94fUAOiXXGm3H",
                    "name": "jsbattle/sniper",
                    "winner": false
                },
                {
                    "id": "ME1DpnV8uHet6tjl",
                    "name": "jsbattle/kamikaze",
                    "winner": true
                }
            ]
        },
        {
            "id": "misNbE35uRlw43kM",
            "createdAt": "2020-04-01T12:34:46.940Z",
            "players": [
                {
                    "id": "pMaaEfDjmw65gQKR",
                    "name": "jsbattle/dodge",
                    "winner": true
                },
                {
                    "id": "wEnX0XSEfAIPmyOi",
                    "name": "jsbattle/chicken",
                    "winner": false
                }
            ]
        },
        {
            "id": "op6qpAicpDB88qq5",
            "createdAt": "2020-04-01T12:34:45.940Z",
            "players": [
                {
                    "id": "13zCqjrThAGrw2vf",
                    "name": "jsbattle/jamro",
                    "winner": false
                },
                {
                    "id": "pMaaEfDjmw65gQKR",
                    "name": "jsbattle/dodge",
                    "winner": false
                }
            ]
        },
        {
            "id": "sVFjmG406YnTSUa5",
            "createdAt": "2020-04-01T12:34:44.940Z",
            "players": [
                {
                    "id": "iVl94fUAOiXXGm3H",
                    "name": "jsbattle/sniper",
                    "winner": true
                },
                {
                    "id": "DmYdtErQJnZGpp9y",
                    "name": "jsbattle/crawler",
                    "winner": false
                }
            ]
        },
        {
            "id": "RTS41R2bY2XBaRb5",
            "createdAt": "2020-04-01T12:34:43.940Z",
            "players": [
                {
                    "id": "DmYdtErQJnZGpp9y",
                    "name": "jsbattle/crawler",
                    "winner": true
                },
                {
                    "id": "Q4W23fZ49j84nRQa",
                    "name": "jsbattle/crazy",
                    "winner": false
                }
            ]
        }
    ]
  }
}
