Skip to content

Commit

Permalink
Merge pull request #1024 from splewis/development
Browse files Browse the repository at this point in the history
0.14.6
  • Loading branch information
nickdnk authored Apr 30, 2023
2 parents 39617da + 26cc47e commit 3c31c86
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 10 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 6 additions & 0 deletions documentation/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,12 @@ to `csgo/cfg`.<br>**`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.<br>**`Default: ""`**

####`get5_demo_upload_use_put`
: If enabled, the demo upload HTTP request will use `PUT` instead of `POST`.<br>**`Default: 0`**

####`get5_demo_upload_timeout`
: The HTTP timeout of the demo upload request, in seconds.<br>**`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).<br>**`Default: "Authorization"`**
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/veto.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions scripting/get5.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions scripting/get5/matchconfig.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 7 additions & 2 deletions scripting/get5/recording.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion scripting/get5/util.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion scripting/get5/version.sp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 3c31c86

Please sign in to comment.