This commit is contained in:
libccy 2016-04-26 10:34:31 +08:00
parent 8c47460ceb
commit 49d66436d1
2 changed files with 23 additions and 22 deletions

View File

@ -27,8 +27,9 @@
break;
}
}
if(window.location.href.indexOf('index.html?server')!=-1){
window.isNonameServer=true;
var index=window.location.href.indexOf('index.html?server=');
if(index!=-1){
window.isNonameServer=window.location.href.slice(index+18);
window.indexedDB=null;
}
}());
@ -12513,7 +12514,7 @@
},true);
if(window.isNonameServer){
var cfg='pagecfg'+lib.config.pageId;
var cfg='pagecfg'+window.isNonameServer;
if(lib.config[cfg]){
lib.configOL=lib.config[cfg][0];
game.send('server','server',lib.config[cfg].slice(1));
@ -16034,7 +16035,7 @@
}
if(window.isNonameServer){
lib.configOL.gameStarted=false;
game.saveConfig('pagecfg'+lib.config.pageId,[lib.configOL,game.roomId,_status.onlinenickname,_status.onlineavatar]);
game.saveConfig('pagecfg'+window.isNonameServer,[lib.configOL,game.roomId,_status.onlinenickname,_status.onlineavatar]);
game.reload();
}
},

View File

@ -1,38 +1,38 @@
var reload=function(){
if(!lib.node||!lib.node.clients||!lib.node.clients.length){
game.reload();
}
};
var page1 = require('webpage').create();
page1.settings.userAgent = 'SpecialAgent';
page1.open('http://localhost/index.html?server=true', function(status) {
page1.open('http://localhost/index.html?server=1', function(status) {
if(status !== 'success') {
console.log('Unable to access network');
}
else{
page.evaluate(function(){
game.saveConfig('pageId',1);
});
}
setInterval(function(){
page1.evaluate(reload);
},3600000);
});
var page2 = require('webpage').create();
page2.settings.userAgent = 'SpecialAgent';
page2.open('http://localhost/index.html?server=true', function(status) {
page2.open('http://localhost/index.html?server=2', function(status) {
if(status !== 'success') {
console.log('Unable to access network');
}
else{
page.evaluate(function(){
game.saveConfig('pageId',2);
});
}
setInterval(function(){
page2.evaluate(reload);
},3600000);
});
var page3 = require('webpage').create();
page3.settings.userAgent = 'SpecialAgent';
page3.open('http://localhost/index.html?server=true', function(status) {
page3.open('http://localhost/index.html?server=3', function(status) {
if(status !== 'success') {
console.log('Unable to access network');
}
else{
page.evaluate(function(){
game.saveConfig('pageId',3);
});
}
setInterval(function(){
page3.evaluate(reload);
},3600000);
});