300
This commit is contained in:
parent
b238bf01a7
commit
cef4f56aaa
|
@ -2,7 +2,6 @@
|
||||||
game.import('character',function(lib,game,ui,get,ai,_status){
|
game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
return {
|
return {
|
||||||
name:'mtg',
|
name:'mtg',
|
||||||
connect:true,
|
|
||||||
character:{
|
character:{
|
||||||
mtg_jiding:['male','qun',4,['mbaizhan','msilian']],
|
mtg_jiding:['male','qun',4,['mbaizhan','msilian']],
|
||||||
// mtg_qianzhuo:['female','shu',3,[]],
|
// mtg_qianzhuo:['female','shu',3,[]],
|
||||||
|
|
36
game/game.js
36
game/game.js
|
@ -20569,8 +20569,7 @@
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
localStorage.setItem(lib.configprefix+'directstart',true);
|
localStorage.setItem(lib.configprefix+'directstart',true);
|
||||||
game.saveConfig('tmp_user_roomId');
|
game.reload();
|
||||||
setTimeout(game.reload,100);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -21475,7 +21474,7 @@
|
||||||
if(lib.node.banned.contains(banned_info)){
|
if(lib.node.banned.contains(banned_info)){
|
||||||
this.send('denied','banned');
|
this.send('denied','banned');
|
||||||
}
|
}
|
||||||
else if(config.id&&lib.playerOL&&lib.playerOL[config.id]&&lib.playerOL[config.id].isOffline()){
|
else if(config.id&&lib.playerOL&&lib.playerOL[config.id]){
|
||||||
var player=lib.playerOL[config.id];
|
var player=lib.playerOL[config.id];
|
||||||
player.setNickname();
|
player.setNickname();
|
||||||
player.ws=this;
|
player.ws=this;
|
||||||
|
@ -21676,7 +21675,9 @@
|
||||||
avatar:lib.config.connect_avatar,
|
avatar:lib.config.connect_avatar,
|
||||||
nickname:lib.config.connect_nickname
|
nickname:lib.config.connect_nickname
|
||||||
},lib.config.banned_info);
|
},lib.config.banned_info);
|
||||||
ui.create.connecting(true);
|
if(ui.connecting&&!ui.connecting.splashtimeout){
|
||||||
|
ui.connecting.firstChild.innerHTML='重连成功';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onconnection:function(id){
|
onconnection:function(id){
|
||||||
var ws={wsid:id};
|
var ws={wsid:id};
|
||||||
|
@ -21696,6 +21697,17 @@
|
||||||
lib.wsOL[id].onclose();
|
lib.wsOL[id].onclose();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
selfclose:function(){
|
||||||
|
if(game.online||game.onlineroom){
|
||||||
|
if((game.servermode||game.onlinehall)&&_status.over){
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
game.saveConfig('tmp_user_roomId');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
game.ws.close();
|
||||||
|
},
|
||||||
reloadroom:function(forced){
|
reloadroom:function(forced){
|
||||||
if(window.isNonameServer&&(forced||!_status.protectingroom)){
|
if(window.isNonameServer&&(forced||!_status.protectingroom)){
|
||||||
game.reload();
|
game.reload();
|
||||||
|
@ -21792,14 +21804,14 @@
|
||||||
},true);
|
},true);
|
||||||
|
|
||||||
if(typeof lib.config.tmp_owner_roomId=='number'){
|
if(typeof lib.config.tmp_owner_roomId=='number'){
|
||||||
if(!game.roomId&&ui.rooms[lib.config.tmp_owner_roomId].roomempty){
|
if(typeof game.roomId!='number'&&ui.rooms[lib.config.tmp_owner_roomId].roomempty){
|
||||||
lib.configOL.mode=lib.config.connect_mode;
|
lib.configOL.mode=lib.config.connect_mode;
|
||||||
game.roomId=lib.config.tmp_owner_roomId;
|
game.roomId=lib.config.tmp_owner_roomId;
|
||||||
}
|
}
|
||||||
game.saveConfig('tmp_owner_roomId');
|
game.saveConfig('tmp_owner_roomId');
|
||||||
}
|
}
|
||||||
if(typeof lib.config.tmp_user_roomId=='number'){
|
if(typeof lib.config.tmp_user_roomId=='number'){
|
||||||
if(!game.roomId){
|
if(typeof game.roomId!='number'){
|
||||||
if(!ui.rooms[lib.config.tmp_user_roomId].roomempty){
|
if(!ui.rooms[lib.config.tmp_user_roomId].roomempty){
|
||||||
game.roomId=lib.config.tmp_user_roomId;
|
game.roomId=lib.config.tmp_user_roomId;
|
||||||
}
|
}
|
||||||
|
@ -22000,6 +22012,7 @@
|
||||||
game.createEvent('game',false).setContent(lib.init.startOnline);
|
game.createEvent('game',false).setContent(lib.init.startOnline);
|
||||||
game.loop();
|
game.loop();
|
||||||
game.send('inited');
|
game.send('inited');
|
||||||
|
ui.create.connecting(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(_status.event.parent){
|
if(_status.event.parent){
|
||||||
|
@ -22250,6 +22263,7 @@
|
||||||
ui.create.exit();
|
ui.create.exit();
|
||||||
}
|
}
|
||||||
ui.updatehl();
|
ui.updatehl();
|
||||||
|
ui.create.connecting(true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
exec:function(func){
|
exec:function(func){
|
||||||
|
@ -29290,6 +29304,16 @@
|
||||||
ui.connecting=ui.create.div('.fullsize.connectlayer');
|
ui.connecting=ui.create.div('.fullsize.connectlayer');
|
||||||
document.body.appendChild(ui.connecting);
|
document.body.appendChild(ui.connecting);
|
||||||
ui.create.div('','正在重连...',ui.connecting);
|
ui.create.div('','正在重连...',ui.connecting);
|
||||||
|
ui.connecting.splashtimeout=setTimeout(function(){
|
||||||
|
if(ui.connecting){
|
||||||
|
delete ui.connecting.splashtimeout;
|
||||||
|
}
|
||||||
|
},300);
|
||||||
|
// setTimeout(function(){
|
||||||
|
// if(ui.connecting){
|
||||||
|
// ui.connecting.firstChild.show();
|
||||||
|
// }
|
||||||
|
// },1000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
roomInfo:function(){
|
roomInfo:function(){
|
||||||
|
|
|
@ -307,8 +307,9 @@
|
||||||
rooms[i].servermode=false;
|
rooms[i].servermode=false;
|
||||||
for(var j in clients){
|
for(var j in clients){
|
||||||
if(clients[j].room==rooms[i]&&clients[j]!=this){
|
if(clients[j].room==rooms[i]&&clients[j]!=this){
|
||||||
clients[j].close();
|
clients[j].sendl('selfclose');
|
||||||
delete clients[j];
|
// clients[j].close();
|
||||||
|
// delete clients[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ table {
|
||||||
transition-property: opacity;
|
transition-property: opacity;
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
}
|
}
|
||||||
#window.connecting{
|
#window.connecting>*:not(#system){
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
.fullsize.connectlayer{
|
.fullsize.connectlayer{
|
||||||
|
@ -58,6 +58,7 @@ table {
|
||||||
text-shadow: black 0 0 2px;
|
text-shadow: black 0 0 2px;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-family: 'xinwei';
|
font-family: 'xinwei';
|
||||||
|
transition: all 0.5s;
|
||||||
}
|
}
|
||||||
#window.server>div:not(.serverinfo){
|
#window.server>div:not(.serverinfo){
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
|
Loading…
Reference in New Issue