mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Merge branch 'dev' of https://github.com/danielyxie/netburner into dev
This commit is contained in:
commit
dbb4a93a78
@ -15,12 +15,13 @@ function Server(ip=createRandomIp(), hostname="", organizationName="",
|
||||
//Connection information
|
||||
this.ip = ip;
|
||||
var i = 0;
|
||||
while (GetServerByHostname(hostname) != null) {
|
||||
var suffix = "";
|
||||
while (GetServerByHostname(hostname+suffix) != null) {
|
||||
//Server already exists
|
||||
hostname = hostname + "-" + i;
|
||||
suffix = "-" + i;
|
||||
++i;
|
||||
}
|
||||
this.hostname = hostname;
|
||||
this.hostname = hostname + suffix;
|
||||
this.organizationName = organizationName;
|
||||
this.isConnectedTo = isConnectedTo; //Whether the player is connected to this server
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user