|  |  | @ -192,70 +192,73 @@ public Action Command_PrintToAllChat(int args) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | public Action Timer_DataProcessor(Handle hThis) |  |  |  | public Action Timer_DataProcessor(Handle hThis) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (!g_bProcessingData) |  |  |  |     if (!g_bProcessingData) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return Plugin_Handled; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (g_iRatelimitRemaining == 0 && GetTime() < g_iRatelimitReset) |  |  |  |     if (g_iRatelimitRemaining == 0 && GetTime() < g_iRatelimitReset) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return Plugin_Handled; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	//PrintToServer("[Timer_DataProcessor] Array Length #1: %d", g_arrQueuedMessages.Length); |  |  |  |     //PrintToServer("[Timer_DataProcessor] Array Length #1: %d", g_arrQueuedMessages.Length); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	char sContent[1024]; |  |  |  |     char sContent[1024]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	g_arrQueuedMessages.GetString(0, sContent, sizeof(sContent)); |  |  |  |     g_arrQueuedMessages.GetString(0, sContent, sizeof(sContent)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	g_arrQueuedMessages.Erase(0); |  |  |  |     g_arrQueuedMessages.Erase(0); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	char sURL[128]; |  |  |  |     char sURL[128]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	g_arrQueuedMessages.GetString(0, sURL, sizeof(sURL)); |  |  |  |     g_arrQueuedMessages.GetString(0, sURL, sizeof(sURL)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	g_arrQueuedMessages.Erase(0); |  |  |  |     g_arrQueuedMessages.Erase(0); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (g_arrQueuedMessages.Length == 0) |  |  |  |     if (g_arrQueuedMessages.Length == 0) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		g_bProcessingData = false; |  |  |  |         g_bProcessingData = false; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	//PrintToServer("[Timer_DataProcessor] Array Length #2: %d", g_arrQueuedMessages.Length); |  |  |  |     //PrintToServer("[Timer_DataProcessor] Array Length #2: %d", g_arrQueuedMessages.Length); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	//PrintToServer("%s | %s", sURL, sContent); |  |  |  |     //PrintToServer("%s | %s", sURL, sContent); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodPOST, sURL); |  |  |  |     Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodPOST, sURL); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	JSONObject RequestJSON = view_as<JSONObject>(json_load(sContent)); |  |  |  |     JSONObject RequestJSON = view_as<JSONObject>(json_load(sContent)); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (!hRequest || |  |  |  |     if (!hRequest || | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		!SteamWorks_SetHTTPRequestContextValue(hRequest, RequestJSON) || |  |  |  |         !SteamWorks_SetHTTPRequestContextValue(hRequest, RequestJSON) || | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		!SteamWorks_SetHTTPCallbacks(hRequest, OnHTTPRequestCompleted) || |  |  |  |         !SteamWorks_SetHTTPCallbacks(hRequest, OnHTTPRequestCompleted) || | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		!SteamWorks_SetHTTPRequestRawPostBody(hRequest, "application/json", sContent, strlen(sContent)) || |  |  |  |         !SteamWorks_SetHTTPRequestRawPostBody(hRequest, "application/json", sContent, strlen(sContent)) || | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		!SteamWorks_SetHTTPRequestNetworkActivityTimeout(hRequest, 10) || |  |  |  |         !SteamWorks_SetHTTPRequestNetworkActivityTimeout(hRequest, 10) || | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		!SteamWorks_SendHTTPRequest(hRequest)) |  |  |  |         !SteamWorks_SendHTTPRequest(hRequest)) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  |     { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		LogError("Discord SteamWorks_CreateHTTPRequest failed."); |  |  |  |         LogError("Discord SteamWorks_CreateHTTPRequest failed."); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		delete RequestJSON; |  |  |  |         delete RequestJSON; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		delete hRequest; |  |  |  |         delete hRequest; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return Plugin_Handled; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  |     } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return Plugin_Handled; | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | public Action Hook_UserMessage(UserMsg msg_id, Handle bf, const players[], int playersNum, bool reliable, bool init) |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | public Action Hook_UserMessage(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	char sMessageName[32]; |  |  |  |     char sMessageName[32]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	char sMessageSender[64]; |  |  |  |     char sMessageSender[64]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	int iAuthor = BfReadByte(bf); |  |  |  |     int iAuthor = BfReadByte(bf); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	bool bIsChat = view_as<bool>(BfReadByte(bf)); if (bIsChat) bIsChat=false; //fucking compiler shut the fuck up REEEEEE |  |  |  |     bool bIsChat = view_as<bool>(BfReadByte(bf)); if (bIsChat) bIsChat=false; //fucking compiler shut the fuck up REEEEEE | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	BfReadString(bf, sMessageName, sizeof(sMessageName), false); |  |  |  |     BfReadString(bf, sMessageName, sizeof(sMessageName), false); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	BfReadString(bf, sMessageSender, sizeof(sMessageSender), false); |  |  |  |     BfReadString(bf, sMessageSender, sizeof(sMessageSender), false); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (iAuthor <= 0 || iAuthor > MaxClients) |  |  |  |     if (iAuthor <= 0 || iAuthor > MaxClients) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return Plugin_Handled; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (strlen(sMessageName) == 0 || strlen(sMessageSender) == 0) |  |  |  |     if (strlen(sMessageName) == 0 || strlen(sMessageSender) == 0) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return Plugin_Handled; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (strcmp(sMessageName, "#Cstrike_Name_Change") == 0) |  |  |  |     if (strcmp(sMessageName, "#Cstrike_Name_Change") == 0) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return Plugin_Handled; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (sMessageName[13] == 'C' || sMessageName[13] == 'T' || sMessageName[13] == 'S') |  |  |  |     if (sMessageName[13] == 'C' || sMessageName[13] == 'T' || sMessageName[13] == 'S') | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		g_bTeamChat = true; |  |  |  |         g_bTeamChat = true; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	else |  |  |  |     else | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		g_bTeamChat = false; |  |  |  |         g_bTeamChat = false; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return Plugin_Handled; | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | stock bool Steam32IDtoSteam64ID(const char[] sSteam32ID, char[] sSteam64ID, int Size) |  |  |  | stock bool Steam32IDtoSteam64ID(const char[] sSteam32ID, char[] sSteam64ID, int Size) | 
			
		
	
	
		
		
			
				
					
					|  |  | @ -350,26 +353,27 @@ stock void Discord_MakeStringSafe(const char[] sOrigin, char[] sOut, int iOutSiz | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | stock int OnTransferComplete(Handle hRequest, bool bFailure, bool bRequestSuccessful, EHTTPStatusCode eStatusCode, int client) |  |  |  | stock int OnTransferComplete(Handle hRequest, bool bFailure, bool bRequestSuccessful, EHTTPStatusCode eStatusCode, int client) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (bFailure || !bRequestSuccessful || eStatusCode != k_EHTTPStatusCode200OK) |  |  |  |     if (bFailure || !bRequestSuccessful || eStatusCode != k_EHTTPStatusCode200OK) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  |     { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		if (eStatusCode != k_EHTTPStatusCode429TooManyRequests) |  |  |  |         if (eStatusCode != k_EHTTPStatusCode429TooManyRequests) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  |         { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			LogError("SteamAPI HTTP Response failed: %d", eStatusCode); |  |  |  |             LogError("SteamAPI HTTP Response failed: %d", eStatusCode); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  |         } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		delete hRequest; |  |  |  |         delete hRequest; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return 0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  |     } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	int iBodyLength; |  |  |  |     int iBodyLength; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	SteamWorks_GetHTTPResponseBodySize(hRequest, iBodyLength); |  |  |  |     SteamWorks_GetHTTPResponseBodySize(hRequest, iBodyLength); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	char[] sData = new char[iBodyLength]; |  |  |  |     char[] sData = new char[iBodyLength]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	SteamWorks_GetHTTPResponseBodyData(hRequest, sData, iBodyLength); |  |  |  |     SteamWorks_GetHTTPResponseBodyData(hRequest, sData, iBodyLength); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	delete hRequest; |  |  |  |     delete hRequest; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	APIWebResponse(sData, client); |  |  |  |     APIWebResponse(sData, client); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return 0; | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | stock void APIWebResponse(const char[] sData, int client) |  |  |  | stock void APIWebResponse(const char[] sData, int client) | 
			
		
	
	
		
		
			
				
					
					|  |  | @ -520,58 +524,59 @@ stock void Discord_POST(const char[] sURL, char[] sText, bool bUsingUsername=fal | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | public int OnHTTPRequestCompleted(Handle hRequest, bool bFailure, bool bRequestSuccessful, EHTTPStatusCode eStatusCode, JSONObject RequestJSON) |  |  |  | public int OnHTTPRequestCompleted(Handle hRequest, bool bFailure, bool bRequestSuccessful, EHTTPStatusCode eStatusCode, JSONObject RequestJSON) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (bFailure || !bRequestSuccessful || (eStatusCode != k_EHTTPStatusCode200OK && eStatusCode != k_EHTTPStatusCode204NoContent)) |  |  |  |     if (bFailure || !bRequestSuccessful || (eStatusCode != k_EHTTPStatusCode200OK && eStatusCode != k_EHTTPStatusCode204NoContent)) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  |     { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		if (eStatusCode != k_EHTTPStatusCode429TooManyRequests) |  |  |  |         if (eStatusCode != k_EHTTPStatusCode429TooManyRequests) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			LogError("Discord HTTP request failed: %d", eStatusCode); |  |  |  |             LogError("Discord HTTP request failed: %d", eStatusCode); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		if (eStatusCode == k_EHTTPStatusCode400BadRequest) |  |  |  |         if (eStatusCode == k_EHTTPStatusCode400BadRequest) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  |         { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			char sData[2048]; |  |  |  |             char sData[2048]; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 			(view_as<JSONRootNode>(RequestJSON)).ToString(sData, sizeof(sData), 0); |  |  |  |             (view_as<JSONRootNode>(RequestJSON)).ToString(sData, sizeof(sData), 0); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 			LogError("Malformed request? Dumping request data:\n%s", sData); |  |  |  |             LogError("Malformed request? Dumping request data:\n%s", sData); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  |         } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		else if (eStatusCode == k_EHTTPStatusCode429TooManyRequests) |  |  |  |         else if (eStatusCode == k_EHTTPStatusCode429TooManyRequests) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  |         { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			g_iRatelimitRemaining = 0; |  |  |  |             g_iRatelimitRemaining = 0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			g_iRatelimitReset = GetTime() + 5; |  |  |  |             g_iRatelimitReset = GetTime() + 5; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  |         } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		delete RequestJSON; |  |  |  |         delete RequestJSON; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		delete hRequest; |  |  |  |         delete hRequest; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return 0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  |     } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	static int iLastRatelimitRemaining = 0; |  |  |  |     static int iLastRatelimitRemaining = 0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	static int iLastRatelimitReset = 0; |  |  |  |     static int iLastRatelimitReset = 0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	char sTmp[32]; |  |  |  |     char sTmp[32]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	bool bHeaderExists = SteamWorks_GetHTTPResponseHeaderValue(hRequest, "x-ratelimit-remaining", sTmp, sizeof(sTmp)); |  |  |  |     bool bHeaderExists = SteamWorks_GetHTTPResponseHeaderValue(hRequest, "x-ratelimit-remaining", sTmp, sizeof(sTmp)); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (!bHeaderExists) |  |  |  |     if (!bHeaderExists) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		LogError("x-ratelimit-remaining header value could not be retrieved"); |  |  |  |         LogError("x-ratelimit-remaining header value could not be retrieved"); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	int iRatelimitRemaining = StringToInt(sTmp); |  |  |  |     int iRatelimitRemaining = StringToInt(sTmp); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	bHeaderExists = SteamWorks_GetHTTPResponseHeaderValue(hRequest, "x-ratelimit-reset", sTmp, sizeof(sTmp)); |  |  |  |     bHeaderExists = SteamWorks_GetHTTPResponseHeaderValue(hRequest, "x-ratelimit-reset", sTmp, sizeof(sTmp)); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (!bHeaderExists) |  |  |  |     if (!bHeaderExists) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		LogError("x-ratelimit-reset header value could not be retrieved"); |  |  |  |         LogError("x-ratelimit-reset header value could not be retrieved"); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	int iRatelimitReset = StringToInt(sTmp); |  |  |  |     int iRatelimitReset = StringToInt(sTmp); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (iRatelimitRemaining < iLastRatelimitRemaining || iRatelimitReset >= iLastRatelimitReset) //don't be fooled by different completion times |  |  |  |     if (iRatelimitRemaining < iLastRatelimitRemaining || iRatelimitReset >= iLastRatelimitReset) //don't be fooled by different completion times | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  |     { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		g_iRatelimitRemaining = iRatelimitRemaining; |  |  |  |         g_iRatelimitRemaining = iRatelimitRemaining; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		g_iRatelimitReset = iRatelimitReset; |  |  |  |         g_iRatelimitReset = iRatelimitReset; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  |     } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	//PrintToServer("limit: %d | remaining: %d || reset %d - now %d", g_iRatelimitLimit, g_iRatelimitRemaining, g_iRatelimitReset, GetTime()); |  |  |  |     //PrintToServer("limit: %d | remaining: %d || reset %d - now %d", g_iRatelimitLimit, g_iRatelimitRemaining, g_iRatelimitReset, GetTime()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	delete RequestJSON; |  |  |  |     delete RequestJSON; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	delete hRequest; |  |  |  |     delete hRequest; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return 0; | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | stock bool IsValidClient(int client) |  |  |  | stock bool IsValidClient(int client) | 
			
		
	
	
		
		
			
				
					
					|  |  | @ -581,34 +586,34 @@ stock bool IsValidClient(int client) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | public Action OnLogAction(Handle hSource, Identity ident, int client, int target, const char[] sMsg) |  |  |  | public Action OnLogAction(Handle hSource, Identity ident, int client, int target, const char[] sMsg) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (client <= 0) |  |  |  |     if (client <= 0) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return; |  |  |  |         return Plugin_Handled; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if ((StrContains(sMsg, "sm_psay", false)!= -1) || (StrContains(sMsg, "sm_chat", false)!= -1)) |  |  |  |     if ((StrContains(sMsg, "sm_psay", false)!= -1) || (StrContains(sMsg, "sm_chat", false)!= -1)) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		return;// dont log sm_psay and sm_chat |  |  |  |         return Plugin_Handled;// dont log sm_psay and sm_chat | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	char sFinal[256]; |  |  |  |     char sFinal[256]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	char sCurrentMap[32]; |  |  |  |     char sCurrentMap[32]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	char sDemoInfo[64]; |  |  |  |     char sDemoInfo[64]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	char sClientName[64]; |  |  |  |     char sClientName[64]; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	GetCurrentMap(sCurrentMap, sizeof(sCurrentMap)); |  |  |  |     GetCurrentMap(sCurrentMap, sizeof(sCurrentMap)); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (IsDemoRecording()) |  |  |  |     if (IsDemoRecording()) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		Format(sDemoInfo, sizeof(sDemoInfo), "Demo: %d @ Tick: %d", GetDemoRecordingNumber(), GetDemoRecordingTick()); |  |  |  |         Format(sDemoInfo, sizeof(sDemoInfo), "Demo: %d @ Tick: %d", GetDemoRecordingNumber(), GetDemoRecordingTick()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	else |  |  |  |     else | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		Format(sDemoInfo, sizeof(sDemoInfo), "Not recording"); |  |  |  |         Format(sDemoInfo, sizeof(sDemoInfo), "Not recording"); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	Format(sFinal, sizeof(sFinal), "[ %s ][ %s ]```%s```", sCurrentMap, sDemoInfo, sMsg); |  |  |  |     Format(sFinal, sizeof(sFinal), "[ %s ][ %s ]```%s```", sCurrentMap, sDemoInfo, sMsg); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	GetClientName(client, sClientName, sizeof(sClientName)); |  |  |  |     GetClientName(client, sClientName, sizeof(sClientName)); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	if (g_sAvatarURL[client][0] != '\0') |  |  |  |     if (g_sAvatarURL[client][0] != '\0') | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		Discord_POST(DISCORD_ADMINLOGS_WEBHOOKURL, sFinal, true, sClientName, true, g_sAvatarURL[client], false); |  |  |  |         Discord_POST(DISCORD_ADMINLOGS_WEBHOOKURL, sFinal, true, sClientName, true, g_sAvatarURL[client], false); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	else |  |  |  |     else | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		Discord_POST(DISCORD_ADMINLOGS_WEBHOOKURL, sFinal, true, sClientName, false, "", false); |  |  |  |         Discord_POST(DISCORD_ADMINLOGS_WEBHOOKURL, sFinal, true, sClientName, false, "", false); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	return; |  |  |  |     return Plugin_Handled; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | public Action CommandListener_SmChat(int client, const char[] sCommand, int argc) |  |  |  | public Action CommandListener_SmChat(int client, const char[] sCommand, int argc) | 
			
		
	
	
		
		
			
				
					
					|  |  | 
 |