OgarProject / Ogar

An open source Agar.io server implementation, written with Node.js.
Other
713 stars 825 forks source link

Teams mode doesn't work. #579

Open lukerayman opened 8 years ago

lukerayman commented 8 years ago

When I try to start server in Teams mode I'm getting this error:

[Game] Ogar - An open source Agar.io server implementation
[Game] Loaded stats server on port 8082
[Game] Listening on port 8081
[Game] Current game mode is Teams
>TypeError: Cannot read property 'playerTracker' of undefined
    at GameServer.mainLoop (/home/ubuntu/workspace/src/GameServer.js:417:52)
    at wrapper [as _onTimeout] (timers.js:275:11)
    at Timer.listOnTimeout (timers.js:92:15)
lukerayman commented 8 years ago

It can be fixed by adding check for clients[0]:

if (clients[0]) {
    this.largestClient = clients[0].playerTracker;
}
m-byte918 commented 8 years ago

make a pr