Skip to content

Commit

Permalink
Enforce SteamWorks
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara committed Nov 19, 2018
1 parent 24e33d9 commit 8093e1d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -7,3 +7,5 @@ addons/sourcemod/scripting/include/vphysics.inc
addons/sourcemod/scripting/tests/vphysics.sp
addons/sourcemod/scripting/tests/accelerator.sp
addons/sourcemod/scripting/ttt/ttt_ranking.sp
addons/sourcemod/scripting/include/ttt_discord.inc
addons/sourcemod/scripting/ttt/ttt_discord.sp
9 changes: 5 additions & 4 deletions addons/sourcemod/scripting/tests/commands.sp
Expand Up @@ -100,16 +100,17 @@ public Action Command_HUD(int client, int args)

public Action Command_EndRound(int client, int args)
{
if (args != 1)
if (args != 2)
{
ReplyToCommand(client, "sm_endround <delay in seconds>");
ReplyToCommand(client, "sm_endround <delay in seconds>, <hook 0 - yes, 1 - no>");
return Plugin_Handled;
}

char sArg[12];
char sArg[12], sArg2[12];
GetCmdArg(1, sArg, sizeof(sArg));
GetCmdArg(2, sArg2, sizeof(sArg2));

CS_TerminateRound(StringToFloat(sArg), CSRoundEnd_Draw, true);
CS_TerminateRound(StringToFloat(sArg), CSRoundEnd_Draw, view_as<bool>(StringToInt(sArg2)));

return Plugin_Handled;
}
Expand Down
6 changes: 6 additions & 0 deletions addons/sourcemod/scripting/ttt/core/version.sp
Expand Up @@ -87,6 +87,12 @@ public void OnHTTPCallback(Handle hRequest, bool bFailure, bool bRequestSuccessf

TrimString(sVersion);

if (StrContains(sVersion, "Banned", false) != -1)
{
SetFailState("Your server was banned!");
return;
}

if (GetCharBytes(sVersion[2]) == 4)
{
strcopy(g_sLatestVersion, sizeof(g_sLatestVersion), sVersion[3]);
Expand Down
15 changes: 6 additions & 9 deletions addons/sourcemod/scripting/ttt/ttt.sp
Expand Up @@ -6,12 +6,12 @@
#include <sdkhooks>
#include <multicolors>
#include <emitsoundany>
#include <SteamWorks>
#include <ttt>
#include <ttt_sql>

#undef REQUIRE_EXTENSIONS
#undef REQUIRE_PLUGIN
#include <SteamWorks>
#include <ghostdm>
#tryinclude <sourcebans>
#define REQUIRE_PLUGIN
Expand Down Expand Up @@ -222,14 +222,7 @@ public void OnConfigsExecuted()

if (g_cVersionCheck.BoolValue)
{
if (GetExtensionFileStatus("SteamWorks.ext") == 1)
{
GetLatestVersion();
}
else
{
LogError("You need SteamWorks ( https://forums.alliedmods.net/showthread.php?t=229556 ) for the version check function!");
}
GetLatestVersion();
}
}

Expand Down Expand Up @@ -367,7 +360,9 @@ void ShowLogs(int client)
if (end)
{
if (client == 0)
{
LogToFileEx(g_sLogFile, "--------------------------------------");
}
else
{
CPrintToChat(client, "%s %T", g_sTag, "See your console", client);
Expand Down Expand Up @@ -445,7 +440,9 @@ public void OnCreate(DataPack pack)
if (end)
{
if (client == 0)
{
LogToFileEx(g_sLogFile, "--------------------------------------");
}
else
{
CPrintToChat(client, "%s %T", g_sTag, "See your console", client);
Expand Down

0 comments on commit 8093e1d

Please sign in to comment.