question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why there is lags when I have 2000 bots on my server?

Connected players: 2001/99999999
Players: 1 - Bots: 2000
Average score: 10.77
Server has been running for a total of 61 minutes
Current memory usage: 31.3/53.9 mb
Current game mode: Custom FREE FOR ALL
Current update time: 77.245 [ms]  (extremely high lag)

Custom game mode is just for displaying bots in leaderboard

const Mode = require('./Mode')

class FFA extends Mode {
  constructor() {
    super();
    this.ID = 0
    this.name = 'Custom FREE FOR ALL'
    this.specByLeaderboard = true
  }

  onPlayerSpawn(gameServer, player) {
    player.color = gameServer.getRandomColor()
    // Spawn player
    gameServer.spawnPlayer(player, gameServer.randomPos())
  }

  updateLB(gameServer, lb) {
    gameServer.leaderboardType = this.packetLB

    for (var i = 0, pos = 0; i < gameServer.clients.length; i++) {
        var player = gameServer.clients[i].playerTracker;
        if (player.isRemoved || !player.cells.length ||
            player.socket.isConnected == false)
            continue

        for (var j = 0; j < pos; j++)
            if (lb[j]._score < player._score) break

        lb.splice(j, 0, player)
        pos++
    }
    this.rankOne = lb[0]
  }
}

module.exports = FFA

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11

github_iconTop GitHub Comments

4reactions
MastaCodercommented, Jun 2, 2017

displaying bots in leaderboard

There’s your problem.

0reactions
goodmindcommented, Jun 13, 2017

I see it, why you keep updating lol

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kahoot Bot (2000 bots) - Replit
Bot your kahoots with this 100% epic kahoot flooder.
Read more >
at what rating can I beat the 2000 rated bots/computers
I am trying to get 3 stars on as many bots as possible. So far I have manage to beat 2 of the...
Read more >
How much US Dollar (USD) is 2000 Bodhi (BOT) ? Exchange ...
2000 Bodhi = 912965 US Dollar (USD) · 2000 BOT to USD (2000 Bodhi to US Dollar) Exchange Calculator.
Read more >
Add BruhBot 2000 Discord Bot | The #1 Discord Bot List
if a message has "bruh moment" the bot will reply "bruh moment indeed". b/support: sends link to support server. join the support server...
Read more >
Category:2000 robots - Wikipedia
Pages in category "2000 robots" ; A. ASIMO ; B · Boilerplate (robot) ; I. I-Cybie · IRobot Transphibian ; P · Poo-Chi...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found