Use public endpoint for game bank requests (Refs #13)
This commit is contained in:
@@ -48,7 +48,12 @@ The optional `tws_t6_bank.gsc` adds `.b`, `.d <amount|all>` and
|
||||
`.w <amount|all>` and registers them in help. It requires common and telemetry
|
||||
`1.0.0` or newer, the TWS t6 plugin `1.1.0`, Electric Cherry's bank API and
|
||||
a private per-server credential. Follow [bank setup and recovery](../../README.md#player-bank-t5-and-t6),
|
||||
including a full process restart for the plugin and a map restart for scripts.
|
||||
including a full process restart for the plugin. Bank `2.0.0` uses only
|
||||
`https://ec.thewrightserver.net/api/bank` and ignores `tws_bank_url`.
|
||||
Update EC agents to `1.9.1+` first. If the old endpoint differs, follow the
|
||||
[endpoint upgrade procedure](../../README.md#upgrading-the-bank-endpoint):
|
||||
an EC rebuild must settle legacy journals before the new scripts start.
|
||||
When the endpoint already matches, only a map restart is required.
|
||||
|
||||
## Persistent Discord text
|
||||
|
||||
|
||||
@@ -10,17 +10,15 @@ init()
|
||||
{
|
||||
if (GetDvar("tws_bank_enabled") == "0")
|
||||
return;
|
||||
level.bank_url = GetDvar("tws_bank_url");
|
||||
if (level.bank_url == "")
|
||||
level.bank_url = "https://ec.thewrightserver.net/api/bank";
|
||||
// Game containers use the public API, independent of the host controller URL.
|
||||
level.bank_url = "https://ec.thewrightserver.net/api/bank";
|
||||
level.bank_server = GetDvar("tws_server_id");
|
||||
level.bank_token = GetDvar("tws_bank_token");
|
||||
// A private per-server cfg supplies this; never embed bank credentials.
|
||||
if (level.bank_server == "" || level.bank_token.size < 40 ||
|
||||
getSubStr(level.bank_token, 0, 8) != "ec_bank_" ||
|
||||
getSubStr(level.bank_url, 0, 8) != "https://")
|
||||
getSubStr(level.bank_token, 0, 8) != "ec_bank_")
|
||||
{
|
||||
println("^1[tws_bank] Disabled: configure HTTPS, tws_server_id and a private tws_bank_token");
|
||||
println("^1[tws_bank] Disabled: configure tws_server_id and a private tws_bank_token");
|
||||
return;
|
||||
}
|
||||
level.bank_queue = bankLoad(level.bank_server, level.bank_url);
|
||||
|
||||
Reference in New Issue
Block a user