Permalink
Browse files

TTT_GetCommitsCount returns the ttt version

  • Loading branch information...
Bara committed Nov 29, 2018
1 parent fd92684 commit 184b7ece4e398c1b02e510d9bc995b9af676fa59
@@ -476,7 +476,7 @@ native void TTT_TerminateRound(float delay, CSRoundEndReason reason);
native bool TTT_GetLatestVersion(const char[] version, int length);
/**
* Returns latest git commit count.
* Returns current ttt version. -1 = custom version
*
*/
native int TTT_GetCommitsCount();
@@ -321,6 +321,5 @@ Handle g_hWeAreSync = null;
Handle g_hRemainingSync = null;
char g_sLatestVersion[64];
int g_iGit = -1;
RoundStatus g_iStatus = Round_Inactive;
@@ -608,7 +608,15 @@ public int Native_GetLatestVersion(Handle plugin, int numParams)
public int Native_GetCommitsCount(Handle plugin, int numParams)
{
return g_iGit;
char sSplit[2][12];
ExplodeString(TTT_PLUGIN_VERSION, ".", sSplit, sizeof(sSplit), sizeof(sSplit[]));
if (IsStringNumeric(sSplit[1]))
{
return StringToInt(sSplit[1]);
}
return -1;
}
public int Native_DisableRounds(Handle plugin, int numParams)
@@ -98,14 +98,6 @@ public void OnHTTPCallback(Handle hRequest, bool bFailure, bool bRequestSuccessf
strcopy(g_sLatestVersion, sizeof(g_sLatestVersion), sVersion[3]);
}
char sSplit[2][12];
ExplodeString(g_sLatestVersion, ".", sSplit, sizeof(sSplit), sizeof(sSplit[]));
if (IsStringNumeric(sSplit[1]))
{
g_iGit = StringToInt(sSplit[1]);
}
Call_StartForward(g_hOnVersionCheck);
Call_PushString(g_sLatestVersion);
Call_Finish();

0 comments on commit 184b7ec

Please sign in to comment.