mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Added a way of ensuring correct versions between server and client
This commit is contained in:
@@ -67,6 +67,7 @@ app.use(bodyParser.urlencoded({ // to support URL-encoded bodies
|
||||
}));
|
||||
app.use(cookieParser());
|
||||
|
||||
var VERSION = 2;
|
||||
var io = require('socket.io')(server, {'pingTimeout': 25000}); //, "origins": ("https://zoff.me:443*,https://zoff.me:8080*,zoff.me:8080*,https://remote.zoff.me:443*,https://remote.zoff.me:8080*,https://fb.zoff.me:443*,https://fb.zoff.me:8080*,https://admin.zoff.me:443*,https://admin.zoff.me:8080*" + add)});
|
||||
var request = require('request');
|
||||
var mongojs = require('mongojs');
|
||||
@@ -356,9 +357,13 @@ io.on('connection', function(socket){
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('frontpage_lists', function()
|
||||
socket.on('frontpage_lists', function(msg)
|
||||
{
|
||||
|
||||
if(msg.version != VERSION || msg.version == undefined) {
|
||||
socket.emit("update_required");
|
||||
}
|
||||
|
||||
var playlists_to_send = [];
|
||||
var i = 0;
|
||||
var viewers;
|
||||
@@ -418,6 +423,10 @@ io.on('connection', function(socket){
|
||||
if(typeof(msg) === 'object' && msg !== undefined && msg !== null && msg.hasOwnProperty("channel") && msg.hasOwnProperty('pass'))
|
||||
{
|
||||
|
||||
if(msg.version != VERSION || msg.version == undefined) {
|
||||
socket.emit("update_required");
|
||||
}
|
||||
|
||||
try {
|
||||
var list = msg.channel;
|
||||
if(list.length == 0) return;
|
||||
|
||||
Reference in New Issue
Block a user