diff --git a/CHANGELOG.md b/CHANGELOG.md index ef19d9aa..31bb9b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,13 +8,25 @@ Whenever you update your Get5 plugin, remember to **always** update the `transla Please see the [installation instructions](https://splewis.github.io/get5/latest/installation/#installation) for details. +# 0.14.6 + +#### 2023-04-29 + +Bugfix and minor adjustments. + +1. Fix missing acknowledgement of the `--side_type` argument for `get5_creatematch`. +2. Rename helper function `SideTypeFromString` to `SideChoiceFromString`. +3. Add [`get5_demo_upload_use_put`](https://splewis.github.io/get5/latest/configuration/get5_demo_upload_use_put) + and [`get5_demo_upload_timeout`](https://splewis.github.io/get5/latest/configuration/get5_demo_upload_timeout) to + improve flexibility of demo uploads. + # 0.14.5 #### 2023-04-25 Bugfix. -1. Prevent the presence of coaches in teams from messing up the stats in JSON events. +1. Prevent the presence of coaches in teams from messing up the stats in JSON events. # 0.14.4 @@ -39,7 +51,8 @@ Minor bugfix. Hotfix of stuff that should have been in 0.14.0. 1. Fixed "create match with current teams" from the `!get5` menu. -2. Add option to disable formatting known map names via [`get5_format_map_names`](https://splewis.github.io/get5/latest/configuration/#get5_format_map_names). +2. Add option to disable formatting known map names + via [`get5_format_map_names`](https://splewis.github.io/get5/latest/configuration/#get5_format_map_names). # 0.14.0 diff --git a/documentation/docs/configuration.md b/documentation/docs/configuration.md index 677c8805..4ab88ea7 100644 --- a/documentation/docs/configuration.md +++ b/documentation/docs/configuration.md @@ -642,6 +642,12 @@ to `csgo/cfg`.
**`Default: "get5/cvars.json"`** once a recording stops. If no protocol is provided, `http://` will be prepended to this value. Requires the [SteamWorks](../installation#steamworks) extension.
**`Default: ""`** +####`get5_demo_upload_use_put` +: If enabled, the demo upload HTTP request will use `PUT` instead of `POST`.
**`Default: 0`** + +####`get5_demo_upload_timeout` +: The HTTP timeout of the demo upload request, in seconds.
**`Default: 180`** + ####`get5_demo_upload_header_key` : If this **and** [`get5_demo_upload_header_value`](#get5_demo_upload_header_value) are defined, this header name and value will be used for your [demo upload HTTP request](#get5_demo_upload_url).
**`Default: "Authorization"`** diff --git a/documentation/docs/veto.md b/documentation/docs/veto.md index 2dccef6c..df58d46f 100644 --- a/documentation/docs/veto.md +++ b/documentation/docs/veto.md @@ -11,7 +11,7 @@ away-team when in [scrim mode](../getting_started#scrims). Except for the team c can [only talk in **team chat**](../configuration#get5_mute_allchat_during_map_selection) during map selection. This is to reduce clutter, as a lot of text is already printed during this phase. -## Options {: #options } +## Side Selection {: #side-selection } When a team picks a map, the other team gets to choose the side to start on for that map. If a map is selected by default by being the last map standing, a knife round is used. This behavior is determined by diff --git a/scripting/get5.sp b/scripting/get5.sp index 2994266d..a976856b 100644 --- a/scripting/get5.sp +++ b/scripting/get5.sp @@ -119,6 +119,8 @@ ConVar g_SurrenderCooldownCvar; ConVar g_ForfeitEnabledCvar; ConVar g_ForfeitCountdownTimeCvar; ConVar g_DemoUploadURLCvar; +ConVar g_DemoUploadUsePUTCvar; +ConVar g_DemoUploadTimeoutCvar; ConVar g_DemoUploadHeaderKeyCvar; ConVar g_DemoUploadHeaderValueCvar; ConVar g_DemoUploadDeleteAfterCvar; @@ -435,6 +437,8 @@ public void OnPluginStart() { g_DemoUploadHeaderKeyCvar = CreateConVar("get5_demo_upload_header_key", "Authorization", "If defined, a custom HTTP header with this name is added to the demo upload HTTP request.", FCVAR_DONTRECORD); g_DemoUploadHeaderValueCvar = CreateConVar("get5_demo_upload_header_value", "", "If defined, the value of the custom header added to the demo upload HTTP request.", FCVAR_DONTRECORD | FCVAR_PROTECTED); g_DemoUploadURLCvar = CreateConVar("get5_demo_upload_url", "", "If defined, recorded demos will be uploaded to this URL over HTTP. If no protocol is provided, 'http://' is prepended to this value.", FCVAR_DONTRECORD); + g_DemoUploadUsePUTCvar = CreateConVar("get5_demo_upload_use_put", "0", "If enabled, the demo upload HTTP request will use PUT instead of POST.", FCVAR_DONTRECORD); + g_DemoUploadTimeoutCvar = CreateConVar("get5_demo_upload_timeout", "180", "The timeout of the demo upload HTTP request, in seconds.", FCVAR_DONTRECORD); // Surrender/Forfeit g_ForfeitCountdownTimeCvar = CreateConVar("get5_forfeit_countdown", "180", "The grace-period (in seconds) for rejoining the server to avoid a loss by forfeit.", 0, true, 30.0); diff --git a/scripting/get5/matchconfig.sp b/scripting/get5/matchconfig.sp index 5f2050b6..81cafc4c 100644 --- a/scripting/get5/matchconfig.sp +++ b/scripting/get5/matchconfig.sp @@ -752,7 +752,7 @@ static bool LoadMatchFromJson(const JSON_Object json, char[] error) { for (int i = 0; i < array.Length; i++) { char buffer[64]; array.GetString(i, buffer, sizeof(buffer)); - SideChoice sideChoice = SideTypeFromString(buffer, error); + SideChoice sideChoice = SideChoiceFromString(buffer, error); if (sideChoice == SideChoice_Invalid) { return false; } @@ -948,7 +948,7 @@ static bool LoadMatchFromKeyValue(KeyValues kv, char[] error) { do { char buffer[64]; kv.GetSectionName(buffer, sizeof(buffer)); - SideChoice sideChoice = SideTypeFromString(buffer, error); + SideChoice sideChoice = SideChoiceFromString(buffer, error); if (sideChoice == SideChoice_Invalid) { return false; } @@ -1714,7 +1714,7 @@ Action Command_CreateMatch(int client, int args) { } sidesCount = ExplodeString(value, ",", mapSides, 16, PLATFORM_MAX_PATH, true); for (int mi = 0; mi < sidesCount; mi++) { - if (SideTypeFromString(mapSides[mi], error) == SideChoice_Invalid) { + if (SideChoiceFromString(mapSides[mi], error) == SideChoice_Invalid) { ReplyToCommand(client, "'%s' error: %s", parameter, error); return Plugin_Handled; } @@ -1883,6 +1883,7 @@ Action Command_CreateMatch(int client, int args) { matchConfig.SetString("match_title", matchTitle); } matchConfig.SetString("veto_first", vetoFirst); + matchConfig.SetString("side_type", sideType); matchConfig.SetBool("clinch_series", clinchSeries); matchConfig.SetBool("coaches_must_ready", coachesMustReady); matchConfig.SetBool("wingman", wingman); diff --git a/scripting/get5/recording.sp b/scripting/get5/recording.sp index 84791f3e..4724bd18 100644 --- a/scripting/get5/recording.sp +++ b/scripting/get5/recording.sp @@ -150,7 +150,8 @@ static void UploadDemoToServer(const char[] demoFilePath, const char[] demoFileN } char error[PLATFORM_MAX_PATH]; - Handle demoRequest = CreateGet5HTTPRequest(k_EHTTPMethodPOST, demoUrl, error); + EHTTPMethod method = g_DemoUploadUsePUTCvar.BoolValue ? k_EHTTPMethodPUT : k_EHTTPMethodPOST; + Handle demoRequest = CreateGet5HTTPRequest(method, demoUrl, error); if (demoRequest == INVALID_HANDLE || !AddFileAsHttpBody(demoRequest, demoFilePath, error) || !SetFileNameHeader(demoRequest, demoFileName, error) || !SetMatchIdHeader(demoRequest, matchId, error) || !SetMapNumberHeader(demoRequest, mapNumber, error)) { @@ -173,7 +174,11 @@ static void UploadDemoToServer(const char[] demoFilePath, const char[] demoFileN DataPack pack = GetDemoInfoDataPack(matchId, mapNumber, demoFilePath, demoFileName, demoUrl, demoHeaderKey, demoHeaderValue, deleteAfterUpload); - SteamWorks_SetHTTPRequestNetworkActivityTimeout(demoRequest, 180); + int timeout = g_DemoUploadTimeoutCvar.IntValue; + if (timeout < 0) { + timeout = 0; + } + SteamWorks_SetHTTPRequestNetworkActivityTimeout(demoRequest, timeout); SteamWorks_SetHTTPRequestContextValue(demoRequest, pack); SteamWorks_SetHTTPCallbacks(demoRequest, DemoRequest_Callback); SteamWorks_SendHTTPRequest(demoRequest); diff --git a/scripting/get5/util.sp b/scripting/get5/util.sp index 20052cd6..8238d03a 100644 --- a/scripting/get5/util.sp +++ b/scripting/get5/util.sp @@ -647,7 +647,7 @@ stock bool HelpfulAttack(int attacker, int victim) { return attacker != victim && GetClientTeam(attacker) != GetClientTeam(victim); } -stock SideChoice SideTypeFromString(const char[] input, char[] error) { +stock SideChoice SideChoiceFromString(const char[] input, char[] error) { if (StrEqual(input, "team1_ct", false) || StrEqual(input, "team2_t", false)) { return SideChoice_Team1CT; } else if (StrEqual(input, "team1_t", false) || StrEqual(input, "team2_ct", false)) { diff --git a/scripting/get5/version.sp b/scripting/get5/version.sp index 55af4645..01780936 100644 --- a/scripting/get5/version.sp +++ b/scripting/get5/version.sp @@ -1,4 +1,4 @@ -#define PLUGIN_VERSION "0.14.5-dev" +#define PLUGIN_VERSION "0.14.6-dev" // This MUST be the latest version in x.y.z semver format followed by -dev. // If this is not consistently applied, the update-checker might malfunction. // In official releases, the CI flow will remove the -dev suffix when compiling the plugin.