1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-20 11:26:54 +00:00
This commit is contained in:
exane 2015-07-05 12:27:19 +02:00
parent 91cd34638f
commit 382e7f5c32

View File

@ -17,6 +17,9 @@ global.io = require("socket.io")(app);
app.listen(16918); app.listen(16918);
var admin = io.of("/admin");
io.on("connection", function(socket) { //global connection io.on("connection", function(socket) { //global connection
var user; var user;
connections.add(user = User(socket)); connections.add(user = User(socket));
@ -32,4 +35,13 @@ io.on("connection", function(socket) { //global connection
io.emit("update:playerOnline", connections.length()); io.emit("update:playerOnline", connections.length());
})
admin.on("connection", function(socket) {
socket.on("sendMessage", function(msg) {
console.log("admin send msg: " + msg);
io.emit("notification", {
message: msg
})
})
}) })