cfg
This commit is contained in:
parent
6445b51f21
commit
317b74089f
39
game/game.js
39
game/game.js
|
@ -12100,6 +12100,21 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
changeNumConfig:function(num,index,bool){
|
||||
if(this.id==game.onlinezhu){
|
||||
lib.configOL.number=num;
|
||||
game.send('server','config',lib.configOL);
|
||||
if(game.connectPlayers&&game.connectPlayers[index]){
|
||||
if(bool){
|
||||
game.connectPlayers[index].classList.add('unselectable2');
|
||||
}
|
||||
else{
|
||||
game.connectPlayers[index].classList.remove('unselectable2');
|
||||
}
|
||||
game.updateWaiting();
|
||||
}
|
||||
}
|
||||
},
|
||||
chat:function(id,str){
|
||||
var player;
|
||||
if(lib.playerOL[id]){
|
||||
|
@ -12246,17 +12261,17 @@
|
|||
},
|
||||
updaterooms:function(list){
|
||||
if(ui.rooms){
|
||||
ui.window.classList.add('more_room');
|
||||
var list2=['re_caocao','liubei','sunquan','sp_zhangjiao','yuanshao','dongzhuo'];
|
||||
var more_room=false;
|
||||
for(var i=0;i<ui.rooms.length;i++){
|
||||
if(list[i]&&list[i]!='server'&&i>=3){
|
||||
if(list[i]&&i>=3){
|
||||
more_room=true;
|
||||
}
|
||||
ui.rooms[i].initRoom(list[i],list2[i]);
|
||||
}
|
||||
if(!more_room){
|
||||
if(list[0]&&list[1]&&list[2]&&
|
||||
list[0]!='server'&&list[1]!='server'&&list[2]!='server'){
|
||||
if(list[0]&&list[1]&&list[2]){
|
||||
more_room=true;
|
||||
}
|
||||
}
|
||||
|
@ -23950,6 +23965,23 @@
|
|||
if(ui.intro) return;
|
||||
if(this.classList.contains('connect')){
|
||||
if(game.online){
|
||||
if(game.onlinezhu){
|
||||
if(!this.playerid&&game.connectPlayers){
|
||||
if(lib.configOL.mode=='versus') return;
|
||||
if(lib.configOL.mode=='identity'&&lib.configOL.identity_mode=='zhong') return;
|
||||
if(!this.classList.contains('unselectable2')&&lib.configOL.number<=2) return;
|
||||
this.classList.toggle('unselectable2')
|
||||
if(this.classList.contains('unselectable2')){
|
||||
lib.configOL.number--;
|
||||
}
|
||||
else{
|
||||
lib.configOL.number++;
|
||||
}
|
||||
game.send('changeNumConfig',lib.configOL.number,
|
||||
game.connectPlayers.indexOf(this),this.classList.contains('unselectable2'));
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(this.roomfull){
|
||||
alert('房间已满');
|
||||
}
|
||||
|
@ -23969,6 +24001,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(this.playerid){
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
var page1 = require('webpage').create();
|
||||
page1.settings.userAgent = 'SpecialAgent';
|
||||
page1.open('http://localhost/index.html?server=true', function(status) {
|
||||
if(status !== 'success') {
|
||||
console.log('Unable to access network');
|
||||
}
|
||||
});
|
||||
|
||||
var page2 = require('webpage').create();
|
||||
page2.settings.userAgent = 'SpecialAgent';
|
||||
page2.open('http://localhost/index.html?server=true', function(status) {
|
||||
if(status !== 'success') {
|
||||
console.log('Unable to access network');
|
||||
}
|
||||
});
|
||||
|
||||
var page3 = require('webpage').create();
|
||||
page3.settings.userAgent = 'SpecialAgent';
|
||||
page3.open('http://localhost/index.html?server=true', function(status) {
|
||||
if(status !== 'success') {
|
||||
console.log('Unable to access network');
|
||||
}
|
||||
});
|
|
@ -9,7 +9,7 @@
|
|||
if(index=='auto'){
|
||||
index=0;
|
||||
this.servermode='auto';
|
||||
for(var i=rooms.length-1;i>=0;i--){
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(!rooms[i].owner){
|
||||
index=i;break;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@
|
|||
}
|
||||
},
|
||||
server:function(){
|
||||
for(var i=rooms.length-1;i>=0;i--){
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(!rooms[i].owner){
|
||||
rooms[i].owner=this;
|
||||
rooms[i].servermode=true;
|
||||
|
|
|
@ -35,6 +35,7 @@ window.noname_source_list=[
|
|||
'game/http.js',
|
||||
'game/jszip.js',
|
||||
'game/package.js',
|
||||
'game/phantom.js',
|
||||
'game/server.js',
|
||||
'game/source.js',
|
||||
'game/update.js',
|
||||
|
|
Loading…
Reference in New Issue