et_Print can't get punkbuster entries from etconsole.log?

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

et_Print can't get punkbuster entries from etconsole.log?

Post by Luk4ward »

As the topic says...Is that true? Coz i have written a .lua which is parsing such line from etconsole.log:

Code: Select all

^3PunkBuster Server: Player GUID Computed guidGU1DGUIDGUIDGUIDGUID0000guid(-) (slot #1) 123.123.45.67:27960 ^0requiem^14^0dream
but it doesnt work in real time i meant when someone is connecting only when i manually set the variable from et_Print, for example:

Code: Select all

text = "^3PunkBuster Server: Player GUID Computed guidGU1DGUIDGUIDGUIDGUID0000guid(-) (slot #1) 123.123.45.67:27960 ^0requiem^14^0dream"
Whats going on? Im pretty sure the script is working so its smth with etpro?
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

et_print() does not parse logs, it just gets called when the game wants to print something to the console. Punkbuster prints things too, but the lua api doesn't really care what PB does.
GhosT:McSteve
Ghostworks Gaming Community
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

pb prints before the engine gets the code... thus you cannot capture it... you'll have to parse the actual log to get it... and there's no easy way to get that
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

yea i thought similar, what a pity...Thx for replies, so this is an example that etadmin mod is not so useless ;)
wolFTeam.pl
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

with exception of guidage i have been able to do almost everything etadmin mod can in etpower
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

gotenks wrote:with exception of guidage i have been able to do almost everything etadmin mod can in etpower
yea, coz etadmin can read whole log even pb entries, so this is his power, but im wondering how it would be difficult to create such way via etpro or lua

btw here u go a fix hack for min guid age in etadmin mod coz many ppl requested:

http://wolfwiki.anime.net/index.php/Use ... n_guid_age
wolFTeam.pl
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

lua can read the log files the same way etadmin mod can... it just cannot intercept it before it gets to the log file
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

gotenks wrote:lua can read the log files the same way etadmin mod can... it just cannot intercept it before it gets to the log file
yes, i know that can read files i even wrote some scripts so i know how it works, but as u said it cant get the punkbuster data so it can't do the same way as in etadmin which is parsing in real time the log?. Maybe et_print() will be enhanced, are there some works on new etpro and lua ?:>
wolFTeam.pl
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

etadmin mod reads the log as it gets printed... lua can read the log as it gets printed and get the guidage... i don't understand how it cannot work the same when it does everything the same??? lua has the option of reading the information before it gets to the log (through the et.print command)...
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

gotenks wrote:etadmin mod reads the log as it gets printed... lua can read the log as it gets printed and get the guidage... i don't understand how it cannot work the same when it does everything the same??? lua has the option of reading the information before it gets to the log (through the et.print command)...
Jesus, listen to himself. First u r posting that it cannot be done now u r talking it can, what the ... ? ETadmin mod is reading the code from etconsole.log as it gets printed yes, but lua CAN'T DO the same, the example is with the punkbuste entries which lua is IGNORING but etadmin mod can read it when its printed, so i said the et_print function should be recoded to read after a line and will not ignore punkbuster logs which are printing into etconsole.log. And YES the both can read the files, but ETadmin can read the lines one by one or match whatever from etconsole.log and lua CAN'T and the example i POSTED, so YOU CAN'T DO THE SAME WAY WITH PUNKBUSTER ENTRIES AS DOING IT ETADMIN MOD VIA LUA, so u can't write a mod which will read guid age from ETCONSOLE.log when it gets PRINTED INTO IT...grr, i really dnt know whats going on with u guys, maybe now u can understand what i meant...

p.s and yes i know how lua can handle the situation with pb but its tricky and i dnt think so it worths, i dnt have time atm to check my idea
wolFTeam.pl
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

you can open up the entire file and read it... the last xxx lines will contain your guidage, lua cannot get the guidage or anything else from pb directly as it gets printed to the log before bani gets to intercept it... hence he cannot change anything without rewriting the entire quake3 part of the code... i have a working model that will read lines from the log as it's being printed, but i don't know how much it will affect the server (in lag) doing this as it may be 20-50 lines up by the time i can acknowledge it's there... so unless i'm using some sort of magic, it can be done, and if someone can stream line it to do it a little more efficiently i'd appreciate it :roll:
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

gotenks wrote:you can open up the entire file and read it... the last xxx lines will contain your guidage, lua cannot get the guidage or anything else from pb directly as it gets printed to the log before bani gets to intercept it... hence he cannot change anything without rewriting the entire quake3 part of the code... i have a working model that will read lines from the log as it's being printed, but i don't know how much it will affect the server (in lag) doing this as it may be 20-50 lines up by the time i can acknowledge it's there... so unless i'm using some sort of magic, it can be done, and if someone can stream line it to do it a little more efficiently i'd appreciate it :roll:
sorry, but you get my irritated with your replies telling once that smth cant be done and next it can. Just scroll up im done with my irritation...

Next on your concrete post, u meant that u wrote a code which will read etconsole.log in the same way as etadmin mod? Or u maybe are talking about copying the whole log into another so u r using another log to parse it? My idea is to put simply pb dir into etpro/ then in the config file put:

Code: Select all

pb_sv_newlog
which will generate every map restart new pb log so the lua will be able to open & read such log quite easy (info about the number of next log is in pbsv.log:

Code: Select all

pb_sv_ssnext 660
pb_sv_lognext 278
) and parse less text (size of such logs on my server is from 3 to max 600 kb and its quite full from morning to evening, i set cvarwalk 1, cvaruser 90 and cvarchanged 90 and cvarfreq 3 also auto pb ss is off but we have ppl for doing that and cvarlogging 1), so it shouldnt affect at all on server, but as i said i dnt have time to check my idea atm, regards and sorry for being so angry but you should not look at me from up and try to understand my not perfect english and i love to use shortcuts so sorry for that too, coz we may misunderstand each other :roll:
wolFTeam.pl
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

i was meaning it cannot be done with the et_print, as that is bypassed by the engine...
you can open the log as a file, skip the length of the file less xxx bytes, then start parsing the remainder... the problem is I do not know when to actually start parsing the log, so it's quite a large amount of parsing to do
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

gotenks wrote:i was meaning it cannot be done with the et_print, as that is bypassed by the engine...
yes, at the beginning and i agreed but then after my answer u have written smth another which was irritating me
gotenks wrote: you can open the log as a file, skip the length of the file less xxx bytes, then start parsing the remainder... the problem is I do not know when to actually start parsing the log, so it's quite a large amount of parsing to do
i know, thats how my idea looks like, it will be parsed when a player is connecting to the server, this is my code which was written before i figured out that et_print cant get pb entries, its parsing ok the line as i checked it in LuaEdit and then with an example on server:

Code: Select all

cnt_player = {}
clientNum = 0

function et_Print( text )

if (cnt_player[clientNum] == "cnt") then

et.G_LogPrint(string.format("run get pb data\n"))
--text = "grgesfsfs\rcos\n^3PunkBuster Server: Player GUID Computed guidGU1DGUIDGUIDGUIDGUID0000guid(-) (slot #1) 123.123.45.67:27960 ^0requiem^14^0dream"
--text = "^3PunkBuster Server: Player GUID Computed guidGU1DGUIDGUIDGUIDGUID0000guid(-) (slot #1) 123.123.45.67:27960 ^0requiem^14^0dream"
--dlaczego dziala tylko ta linia i tylko ona sama?:
get_pbdata(text)

end

end

function get_pbdata(text)

local s_start = 0
local s_end = 0

et.G_LogPrint(string.format("started get pb data\n"))

text = et.Q_CleanStr(text)

local pattern = "^PunkBuster Server: Player GUID Computed (%x+)"  

local s_start,s_end,pbguid = string.find(text, pattern)

if ((s_end == 0) or (s_end == nil)) then

return

end

text=string.sub(text,s_end+12)

local s_start,s_end,pbid = string.find(text, "(%d+)")

text=string.sub(text,s_end+2)

local s_start,s_end,ip = string.find(text, "(%d+%.%d+%.%d+%.%d+)")

text=string.sub(text,s_end+7)

local s_start,s_end,nick = string.find(text, "(%w+)")

local line,fd,len

line = "[logged @ " .. os.date("%c") .. "] " .. pbguid .. " " .. ip .. " " .. pbid .. " " .. nick .. " \n"

et.G_LogPrint(string.format("" .. line .. ""))
   
  fd, len = et.trap_FS_FOpenFile( "logs/pbdata.log", et.FS_APPEND )
     
  if len >= 0 then
        et.trap_FS_Write( line, string.len( line ), fd )
     		et.trap_FS_FCloseFile( fd )
	end
	
e_id = tonumber (pbid)

cnt_player[e_id-1] = "false"
end

function et_ClientConnect( clientNum, firstTime, isBot )

cnt_player[clientNum] = "cnt"

et.G_LogPrint(string.format("cnt_player[ " .. clientNum .. " ] " .. cnt_player[clientNum] .. " \n"))

end

function et_ClientDisconnect( clientNum )

cnt_player[clientNum] = "disc"

et.G_LogPrint(string.format("cnt_player[ " .. clientNum .. " ] " .. cnt_player[clientNum] .. " \n"))
end
its a good start ;)

btw as for min guid age check i would create a cvar: lua_minguidagefreq which can be used to set the freq of scans for such values as pb_sv_md5toolfreq. When min guid age is showing in .log i wrote on wiki and PsB
Last edited by Luk4ward on Mon Jan 14, 2008 6:37 am, edited 1 time in total.
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

The guidage generated by PB is broken, and tends to be reported only in a minority of cases anyway. Even in your example you can see:

Code: Select all

--text = "^3PunkBuster Server: Player GUID Computed xxxxxxxxxxxxxxxxxxxxxxxx88855244(-)
is not reporting the age. It should have "(VALID: <days>)" in the brackets at the end. Without this, nothing can obtain it (Lua or adminmod).
Last edited by McSteve on Mon Jan 14, 2008 6:59 am, edited 1 time in total.
GhosT:McSteve
Ghostworks Gaming Community
Post Reply