Browse Source

Renamed client to author.

More appropriate given the context.
nosoop 8 years ago
parent
commit
6d3354893e
1 changed files with 10 additions and 10 deletions
  1. 10 10
      scripting/simple-chatprocessor.sp

+ 10 - 10
scripting/simple-chatprocessor.sp

@@ -12,7 +12,7 @@
 
 #pragma newdecls required
 
-#define PLUGIN_VERSION "0.1.0"
+#define PLUGIN_VERSION "0.1.1"
 public Plugin myinfo = {
 	name = "[CSRD] Simple Chat Processor",
 	author = "nosoop (based off of Simple Plugins' implementation)",
@@ -142,12 +142,12 @@ public Action OnSayText2(UserMsg id, Handle buffer, const int[] clients, int nCl
 	return Plugin_Handled;
 }
 
-public void OnClientThinkPost(int client) {
+public void OnClientThinkPost(int author) {
 	/**
 	 * Iterate through all queued messages from OnSayText2
 	 */
-	if (g_QueuedMessages[client].Size > 0) {
-		StringMapSnapshot messages = g_QueuedMessages[client].Snapshot();
+	if (g_QueuedMessages[author].Size > 0) {
+		StringMapSnapshot messages = g_QueuedMessages[author].Snapshot();
 		
 		for (int m = 0; m < messages.Length; m++) {
 			char packedMessage[192], localizationToken[32], message[128];
@@ -155,7 +155,7 @@ public void OnClientThinkPost(int client) {
 			
 			ArrayList clientList;
 			
-			g_QueuedMessages[client].GetValue(packedMessage, clientList);
+			g_QueuedMessages[author].GetValue(packedMessage, clientList);
 			
 			// unpack localization and message from key
 			strcopy(localizationToken, StrContains(packedMessage, PACKED_TOKEN_DELIMITER) + 1,
@@ -163,13 +163,13 @@ public void OnClientThinkPost(int client) {
 			strcopy(message, sizeof(message), packedMessage[strlen(localizationToken) + 1]);
 			
 			char name[MAX_NAME_LENGTH + 1];
-			GetClientName(client, name, sizeof(name));
+			GetClientName(author, name, sizeof(name));
 			
 			// Prepare chat message flags.
 			g_ChatFlags = ParseChatMessageFlags(localizationToken);
 			
 			// Forward call.
-			Action forwardResult = ForwardOnChatMessage(client, clientList, name, sizeof(name),
+			Action forwardResult = ForwardOnChatMessage(author, clientList, name, sizeof(name),
 					message, sizeof(message));
 			
 			// Proceed to display message on continue or changed, else drop message.
@@ -180,9 +180,9 @@ public void OnClientThinkPost(int client) {
 					clients[nClients++] = clientList.Get(i);
 				}
 				
-				SayText(client, clients, nClients, localizationToken, name, message);
+				SayText(author, clients, nClients, localizationToken, name, message);
 				
-				ForwardOnChatMessagePost(client, clientList, name, message);
+				ForwardOnChatMessagePost(author, clientList, name, message);
 			}
 			delete clientList;
 			
@@ -190,7 +190,7 @@ public void OnClientThinkPost(int client) {
 		}
 		delete messages;
 		
-		g_QueuedMessages[client].Clear();
+		g_QueuedMessages[author].Clear();
 	}
 }