Perform the server code check inside of the server listings population. No code, no show.

This commit is contained in:
TheFlash787 2020-08-13 00:20:05 +01:00
parent 407adcae14
commit a7577f60d5

View File

@ -267,6 +267,12 @@ function populateServerListings(){
const servers = distro.getServers()
let htmlString = ''
for(const serv of servers){
if(serv.getServerCode() != null && serv.getServerCode() === ''){
if(ConfigManager.getServerCode() !== serv.getServerCode()){
// skips any servers which the player hasn't got the code to access
continue
}
}
htmlString += `<button class="serverListing" servid="${serv.getID()}" ${serv.getID() === giaSel ? 'selected' : ''}>
<img class="serverListingImg" src="${serv.getIcon()}"/>
<div class="serverListingDetails">