mirror of
https://github.com/exane/not-gwent-online
synced 2025-07-21 04:13:28 +00:00
test
This commit is contained in:
@@ -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
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
Reference in New Issue
Block a user