mirror of
https://codeberg.org/demostf/plugin.git
synced 2026-06-04 00:54:08 +02:00
Fixed issues with handling responses
that don't link to the STV
This commit is contained in:
parent
1e2bb28b42
commit
8a529b2e9e
2 changed files with 17 additions and 13 deletions
BIN
demostf.smx
BIN
demostf.smx
Binary file not shown.
30
demostf.sp
30
demostf.sp
|
|
@ -7,7 +7,7 @@ public Plugin:myinfo =
|
||||||
name = "demos.tf uploader",
|
name = "demos.tf uploader",
|
||||||
author = "Icewind",
|
author = "Icewind",
|
||||||
description = "Auto-upload match stv to demos.tf",
|
description = "Auto-upload match stv to demos.tf",
|
||||||
version = "0.3",
|
version = "0.3.1",
|
||||||
url = "https://demos.tf"
|
url = "https://demos.tf"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -164,22 +164,26 @@ public ShowResponse()
|
||||||
|
|
||||||
strcopy(url, sizeof(url), output);
|
strcopy(url, sizeof(url), output);
|
||||||
|
|
||||||
// Get the url part
|
if (StrContains(url, "STV available at: ") != -1)
|
||||||
ReplaceString(url, sizeof(url), "STV available at: ", "");
|
|
||||||
// Split the string on '/'
|
|
||||||
ExplodeString(url, "/", url_parts, sizeof(url_parts), sizeof(url_parts[]));
|
|
||||||
|
|
||||||
// Find the last part of the url
|
|
||||||
for (int i = sizeof(url_parts) -1; i >= 0; i--)
|
|
||||||
{
|
{
|
||||||
if (!StrEqual(url_parts[i], "")){
|
// Get the url part
|
||||||
demoid = url_parts[i];
|
ReplaceString(url, sizeof(url), "STV available at: ", "");
|
||||||
break;
|
// Split the string on '/'
|
||||||
|
ExplodeString(url, "/", url_parts, sizeof(url_parts), sizeof(url_parts[]));
|
||||||
|
|
||||||
|
// Find the last part of the url
|
||||||
|
for (int i = sizeof(url_parts) -1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
if (!StrEqual(url_parts[i], "")){
|
||||||
|
demoid = url_parts[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
CallDemoUploaded(true, demoid, url);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CallDemoUploaded(true, demoid, url);
|
CallDemoUploaded(false, "", "");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue