View Single Post
  #7  
Old 04-10-2010, 03:32 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default

I had finished this earlier, just forgot to post it.

It puts all chat into its own log file. If you need to disable it, you're gonna need to recompile and change the EQDEBUG flag for chat.

If that's just confusing for you, well, here's a diff that you can apply.

Keep in mind this doesn't guarantee the person on the other end has received the tell, this is just what gets sent to the server to be sent elsewhere (ie: to other clients.)

Code:
Index: common/debug.cpp
===================================================================
--- common/debug.cpp	(revision 1367)
+++ common/debug.cpp	(working copy)
@@ -28,8 +28,8 @@
 static EQEMuLog realLogFile;
 EQEMuLog *LogFile = &realLogFile;
 
-static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands" };
-static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command" };
+static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/eqemu_chat" };
+static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Chat" };
 
 EQEMuLog::EQEMuLog() {
 //	MOpen = new Mutex;
@@ -54,6 +54,7 @@
 	pLogStatus[Error] = 2;
 	pLogStatus[Quest] = 2;
 	pLogStatus[Commands] = 1;
+	pLogStatus[Chat] = 1;
 #endif
 	logFileValid = true;
 }
Index: common/debug.h
===================================================================
--- common/debug.h	(revision 1367)
+++ common/debug.h	(working copy)
@@ -112,6 +112,7 @@
 		Debug,
 		Quest,
 		Commands,
+		Chat,
 		MaxLogID
 	};
 	
Index: zone/client.cpp
===================================================================
--- zone/client.cpp	(revision 1367)
+++ zone/client.cpp	(working copy)
@@ -788,6 +788,7 @@
 		else if (!worldserver.SendChannelMessage(this, targetname, chan_num, GuildID(), language, message))
 			Message(0, "Error: World server disconnected");
 		break;
+		LogFile->write(EQEMuLog::Chat, "%s says to guild %i, %s", this->GetName(), GuildID(), message);
 	}
 	case 2: { // GroupChat
 		Raid* raid = entity_list.GetRaidByClient(this);
@@ -800,12 +801,14 @@
 		if(group != NULL) {
 			group->GroupMessage(this,language,lang_skill,(const char*) message);
 		}
+		LogFile->write(EQEMuLog::Chat, "%s says to group, %s", this->GetName(), message);
 		break;
 	}
 	case 15: { //raid say
 		Raid* raid = entity_list.GetRaidByClient(this);
 		if(raid){
 			raid->RaidSay((const char*) message, this);
+			LogFile->write(EQEMuLog::Chat, "%s says to raid, %s", this->GetName(), message);
 		}
 		break;
 	}
@@ -813,7 +816,7 @@
 		Mob *sender = this;
 		if (GetPet() && GetPet()->FindType(SE_VoiceGraft))
 			sender = GetPet();
-
+		LogFile->write(EQEMuLog::Chat, "%s shouts, %s", this->GetName(), message);
 		entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
  		break;
  	}
@@ -842,7 +845,7 @@
 					return;
 				}
 			}
-
+			LogFile->write(EQEMuLog::Chat, "%s says to auction, %s", this->GetName(), message);
             if (!worldserver.SendChannelMessage(this, 0, 4, 0, language, message))
 			Message(0, "Error: World server disconnected");
 		}
@@ -886,6 +889,8 @@
 					return;
 				}
 			}
+
+			LogFile->write(EQEMuLog::Chat, "%s says out of character, %s", this->GetName(), message);
 			
 			if (!worldserver.SendChannelMessage(this, 0, 5, 0, language, message))
 			{
@@ -898,7 +903,7 @@
 
 			if (GetPet() && GetPet()->FindType(SE_VoiceGraft))
 				sender = GetPet();
-
+			LogFile->write(EQEMuLog::Chat, "%s says out of character, %s", this->GetName(), message);
 			entity_list.ChannelMessage(sender, chan_num, language, message);
 		}
 		break;
@@ -909,7 +914,9 @@
 			Message(0, "Error: Only GMs can use this channel");
 		else if (!worldserver.SendChannelMessage(this, targetname, chan_num, 0, language, message))
 			Message(0, "Error: World server disconnected");
+		LogFile->write(EQEMuLog::Chat, "%s BROADCASTS, %s", this->GetName(), message);
 		break;
+
 	}
 	case 7: { // Tell
 			if(!global_channel_timer.Check())
@@ -935,6 +942,8 @@
 				}
 			}
 
+			LogFile->write(EQEMuLog::Chat, "%s tells %s, %s", this->GetName(), targetname, message);
+
 			if(!worldserver.SendChannelMessage(this, targetname, chan_num, 0, language, message))
 				Message(0, "Error: World server disconnected");
 		break;
@@ -949,6 +958,7 @@
 			sender = GetPet();
 
 		printf("Message: %s\n",message);
+		LogFile->write(EQEMuLog::Chat, "%s says, %s", this->GetName(), message);
 		entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
 
 		if (sender != this)
Reply With Quote