Fix hostname generation being weird about dash 0 added

This commit is contained in:
Olivier Gagnon
2022-09-23 12:04:21 -04:00
parent 66e80b2efa
commit fb197be206
10 changed files with 190 additions and 87 deletions
+3 -1
View File
@@ -23,7 +23,9 @@ export function safetlyCreateUniqueServer(params: IConstructorParams): Server {
}
if (GetServer(hostname) != null) {
hostname = `${hostname}-0`;
if (hostname.slice(-2) != `-0`) {
hostname = `${hostname}-0`;
}
// Use a for loop to ensure that we don't get suck in an infinite loop somehow
for (let i = 0; i < 200; ++i) {