renameServer changes

* Update doc error, regenerate docs
* Update a bad error message in renamePurchasedServer@serverPurchases.ts
* restore true/false return (removed in #450 due to miscommunication)
This commit is contained in:
omuretsu
2023-03-28 16:10:24 -04:00
parent eb8bcd00e3
commit 798da75d83
4 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ export const upgradePurchasedServer = (hostname: string, ram: number): void => {
export const renamePurchasedServer = (hostname: string, newName: string): void => {
const server = GetServer(hostname);
if (!server) throw new Error(`Server '${newName}' doesn't exists.`);
if (!server) throw new Error(`Server '${hostname}' doesn't exists.`);
if (GetServer(newName)) throw new Error(`Server '${newName}' already exists.`);
if (!Player.purchasedServers.includes(hostname)) throw new Error(`Server '${hostname}' is not a player server.`);
const replace = (arr: string[], old: string, next: string): string[] => {