![]() |
|
|
#1 |
|
Архивный участник
Join Date: May 2005
Posts: 63
|
Hi all, there perl version of Lin2Logd server.
Whats differenses from off version: 1) No more resident La2 server in the memory (+ RAM) 2) You can setup your own log insertion period ( only 30 mins, in standart L2Logd.exe) 3) You can insert logs offline to prefered DB 4) You can configure this server to insert only what you needs 5) You can insert several log dirs at once, by running prefered count of this servers. 6) No-db mode, where all logs print to STDOUT, you can collect it ( > la2.sql ) to *.sql file, and insert it by MS Query Analyzer 7) You can run server in silent mode (without any STDOUT). 8) Have got error log file 9) More correct work with authd logs, than in standart l2logd server (so users IP wil appear in L2Admin Action Logs) ... and more options in next future ( minor cheat detection for example ); +) More correct lin_CheckLogTimeTable2 procedure (audit logs adds) All You needs, is: 1) Instal ActiveState Perl 2) Install DBD::ODBC (perl module, try ppm3.bat from perl\bin dir) 3) Configure la2_logd.pl ( see in to file, section SERVER CONFIG) 4) Restart L2server, whithout L2Logd, and add start this script like perl.exe la2_logd.pl usage: la2_logd.pl [-a|-sa|-ca|etc...](without args it work with all logs, l2logd except) la2_logd.pl -c (work with only cached logs) la2_logd.pl -a (work with only authd logs) la2_logd.pl -s (work with only l2server logs) la2_logd.pl -n (work with only l2npc logs) la2_logd.pl -l (work with only l2logd logs, not used by default) la2_logd.pl -na (work with only l2npc logs, type audit) la2_logd.pl -ci (work with only cached logs, in type (system)) la2_logd.pl -sa (work with only l2server logs, type audit) There you can see two screens, it shows how server work flows. This version was tested on more than 18Gb logs (half month), without any serious errors. You can feel free to use this script at your own needs, it is not complex, and have more comments. If you have got hex fix from login two users with one char (for self selling and dupe resources), so please share it. Torune's patch is great, but ability for char cloning still exists. <rus>Новый сервер логов, позволяет гораздо гибче настроить процесс их вставки, позволяет регулировать переодичность, тип вставляемых логов, выдает данные в sql формате, для последующей вставки через альтернативные MsSQL интерфейсы (Query Analyzer), учтены косяки оригинального логсервера. Народ, не жмитесь, поделитесь у кого есть хексом на дюп вещей. Ловить таких в логах хорошо, но лучше убрать причину.</rus> Code:
/******************************************** lin_CheckLogTimeTable2 do check whether real time log table is exist or not INPUT @strDate varchar(16), @nWorld int OUTPUT return made by young date 2002-11-11 corrected by KEMBL corrects insert audit table to log_data view date 2005-12-04 ********************************************/ CREATE PROCEDURE [DBO].[lin_CheckLogTimeTable2] ( @strDate varchar(16), @nWorld int ) AS SET NOCOUNT ON declare @table_name varchar(60) declare @table_audit_name varchar(60) declare @table2_name varchar(60) declare @view_name varchar(60) declare @sql varchar(2048) -- check log_realtime set @table_name = @strDate + 'log_realtime_' + cast (@nWorld as varchar) set @sql = 'select * from sysobjects (nolock) where name = '''+ @table_name + '''' exec ( @sql) if ( @@ROWCOUNT = 0) begin set @sql = 'exec lin_MakeLogTable ''' + @table_name + '''' exec (@sql) end -- check log_audit set @table_audit_name = @strDate + 'log_audit_' + cast (@nWorld as varchar) set @sql = 'select * from sysobjects (nolock) where name = '''+ @table_audit_name + '''' exec ( @sql) if ( @@ROWCOUNT = 0) begin set @sql = 'exec lin_MakeLogTable ''' + @table_audit_name + '''' exec (@sql) end -- check log_data ( store 0~12 hour log) set @table_name = @strDate + 'log_data_' + cast (@nWorld as varchar) set @sql = 'select * from sysobjects (nolock) where name = '''+ @table_name + '''' exec ( @sql) if ( @@ROWCOUNT = 0) begin set @sql = 'exec lin_MakeLogTable ''' + @table_name + '''' exec (@sql) end -- check log_data2 ( store 12~24 hour log) set @table2_name = @strDate + 'log_data2_' + cast (@nWorld as varchar) set @sql = 'select * from sysobjects (nolock) where name = '''+ @table2_name + '''' exec ( @sql) if ( @@ROWCOUNT = 0) begin set @sql = 'exec lin_MakeLogTable ''' + @table2_name + '''' exec (@sql) end -- check log_data0 ( view ) set @view_name = @strDate + 'log_data0_' + cast (@nWorld as varchar) set @sql = 'select * from sysobjects (nolock) where name = '''+ @view_name + '''' exec ( @sql) if ( @@ROWCOUNT = 0) begin -- set @sql = 'exec lin_MakeLogTable ''' + @table_name + '''' set @sql = 'CREATE VIEW dbo.' + @view_name + ' ( ' + ' act_time, log_id, actor, actor_account, target, target_account, location_x, location_y, location_z, ' + 'etc_str1, etc_str2, etc_str3, ' + 'etc_num1, etc_num2, etc_num3, etc_num4, etc_num5, etc_num6, etc_num7, etc_num8, etc_num9, etc_num10, ' + 'STR_actor, STR_actor_account, STR_target, STR_target_account, item_id ' + ' ) AS ' + ' SELECT act_time, log_id, actor, actor_account, target, target_account, location_x, location_y, location_z, ' + ' etc_str1, etc_str2, etc_str3, ' + ' etc_num1, etc_num2, etc_num3, etc_num4, etc_num5, etc_num6, etc_num7, etc_num8, etc_num9, etc_num10, ' + ' STR_actor, STR_actor_account, STR_target, STR_target_account, item_id ' + ' from ' + @table_name + ' (nolock) UNION ALL ' + ' SELECT act_time, log_id, actor, actor_account, target, target_account, location_x, location_y, location_z, ' + ' etc_str1, etc_str2, etc_str3, ' + ' etc_num1, etc_num2, etc_num3, etc_num4, etc_num5, etc_num6, etc_num7, etc_num8, etc_num9, etc_num10, ' + ' STR_actor, STR_actor_account, STR_target, STR_target_account, item_id ' + ' from ' + @table_audit_name + ' (nolock) UNION ALL ' + ' SELECT act_time, log_id, actor, actor_account, target, target_account, location_x, location_y, location_z, ' + ' etc_str1, etc_str2, etc_str3, ' + ' etc_num1, etc_num2, etc_num3, etc_num4, etc_num5, etc_num6, etc_num7, etc_num8, etc_num9, etc_num10, ' + ' STR_actor, STR_actor_account, STR_target, STR_target_account, item_id ' + ' from ' + @table2_name + ' (nolock) ' exec (@sql) end -- check chat set @table_name = @strDate + 'log_chat_' + cast (@nWorld as varchar) set @sql = 'select * from sysobjects (nolock) where name = '''+ @table_name + '''' exec ( @sql) if ( @@ROWCOUNT = 0) begin set @sql = 'exec lin_MakeChatLogTable ''' + @table_name + '''' exec (@sql) end GO NEW VERSION 5.9.6 - more optimisations, more falures check, more command options! Full L2Admin interface compatible http://game.aaanet.ru/tools/la2/la2_logd.5.9.6.zip |
|
|
|
|