Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

Getting chat logs


  • Please log in to reply
12 replies to this topic

#1
OFFLINE   Duke777

Duke777

    Newbie

  • Members
  • Pip
  • 3 posts
0
Unknown

Is there a way of getting chat logs out of silent mod?



#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

You can parse those from server log.



#3
OFFLINE   Duke777

Duke777

    Newbie

  • Members
  • Pip
  • 3 posts
0
Unknown

I have the server.log open and don't see any conversations.   Could you be more specific, I am new to silent mod.



#4
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

Lines that start with "say:", "sayteam:", "saybuddy:", "privmsg:", "tprivmsg:", "mprivmsg:" and "adminchat:" are player chats. Saybuddy is fireteam chats, privmsg is normal private message, tprivmsg is private message to team and mprimsg is private message sent with the private message dialog and it can have multiple recipients.

 

EDIT:

I forgot to mention, to see private messages in the log, you need to have g_tyranny enabled.



#5
OFFLINE   Duke777

Duke777

    Newbie

  • Members
  • Pip
  • 3 posts
0
Unknown

Okay thanks, I used Notpad++ and typed  say (under the find icon which looks like binoculars)  until I found the chats amongst the omni-bot chatter.  I want to thank everyone for helping me learn the ins and outs of silent mod.


Edited by Duke777, 25 August 2014 - 02:57 AM.


#6
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Or if you want to make it 3000000000000000x easier just download etsnitch and it auto parses your logs. :*


  • Ray likes this

#7
OFFLINE   hellreturn

hellreturn

    Management

  • Management
  • PipPipPipPip
  • 2693 posts
158
On the road to fame

You can also use chat log LUA. I will submit it in download section sometime tonight. It should be also available on SD forums in one topic.


  • Ray likes this

#8
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

That's pretty much what i did with lua my self for pm logging. I log my pms via date/ip/name/name/message and i use "|" as a seperater and then just remove some stuff from the string and print it out via php.

 

Heres an example of how i have it setup.

 

http://gyazo.com/63a...95fae08913aae99

 

(very basic setup atm just started working on it a few nights ago will add visuals and tables to make it look cleaner) 


Edited by Purple, 26 August 2014 - 10:58 AM.


#9
OFFLINE   hellreturn

hellreturn

    Management

  • Management
  • PipPipPipPip
  • 2693 posts
158
On the road to fame

http://mygamingtalk....3-chat-logging/

 

That will log all the chats in a separate file. Feel free to modify it as per your needs.



#10
OFFLINE   hellreturn

hellreturn

    Management

  • Management
  • PipPipPipPip
  • 2693 posts
158
On the road to fame

That's pretty much what i did with lua my self for pm logging. I log my pms via date/ip/name/name/message and i use "|" as a seperater and then just remove some stuff from the string and print it out via php.

 

Heres an example of how i have it setup.

 

http://gyazo.com/63a...95fae08913aae99

 

(very basic setup atm just started working on it a few nights ago will add visuals and tables to make it look cleaner) 

 

You can also submit your own version in download section so if any admin who needs it can download it and use it :) 

 

Thank you!



#11
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Here i made something up real quick should work haven't tested it though. 

--[[
Chat logger v.1 by Purple (DRi*VJ*)
8/27/2014

	Info:
		All logs are logged in a seperate file including PM, regular chat and team chat. 
		They will be in your silent directory. If you would like to organize them put them into a folder called anything
		and change 
		
		pm_logs 	= "pm_logs.txt"
		say_logs 	= "say_logs.txt"
		say_team_logs = "say_team_logs.txt"
		
		To your directory destination 
		e.g. pm_logs = "logs/pm_logs.txt"
		
		
		Note: The file names must be the same in order for this to work.



--]]




pm_logs 	= "pm_logs.txt"
say_logs 	= "say_logs.txt"
say_team_logs = "say_team_logs.txt"
date_fmt 	= "%Y-%m-%d, %H:%M:%S"
version 	= "0.1"
temp_name = {}
c_Name = {}
temp_sguid = {}
temp_ip = {}
pm = {}
say = {}
say_team = {}

function et_InitGame(levelTime, randomSeed, restart)

    et.RegisterModname("pm_logs.lua "..version.." "..et.FindSelf())
    maxclients = tonumber(et.trap_Cvar_Get("sv_maxclients"))
	
	for i = 0, maxclients - 1 do
		pm[i] = ""
		say[i] = ""
		say_team[i] = ""
	end
	
end

function et_ClientBegin( clientNum )
	temp_name[clientNum] = et.Info_ValueForKey( et.trap_GetUserinfo( clientNum ), "name" )
	temp_sguid[clientNum] = et.Info_ValueForKey( et.trap_GetUserinfo( clientNum ), "sil_guid" )
	temp_ip[clientNum] = et.Info_ValueForKey( et.trap_GetUserinfo( clientNum ), "ip" )
	c_Name[clientNum] = et.Q_CleanStr( temp_name[clientNum] )	
end


function et_ClientCommand(clientNum, command)
	
	if command == "m" then
	
		if et.trap_Argc() > 1 then
       
        for i = 2, et.trap_Argc() - 1, 1 do
          pm[clientNum]  = pm[clientNum]  .. et.trap_Argv(i) .. " "
        end
		local sender = string.lower(et.trap_Argv(1))
		info = os.date("%x %I:%M:%S%p") .. " | IP: [" .. temp_ip[clientNum] .. "] | From: "..playerName(clientNum).." | To: " .. sender .. " | Pm: [ " .. pm[clientNum] .. "] " .."\n"
		
			fd,len = et.trap_FS_FOpenFile(pm_logs, et.FS_APPEND)
			count = et.trap_FS_Write(info, string.len(info), fd)
			et.trap_FS_FCloseFile(fd)
			fd = nil
			
			for i = 0, maxclients - 1 do
				pm[i] = ""
			end
			
		end
		
		return 0
	end
	
	if command == "say" then
	
		if et.trap_Argc() > 1 then
       
        for i = 1, et.trap_Argc() - 1, 1 do
          say[clientNum]  = say[clientNum]  .. et.trap_Argv(i) .. " "
        end
		
		info = os.date("%x %I:%M:%S%p") .. " | IP: [" .. temp_ip[clientNum] .. "] | Player: "..playerName(clientNum).." | say: [ " .. say[clientNum] .. "] " .."\n"
		
			fd,len = et.trap_FS_FOpenFile(say_logs, et.FS_APPEND)
			count = et.trap_FS_Write(info, string.len(info), fd)
			et.trap_FS_FCloseFile(fd)
			fd = nil
			
			for i = 0, maxclients - 1 do
				say[i] = ""
			end
			
		end
		
		return 0
	end
	
	if command == "say_team" then
	
		if et.trap_Argc() > 1 then
       
        for i = 1, et.trap_Argc() - 1, 1 do
          say_team[clientNum]  = say_team[clientNum]  .. et.trap_Argv(i) .. " "
        end

		info = os.date("%x %I:%M:%S%p") .. " | IP: [" .. temp_ip[clientNum] .. "] | Player: "..playerName(clientNum).." | say_team: [ " .. say_team[clientNum] .. "] " .."\n"
		
			fd,len = et.trap_FS_FOpenFile(say_team_logs, et.FS_APPEND)
			count = et.trap_FS_Write(info, string.len(info), fd)
			et.trap_FS_FCloseFile(fd)
			fd = nil
			
			for i = 0, maxclients - 1 do
				say_team[i] = ""
			end
			
		end
		
		return 0
	end
	
	
	return 0
end

function playerName(id)
  local name = et.Info_ValueForKey(et.trap_GetUserinfo(id), "name")
  if name == "" then
    return "*unknown*"
  end
  return name
end

Edited by Purple, 27 August 2014 - 02:03 PM.


#12
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better
<?php

	$file_handle = fopen("pm_logs.txt","rb");
	
	while(!feof($file_handle)){
		$get_userinfo = fgets($file_handle);
		$userinfo = explode('|', $get_userinfo);
		
		$find[] = ']';
		$find[] = '[';
		
		$replace[] = '';
		$replace[] = '';
		
		$userinfo = str_replace($find, $replace, $userinfo);
		print $userinfo[0] . $userinfo[1] . $userinfo[2] . $userinfo[3] . $userinfo[4]. "<BR>";
	}
	fclose($file_handle);
?>

heres also the php script for the simple parsing which i showed in my screen shot earlier.



#13
OFFLINE   Dookie

Dookie

    Advanced Member

  • Members
  • PipPipPipPip
  • 420 posts
55
Getting Better
  • LocationCroatia

Ok this script works without any probs! Thanks purple!






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users