Raised This Month: $ Target: $400
 0% 

Writing logs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 08-16-2014 , 11:30   Re: Writing logs
Reply With Quote #1

The plugin just log the number of entries loaded from file. I don't see anything wrong.
If you want a proggresive count change the place of the "log" function like this:

PHP Code:
public LoadEliminates( )
{
    
    if( 
g_iEliminates )
    {
        
        
ArrayClearg_aData );
        
g_iEliminates 0;
    }
    
    new 
file128 ];
    
get_configsdirfilesizeof file ) -);
    
formatexfilesizeof file ) -1,"%s/%s"fileEliminateDataFile );
    
    
    if( 
file_existsfile ) )
    {
        new 
iFile fopenfile"rt" );
        
        new 
szDateAndTime32 ], szName32 ], szIp25 ], szSteamId35 ],
            
szAdminName32 ], szAdminIp25 ], szAdminSteamId35 ],
            
szReason32 ];
            
        new 
szFileData512 ], eDataeDatas ];
        
        while( !
feofiFile ) )
        
        {
            
fgetsiFileszFileDatasizeof szFileData ) - 1);
            
            if( !
szFileData] || szFileData] == ';'
                
|| ( szFileData] == '/' && szFileData] == '/' ) )
                continue;

            
parseszFileData,\
                
szDateAndTimesizeof (  szDateAndTime ) -1,\
                
szNamesizeof szName ) -1,\
                
szIpsizeof szIp ) -1,\
                
szSteamIdsizeof szSteamId ) -1,\
                
szAdminNamesizeof szAdminName ) -1,\
                
szAdminIpsizeof szAdminIp ) -1,\
                
szAdminSteamIdsizeof szAdminSteamId ) -1,\
                
szReasonsizeof szReason ) -);
            
            
            
copyeDataNAME ], sizeof eDataNAME ] ) -1szName );
            
copyeDataIP ], sizeof eDataIP ] ) -1szIp );
            
copyeDataAUTHID ], sizeof eDataAUTHID ] ) -1szSteamId );
            
copyeDataREASON ], sizeof eDataREASON ] ) -1szReason  );
            
copyeDataANAME ], sizeof eDataANAME ] ) -1szAdminName );
            
copyeDataAIP ], sizeof eDataAIP ] ) -1szAdminIp );
            
copyeDataAAUTHID ], sizeof eDataAAUTHID ] ) -1szAdminSteamId );
            
copyeDataTIME ], sizeof eDataTIME ] ) -1szDateAndTime );
            
            
ArrayPushArrayg_aDataeData );

            
Log"[INFO] - Am incarcat cu succes %d eliminari din %s"g_iEliminatesfile );
            
g_iEliminates++;
        }
        
        
fcloseiFile );
    }
    
    return 
0;

But you'll get as many logs as entries in the file for every time the function it's executed :/
__________________
Hey ^_^
NikKOo31 is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 08-16-2014 , 12:44   Re: Writing logs
Reply With Quote #2

Quote:
Originally Posted by NikKOo31 View Post
The plugin just log the number of entries loaded from file. I don't see anything wrong.
If you want a proggresive count change the place of the "log" function like this:

PHP Code:
public LoadEliminates( )
{
    
    if( 
g_iEliminates )
    {
        
        
ArrayClearg_aData );
        
g_iEliminates 0;
    }
    
    new 
file128 ];
    
get_configsdirfilesizeof file ) -);
    
formatexfilesizeof file ) -1,"%s/%s"fileEliminateDataFile );
    
    
    if( 
file_existsfile ) )
    {
        new 
iFile fopenfile"rt" );
        
        new 
szDateAndTime32 ], szName32 ], szIp25 ], szSteamId35 ],
            
szAdminName32 ], szAdminIp25 ], szAdminSteamId35 ],
            
szReason32 ];
            
        new 
szFileData512 ], eDataeDatas ];
        
        while( !
feofiFile ) )
        
        {
            
fgetsiFileszFileDatasizeof szFileData ) - 1);
            
            if( !
szFileData] || szFileData] == ';'
                
|| ( szFileData] == '/' && szFileData] == '/' ) )
                continue;

            
parseszFileData,\
                
szDateAndTimesizeof (  szDateAndTime ) -1,\
                
szNamesizeof szName ) -1,\
                
szIpsizeof szIp ) -1,\
                
szSteamIdsizeof szSteamId ) -1,\
                
szAdminNamesizeof szAdminName ) -1,\
                
szAdminIpsizeof szAdminIp ) -1,\
                
szAdminSteamIdsizeof szAdminSteamId ) -1,\
                
szReasonsizeof szReason ) -);
            
            
            
copyeDataNAME ], sizeof eDataNAME ] ) -1szName );
            
copyeDataIP ], sizeof eDataIP ] ) -1szIp );
            
copyeDataAUTHID ], sizeof eDataAUTHID ] ) -1szSteamId );
            
copyeDataREASON ], sizeof eDataREASON ] ) -1szReason  );
            
copyeDataANAME ], sizeof eDataANAME ] ) -1szAdminName );
            
copyeDataAIP ], sizeof eDataAIP ] ) -1szAdminIp );
            
copyeDataAAUTHID ], sizeof eDataAAUTHID ] ) -1szAdminSteamId );
            
copyeDataTIME ], sizeof eDataTIME ] ) -1szDateAndTime );
            
            
ArrayPushArrayg_aDataeData );

            
Log"[INFO] - Am incarcat cu succes %d eliminari din %s"g_iEliminatesfile );
            
g_iEliminates++;
        }
        
        
fcloseiFile );
    }
    
    return 
0;

But you'll get as many logs as entries in the file for every time the function it's executed :/
Thanks for your sugestion, but I waiting maybe somebody can resolve this issue.
smiley92 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-16-2014 , 20:10   Re: Writing logs
Reply With Quote #3

I honestly don't see any issues here (especially without the contents of EliminateData.txt after each map).

Here is my suggestion to convince your self that there is not a problem OR to convince you that what you thinking you are logging is not actually what you are logging:
  1. Make a copy of EliminateData.txt.
  2. Play a map, do what ever you do normally.
  3. Make another copy of EliminateData.txt.
  4. Play a map, do what ever you do normally.
  5. Make another copy of EliminateData.txt.

Attache all three files versions of EliminateData.txt to your next post along with AdvancedEliminate.log.
__________________

Last edited by fysiks; 08-16-2014 at 20:10.
fysiks is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 08-17-2014 , 13:24   Re: Writing logs
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
I honestly don't see any issues here (especially without the contents of EliminateData.txt after each map).

Here is my suggestion to convince your self that there is not a problem OR to convince you that what you thinking you are logging is not actually what you are logging:
  1. Make a copy of EliminateData.txt.
  2. Play a map, do what ever you do normally.
  3. Make another copy of EliminateData.txt.
  4. Play a map, do what ever you do normally.
  5. Make another copy of EliminateData.txt.

Attache all three files versions of EliminateData.txt to your next post along with AdvancedEliminate.log.
I don`t have right now a server hosted, and my IP network from PC is local 192.168... don`t have router to make port forwarding...

What can have this plugin?What issue?
smiley92 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2014 , 17:21   Re: Writing logs
Reply With Quote #5

Quote:
Originally Posted by smiley92 View Post
I don`t have right now a server hosted, and my IP network from PC is local 192.168... don`t have router to make port forwarding...
Then how are you getting the output that you've previously stated? Simply do what I requested while you test the plugin.


Quote:
Originally Posted by smiley92 View Post
What can have this plugin?What issue?
Everything you've given us so far indicates that there are NO issues with logging in your plugin. If you do as requested, we might be able to find out if there is something else wrong.
__________________

Last edited by fysiks; 08-17-2014 at 17:23.
fysiks is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 08-19-2014 , 08:01   Re: Writing logs
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
Then how are you getting the output that you've previously stated? Simply do what I requested while you test the plugin.




Everything you've given us so far indicates that there are NO issues with logging in your plugin. If you do as requested, we might be able to find out if there is something else wrong.
I don`y stay with my server hosted in pc, I must to buy another host to dedicated server, from one company to host my server/s.
Now I have local IP 192.168.x.x and I can connect to server just me.Do you understand?

I can test plugins, but just only me them see efect of plugins.



And don`t have a router or something like that to make port forwarding to have an IP real.
Please help me with that plugin, I need it!

Last edited by smiley92; 08-19-2014 at 08:06.
smiley92 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 08-19-2014 , 11:15   Re: Writing logs
Reply With Quote #7

We still have no idea what you are storing in EliminateData.txt

Follow fysiks advice and post the results

Quote:
Originally Posted by fysiks View Post
  1. Make a copy of EliminateData.txt.
  2. Play a map, do what ever you do normally.
  3. Make another copy of EliminateData.txt.
  4. Play a map, do what ever you do normally.
  5. Make another copy of EliminateData.txt.

Attache all three files versions of EliminateData.txt to your next post along with AdvancedEliminate.log.
__________________
Hey ^_^
NikKOo31 is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 08-19-2014 , 13:35   Re: Writing logs
Reply With Quote #8

Quote:
Originally Posted by NikKOo31 View Post
We still have no idea what you are storing in EliminateData.txt

Follow fysiks advice and post the results
Read my previous post, I can`t with my internet !!!

Last edited by smiley92; 08-19-2014 at 13:35.
smiley92 is offline
Reply



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 12:57.


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