|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Development::Feature Requests Post suggestions/feature requests here. |
04-09-2010, 09:43 AM
|
Discordant
|
|
Join Date: Aug 2007
Posts: 307
|
|
Record / Log Chat
Whats the best way to record chat in ooc and other channels? Some players get out of hand and push the limits when I'm at work IRL. Would be AWSOME if all public chat could get recorded into a database table with date/time stamp, player name, and msg, etc. Otherwise, what options do we currently have?
|
04-09-2010, 01:24 PM
|
Opcode Ninja
|
|
Join Date: Mar 2009
Location: San francisco
Posts: 426
|
|
type /log on in chat window
|
04-09-2010, 02:03 PM
|
Discordant
|
|
Join Date: Jan 2002
Posts: 305
|
|
I believe he means server-side, without having to be logged in.
|
04-09-2010, 03:00 PM
|
Discordant
|
|
Join Date: Aug 2007
Posts: 307
|
|
Yes, server side, cause we have auto reboots and I want to be logged in 24/7 to record. I know /log works with client, but wanted to know if there is a way the source code can do it, either into a text file or into the database would be great.
|
04-09-2010, 07:32 PM
|
|
Demi-God
|
|
Join Date: May 2007
Location: b
Posts: 1,447
|
|
Quote:
Originally Posted by thepoetwarrior
Yes, server side, cause we have auto reboots and I want to be logged in 24/7 to record. I know /log works with client, but wanted to know if there is a way the source code can do it, either into a text file or into the database would be great.
|
I'll see if I can work something up for you.
It would be pretty easy to just dump all the chat to their own logfile with the way the logfile system is set up.
|
04-09-2010, 09:35 PM
|
Discordant
|
|
Join Date: Aug 2007
Posts: 307
|
|
Awsome, can't wait.
|
|
|
|
04-10-2010, 03:32 AM
|
|
Demi-God
|
|
Join Date: May 2007
Location: b
Posts: 1,447
|
|
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)
|
|
|
|
04-10-2010, 12:04 PM
|
Discordant
|
|
Join Date: Aug 2007
Posts: 307
|
|
Awsome! Your a life saver. I saved this to file already, and will try to use it on our new server hardware this weekend during the install / setup.
Thanks a ton!
|
04-10-2010, 01:02 PM
|
Hill Giant
|
|
Join Date: Sep 2008
Posts: 204
|
|
Thank you Secrets, very handy.
__________________
|
10-24-2011, 06:32 PM
|
Fire Beetle
|
|
Join Date: Oct 2011
Location: Greenwood, SC
Posts: 18
|
|
I apologize for resurrecting an old thread but i was wondering, how would I run this? Thanks!
|
10-25-2011, 03:45 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
You have to manually edit the changes that Secrets posted into your source and compile it yourself. Keep in mind that this was posted a while back so the line numbers most likely don't match up exactly, but it isn't hard to figure out the correct places to make the changes with the current source.
|
10-25-2011, 11:42 AM
|
Fire Beetle
|
|
Join Date: Oct 2011
Location: Greenwood, SC
Posts: 18
|
|
Thanks for the quick response! I manually added everything and have rebooted my server but still I'm not seeing anything logged for chat. I have double and triple checked that everything is in the right place and the only thing I found different was where above it says:
Quote:
else if (!worldserver.SendChannelMessage(this, targetname, chan_num, 0, language, message))
|
Mine instead has target_name but i suspect that shouldn't make any difference for the logging. This may sound stupid but I'm not sure how to "compile" it after I editted the files. Thanks a bunch for your assistance!
|
10-25-2011, 12:11 PM
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
|
10-25-2011, 12:37 PM
|
Fire Beetle
|
|
Join Date: Oct 2011
Location: Greenwood, SC
Posts: 18
|
|
Thanks, I found 'compile' by right clicking the 2 cpp files in VB Express and it said they compiled successfully but the logging still isn't showing at all. I tried rebooting the server pc as well. Should i compile everything over again like shown in the wiki link above? I have custom items/rules/etc on my server that i really can't lose so before I compile everything, will i lose anything in the process? I see a log type in c:\eqemu\logs called eqemu_chatchannels_***.log but there's nothing really in there except stating the log was started.
Thanks!
|
10-26-2011, 11:05 AM
|
|
Hill Giant
|
|
Join Date: Aug 2010
Location: UT
Posts: 215
|
|
I hope I am not belittling you by asking you about something you feel is obvious, but after you compiled did you copy the .exe files over to your server folder?
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 07:44 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|