chore: naming
This commit is contained in:
parent
e1dda3a016
commit
45e7eda6c4
|
@ -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);
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user