Optimize game.clearConnect.

(cherry picked from commit be730a05759441fe88d71994128abd1f40107f6f)
This commit is contained in:
Tipx-L 2023-08-24 08:26:13 -07:00
parent a88791608d
commit bd6e3f5dcc
1 changed files with 13 additions and 16 deletions

View File

@ -37810,7 +37810,7 @@
game.dead.length=0; game.dead.length=0;
game.me=null; game.me=null;
}, },
clearConnect:function(){ clearConnect:()=>{
if(ui.ipnode){ if(ui.ipnode){
ui.ipnode.remove(); ui.ipnode.remove();
delete ui.ipnode; delete ui.ipnode;
@ -37836,27 +37836,24 @@
delete ui.startServer; delete ui.startServer;
} }
if(ui.rooms){ if(ui.rooms){
for(var i=0;i<ui.rooms.length;i++){ ui.rooms.forEach(value=>value.remove());
ui.rooms[i].remove();
}
delete ui.rooms; delete ui.rooms;
} }
if(ui.roombase){ if(ui.roombase){
ui.roombase.remove(); ui.roombase.remove();
delete ui.roombase; delete ui.roombase;
} }
if(ui.connectEvents){ if(!ui.connectEvents) return;
ui.connectEvents.remove(); ui.connectEvents.remove();
ui.connectEventsCount.remove(); ui.connectEventsCount.remove();
ui.connectClients.remove(); ui.connectClients.remove();
ui.connectClientsCount.remove(); ui.connectClientsCount.remove();
ui.createRoomButton.remove(); ui.createRoomButton.remove();
delete ui.connectEvents; delete ui.connectEvents;
delete ui.connectEventsCount; delete ui.connectEventsCount;
delete ui.connectClients; delete ui.connectClients;
delete ui.connectClientsCount; delete ui.connectClientsCount;
delete ui.createRoomButton; delete ui.createRoomButton;
}
}, },
log:function(){ log:function(){
let str='',str2='',logvid=null; let str='',str2='',logvid=null;