fix: refresh HTTP server
This commit is contained in:
parent
1503cbb129
commit
6c00da70f9
|
@ -2,19 +2,20 @@ import http from 'http';
|
|||
import {Server} from '@avocado/server/socket';
|
||||
// Import directly for HMR hierarchy.
|
||||
import '../register-traits';
|
||||
const httpServer = http.createServer();
|
||||
// Start game server.
|
||||
import Game from './game';
|
||||
const avocadoServer = new Server(httpServer);
|
||||
const avocadoServer = new Server();
|
||||
|
||||
let game;
|
||||
let httpServer;
|
||||
|
||||
function createGame() {
|
||||
game = new Game();
|
||||
// Listen for connections.
|
||||
httpServer = http.createServer();
|
||||
httpServer.listen(8420, '0.0.0.0');
|
||||
avocadoServer.on('connect', game.acceptConnection, game);
|
||||
avocadoServer.open();
|
||||
avocadoServer.open(httpServer);
|
||||
}
|
||||
|
||||
function destroyGame(fn) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user