AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Save player chat to file V1.2.1 (https://forums.alliedmods.net/showthread.php?t=117116)

citkabuto 01-29-2010 07:19

[Any] Save player chat to file V1.2.1
 
5 Attachment(s)
SaveChat

A server admin friend asked me if it was simple to record just player chat messages to a file as he was getting fed up of digging through the main logfiles and didn't want to use a database.

So, I wrote this simple plugin that should work on any Source game. It captures both Say and Say Team commands and formats the output before logging it to a datestamped file.

E.g. logs/chat290110.log

Code:

--=================================================================--
[29/01/2010 10:52:47] --- NEW MAP STARTED: c1m4_atrium ---
--=================================================================--
[10:58:24] [GB] [Infected  ] Dollshead          : (TEAM) Testing team chat
[11:00:23] [GB] [Survivor  ] Citizen Kabuto    : (TEAM) Lovely weather guv!
[11:01:49] [GB] [Spectator ] STALKER            : I reckon we should play
[11:05:15] [GB] [Spectator ] STALKER            : (TEAM) I am a nub!
[11:09:12] [FR] BanjoLovesYa      has joined (STEAM_1:0:10234254 | 69.23.25.163)
[11:15:10] [GB] [Survivor  ] Citizen Kabuto    : Lookout! Banjo's in the house! ;-)
[12:01:29] [  ] [          ] CONSOLE            : You have to be the worst players I've ever seen!



Installation Details

Download the "savechat.smx" and drop into your addons\sourcemod\plugins directory.

Server ConVars
  • sm_savechat_version - Version of SaveChat
  • sm_record_detail - Save team name, Steam ID and IP address of connected players (0=no, 1=yes : default=1)

This has been tested as working on L4D, L4D2 and TF2 servers and should honestly run fine on any Source powered game. Please let me know if you have any issues.

Changes:

V1.2.1
  • Argh! 1.2.0 doesn't work - uploaded wrong version! This one does work!
V1.2.0
  • Records player team (if sm_record_detail is enabled)
  • Now uses proper method of determining player name
V1.1.1
  • Fixed error (client index 0 is invalid) for console issued messages
  • Cleaned up formatting slightly
V1.1.0
  • Added ability to record player SteamID and IP address when connecting
  • Fixed bug with date of file not rolling over correctly
  • Fixed bug with main cvar not registering correctly
V1.0.0
  • Original version

roywheels 01-29-2010 07:22

Re: [Any] Save player chat to file
 
Rock n roll! Thanks for making this. It's useful to have a clearly laid out chat log.

Using it on my server already... ;D

crabsticks 01-29-2010 15:06

Re: [Any] Save player chat to file
 
Works great :)
Can now save a lot of the best messages :D

M249-M4A1 01-30-2010 09:27

Re: [Any] Save player chat to file
 
something simple and effective. nice! what about logging steamid and ips on player join (you never know when the banhammer comes around!)

[10:58:24] [GB] Dollshead : (TEAM) Testing team chat
[11:00:23] [GB] Citizen Kabuto : (TEAM) Lovely weather guv!
[11:01:12] [GB] STALKER has joined (STEAM_0:1:22914330 | 67.159.619.251)
[11:01:49] [GB] STALKER : I reckon we should play
[11:05:15] [GB] STALKER : (TEAM) I am a nub!

only a suggestion, i like it as-is too!

kwski43 01-31-2010 10:48

Re: [Any] Save player chat to file
 
Good alternative to ChatLog v1.3.7 (Extended).
If server is hosted with web server on the same machine there is possibility to do something similiar to webchatlog in muukis's plugin.

Quote:

Originally Posted by M249-M4A1 (Post 1072794)
something simple and effective. nice! what about logging steamid and ips on player join (you never know when the banhammer comes around!)

[10:58:24] [GB] Dollshead : (TEAM) Testing team chat
[11:00:23] [GB] Citizen Kabuto : (TEAM) Lovely weather guv!
[11:01:12] [GB] STALKER has joined (STEAM_0:1:22914330 | 67.159.619.251)
[11:01:49] [GB] STALKER : I reckon we should play
[11:05:15] [GB] STALKER : (TEAM) I am a nub!

only a suggestion, i like it as-is too!

Better idea would be logging server broadcast messages and player connects/disconnects + Connect Announce will make same effect as you said.

citkabuto 01-31-2010 17:27

Re: [Any] Save player chat to file
 
Quote:

Originally Posted by M249-M4A1 (Post 1072794)
something simple and effective. nice! what about logging steamid and ips on player join (you never know when the banhammer comes around!)

[10:58:24] [GB] Dollshead : (TEAM) Testing team chat
[11:00:23] [GB] Citizen Kabuto : (TEAM) Lovely weather guv!
[11:01:12] [GB] STALKER has joined (STEAM_0:1:22914330 | 67.159.619.251)
[11:01:49] [GB] STALKER : I reckon we should play
[11:05:15] [GB] STALKER : (TEAM) I am a nub!

only a suggestion, i like it as-is too!

Thanks for the suggestion - it's implemented pretty much as you said. This behavior is on by default, but can be disabled by using the cvar above.

/CK

citkabuto 01-31-2010 17:28

Re: [Any] Save player chat to file
 
Quote:

Originally Posted by kwski43 (Post 1074075)
Good alternative to ChatLog v1.3.7 (Extended).
If server is hosted with web server on the same machine there is possibility to do something similiar to webchatlog in muukis's plugin.


Better idea would be logging server broadcast messages and player connects/disconnects + Connect Announce will make same effect as you said.

I've seen the features in the other plugins, but to be honest we just wanted a real simple way of logging just chat messages to a file - more to rip out the best bits easily and have a good laugh over whilst having a pint down the pub :)

M249-M4A1 01-31-2010 19:13

Re: [Any] Save player chat to file
 
Quote:

Originally Posted by citkabuto (Post 1074442)
I've seen the features in the other plugins, but to be honest we just wanted a real simple way of logging just chat messages to a file - more to rip out the best bits easily and have a good laugh over whilst having a pint down the pub :)

Right, and too many cvars just makes it complicated and not everyone wants to configure everything, or know how to

NaRyan 01-31-2010 22:43

Re: [Any] Save player chat to file V1.1
 
I have noticed one little problem.
If you talk via rcon (using HLSW) it causes an error.

Quote:

[SM] Native "GetClientIP" reported: Client index 0 is invalid
[SM] Displaying call stack trace for plugin "savechat.smx":
[SM] [0] Line 139, /home/groups/alliedmodders/forums/files/6/6/0/9/4/58542.attach::LogChat()
[SM] [1] Line 69, /home/groups/alliedmodders/forums/files/6/6/0/9/4/58542.attach::Command_Say()
Guess it's nothing to worry about as the plugin keeps on working fine.
Just thought I would point it out, as there are "certain" times where you have to talk to players on the server.

M249-M4A1 02-01-2010 00:10

Re: [Any] Save player chat to file V1.1
 
Code:
if (client != 0) { // code }

lol yay


All times are GMT -4. The time now is 12:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.