Monthly Target: $400 Donations: $321
 80% 

[Any] Save player chat to file V1.2.1


Post New Thread Reply   
 
Thread Tools Display Modes
Author
citkabuto
Junior Member
Join Date: Dec 2009
Plugin ID:
1434
Plugin Version:
1.2.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Approver:
    Plugin Description:
    Formats and saves player chat (and team chat) to a file
    Servers with this Plugin:
     
    Old 01-29-2010 , 07:19   [Any] Save player chat to file V1.2.1
    Reply With Quote #1

    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
    Attached Files
    File Type: sp Get Plugin or Get Source (savechat.sp - 2835 views - 5.2 KB)

    Last edited by citkabuto; 02-23-2010 at 09:27. Reason: Added team name
    citkabuto is offline
    roywheels
    Member
    Join Date: Apr 2009
    Old 01-29-2010 , 07:22   Re: [Any] Save player chat to file
    Reply With Quote #2

    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
    roywheels is offline
    crabsticks
    New Member
    Join Date: Jan 2010
    Old 01-29-2010 , 15:06   Re: [Any] Save player chat to file
    Reply With Quote #3

    Works great
    Can now save a lot of the best messages
    crabsticks is offline
    M249-M4A1
    I <3 Mac
    Join Date: May 2005
    Location: Not interested
    Old 01-30-2010 , 09:27   Re: [Any] Save player chat to file
    Reply With Quote #4

    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!
    __________________

    Last edited by M249-M4A1; 01-30-2010 at 09:32.
    M249-M4A1 is offline
    Send a message via AIM to M249-M4A1
    kwski43
    Senior Member
    Join Date: Mar 2009
    Old 01-31-2010 , 10:48   Re: [Any] Save player chat to file
    Reply With Quote #5

    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 View Post
    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.
    __________________

    Last edited by kwski43; 01-31-2010 at 10:54.
    kwski43 is offline
    citkabuto
    Junior Member
    Join Date: Dec 2009
    Old 01-31-2010 , 17:27   Re: [Any] Save player chat to file
    Reply With Quote #6

    Quote:
    Originally Posted by M249-M4A1 View Post
    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 is offline
    citkabuto
    Junior Member
    Join Date: Dec 2009
    Old 01-31-2010 , 17:28   Re: [Any] Save player chat to file
    Reply With Quote #7

    Quote:
    Originally Posted by kwski43 View Post
    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
    citkabuto is offline
    M249-M4A1
    I <3 Mac
    Join Date: May 2005
    Location: Not interested
    Old 01-31-2010 , 19:13   Re: [Any] Save player chat to file
    Reply With Quote #8

    Quote:
    Originally Posted by citkabuto View Post
    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
    __________________
    M249-M4A1 is offline
    Send a message via AIM to M249-M4A1
    NaRyan
    Member
    Join Date: Jan 2010
    Location: United Kingdom
    Old 01-31-2010 , 22:43   Re: [Any] Save player chat to file V1.1
    Reply With Quote #9

    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.

    Last edited by NaRyan; 01-31-2010 at 22:43. Reason: Spelling... *sigh*
    NaRyan is offline
    M249-M4A1
    I <3 Mac
    Join Date: May 2005
    Location: Not interested
    Old 02-01-2010 , 00:10   Re: [Any] Save player chat to file V1.1
    Reply With Quote #10

    Code:
    if (client != 0) { // code }

    lol yay
    __________________
    M249-M4A1 is offline
    Send a message via AIM to M249-M4A1
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


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


    Powered by vBulletin®
    Copyright ©2000 - 2015, vBulletin Solutions, Inc.
    Theme made by Freecode