mirror of
https://github.com/exane/not-gwent-online
synced 2024-11-20 11:26:54 +00:00
test
This commit is contained in:
parent
91cd34638f
commit
382e7f5c32
@ -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
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
Loading…
Reference in New Issue
Block a user