chore: naming

This commit is contained in:
cha0s 2019-04-22 14:17:45 -05:00
parent e1dda3a016
commit 45e7eda6c4

View File

@ -4,7 +4,7 @@ import {Server} from '@avocado/server/socket';
import '../register-traits';
// Start game server.
import Game from './game';
const avocadoServer = new Server();
const socketServer = new Server();
let game;
let httpServer;
@ -14,14 +14,14 @@ function createGame() {
// Listen for connections.
httpServer = http.createServer();
httpServer.listen(8420, '0.0.0.0');
avocadoServer.on('connect', game.acceptConnection, game);
avocadoServer.open(httpServer);
socketServer.on('connect', game.acceptConnection, game);
socketServer.open(httpServer);
}
function destroyGame(fn) {
// Stop listening.
avocadoServer.off('connect', game.acceptConnection);
avocadoServer.close(() => {
socketServer.off('connect', game.acceptConnection);
socketServer.close(() => {
httpServer.close(() => {
game.destroy(fn);
})