diff --git a/game/game.js b/game/game.js index c021c80cb..7925c5620 100755 --- a/game/game.js +++ b/game/game.js @@ -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; } }()); @@ -11458,7 +11459,7 @@ if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) return true; if(lib.config.forbidai.contains(i)) return true; if(_status.connectMode){ - if(lib.config['connect_'+lib.config.mode+'_banned'].contains(i)) return true; + if(lib.configOL.banned.contains(i)) return true; var double_character=false; if(lib.configOL.mode=='guozhan'){ double_character=true; @@ -12228,7 +12229,12 @@ },true); if(window.isNonameServer){ - game.send('server','server'); + switch(window.isNonameServer){ + case 'identity':lib.configOL.mode='identity';game.send('server','enter','auto','服务器','xunyu');break; + case 'guozhan':lib.configOL.mode='guozhan';game.send('server','enter','auto','服务器','yuanshao');break; + case 'versus':lib.configOL.mode='versus';lib.config.mode_config.versus.connect_versus_mode='2v2';game.send('server','enter','auto','服务器','diaochan');break; + default:game.send('server','server'); + } } } if(_status.event.getParent()){ @@ -12243,13 +12249,14 @@ var list2=['re_caocao','liubei','sunquan','sp_zhangjiao','yuanshao','dongzhuo']; var more_room=false; for(var i=0;i=3){ + if(list[i]&&list[i]!='server'&&i>=3){ more_room=true; } ui.rooms[i].initRoom(list[i],list2[i]); } if(!more_room){ - if(list[0]&&list[1]&&list[2]){ + if(list[0]&&list[1]&&list[2]&& + list[0]!='server'&&list[1]!='server'&&list[2]!='server'){ more_room=true; } } @@ -15709,7 +15716,7 @@ game.addRecord(resultbool); } if(window.isNonameServer){ - setTimeout(game.reload,5000); + setTimeout(game.reload,7000); } }, loop:function(){ @@ -16472,6 +16479,7 @@ if(_status.connectMode&&lib.mode[name].connect){ game.saveConfig('connect_mode',name); game.clearConnect(); + lib.configOL.mode=name; if(configx){ for(var i in configx){ lib.configOL[i]=configx[i]; @@ -16482,24 +16490,21 @@ if(i=='update') continue; lib.configOL[i.slice(8)]=get.config(i); } + lib.configOL.characterPack=lib.connectCharacterPack.slice(0); + lib.configOL.cardPack=lib.connectCardPack.slice(0); + for(var i=0;i=0;i--){ + if(!rooms[i].owner){ + index=i;break; + } + } + } this.nickname=nickname; this.avatar=avatar; var room=rooms[index]; @@ -36,7 +45,7 @@ } }, server:function(){ - for(var i=0;i=0;i--){ if(!rooms[i].owner){ rooms[i].owner=this; rooms[i].servermode=true; @@ -112,7 +121,9 @@ } else if(rooms[i].owner&&rooms[i].config){ if(rooms[i]._num==0){ - rooms[i].owner.sendl('reloadroom'); + if(rooms[i].owner.servermode!='auto'||rooms[i].config.gameStarted){ + rooms[i].owner.sendl('reloadroom'); + } } roomlist[i]=[rooms[i].owner.nickname,rooms[i].owner.avatar, rooms[i].config,rooms[i]._num]; diff --git a/mode/identity.js b/mode/identity.js index 162c63697..37442e0ee 100755 --- a/mode/identity.js +++ b/mode/identity.js @@ -176,11 +176,17 @@ mode.identity={ } if(game.players.length==2){ game.showIdentity(true); - if(game.me.next.isOnline){ - game.me.next.send(function(identity){ - game.me.next.setIdentity(identity); - },game.me.identity); + var map={}; + for(var i in lib.playerOL){ + map[i]=lib.playerOL[i].identity; } + game.broadcast(function(map){ + for(var i in map){ + lib.playerOL[i].identity=map[i]; + lib.playerOL[i].setIdentity(); + lib.playerOL[i].ai.shown=1; + } + },map); } else{ for(var i=0;i