Commit f660c13c by Alexander Bazo

Refactor

parent d01e10a6
......@@ -4,9 +4,9 @@ const cors = require("cors");
const colyseus = require("colyseus");
const monitor = require("@colyseus/monitor").monitor;
const socialRoutes = require("@colyseus/social/express").default;
const StarGazerRoom = require("./lib/rooms/StarGazerRoom");
const port = process.env.PORT || 2567;
const app = express()
const app = express();
const StarGazerRoom = require("./lib/rooms/StarGazerRoom");
app.use(cors());
app.use(express.json());
......@@ -14,16 +14,12 @@ app.use(express.json());
const server = http.createServer(app);
const gameServer = new colyseus.Server({
server: server,
express: app,
express: app
});
// register your room handlers
gameServer.define("star_gazer_lab", StarGazerRoom);
// register @colyseus/social routes
gameServer.define("star_gazer_lab", StarGazerRoom);
app.use("/", socialRoutes);
// register colyseus monitor AFTER registering your room handlers
app.use("/colyseus", monitor(gameServer));
gameServer.listen(port);
......
......@@ -33,7 +33,6 @@ class StarGazerRoom extends colyseus.Room {
}
update(deltaTime) {
console.log("in: update");
this.state.update(deltaTime);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment