Raised This Month: $344 Target: $400
 86%   Almost there!

[ANY] Log Connections


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Player 1
Member
Join Date: Apr 2012
Plugin ID:
3389
Plugin Version:
1.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    94 
    Plugin Description:
    Logs player connect and disconnect times, SteamID, IP, connection time, disonnnect reason
    Old 11-28-2012 , 19:32   [ANY] Log Connections
    Reply With Quote #1

    Description:
    This plugin logs players' connect and disconnect times along with their Name, SteamID, and IP Address to a text file at /sourcemod/logs/connections/ seperate from the server logs. Players will only be logged when they fully connect and disconnect from the server. (as apposed to every map change in the generic server logs)

    This could be useful to go back and ban a hacker / cheater without having to dig through the messy server logs.

    A new log file will be created every day. The information on each line will be ordered as follows:

    <Time> - <Name> <SteamID> <IP> Connected from <Country>
    <Time> - <Name> <SteamID> <IP> Disconnected after <#> minutes. <Reason>

    Here is an example log from 28_Nov_2012.txt
    Code:
    16:58:34 - ===== Map change to metro =====
    
    17:02:41 - <Xander> <STEAM_1:0:XXXX> <108.XXX.XX.XXX> CONNECTED from <United States>
    17:04:35 - <Xander> <STEAM_1:0:XXXX> <108.XXX.XX.XXX> DISCONNECTED after 3 minutes. <Kicked by administrator>
    17:05:07 - <Xander> <STEAM_1:0:XXXX> <108.XXX.XX.XXX> CONNECTED from <United States>
    
    17:05:31 - ===== Map change to silo =====
    
    17:06:47 - <Xander> <STEAM_1:0:XXXX> <108.XXX.XX.XXX> DISCONNECTED after 2 minutes. <Xander timed out>
    Attached Files
    File Type: sp Get Plugin or Get Source (logconnections.sp - 5655 views - 4.0 KB)

    Last edited by Player 1; 02-02-2013 at 11:47. Reason: ready for review
    Player 1 is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Old 11-28-2012 , 20:13   Re: [ANY] Log Connections
    Reply With Quote #2

    Very cool. Thanks!
    Sreaper is offline
    island55
    Senior Member
    Join Date: Aug 2010
    Location: charleston
    Old 11-28-2012 , 21:27   Re: [ANY] Log Connections
    Reply With Quote #3

    very useful

    thanks
    island55 is offline
    SHAREN
    Senior Member
    Join Date: Dec 2011
    Old 11-29-2012 , 01:02   Re: [ANY] Log Connections
    Reply With Quote #4

    I have long wanted this plugin, but you could have added counts from time to connect up to the entry to the game that is the time during which the player downloads the card model and sounds.
    translate.google.ru

    And it would be nice if it showed a number of players before changing the card and how much is left after map change
    For examle
    Spoiler

    or even better
    Spoiler

    Because the plugin does not include players who are disabled during map changes

    Last edited by SHAREN; 11-29-2012 at 07:43.
    SHAREN is offline
    Send a message via Skype™ to SHAREN
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 11-29-2012 , 12:52   Re: [ANY] Log Connections
    Reply With Quote #5

    You should consider using the LogToFileEx function instead of manually opening and closing files each time you write to them.

    For that matter, you may want to use OpenFile in OnPluginStart and CloseFile in OnPluginEnd, then use LogToOpenFileEx to write to the log... although FlushFile OnMapEnd wouldn't be a bad idea in that case.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 11-29-2012 at 12:53.
    Powerlord is offline
    Player 1
    Member
    Join Date: Apr 2012
    Old 11-29-2012 , 13:44   Re: [ANY] Log Connections
    Reply With Quote #6

    Quote:
    Originally Posted by SHAREN View Post
    you could have added counts from time to connect up to the entry to the game that is the time during which the player downloads the card model and sounds.

    Because the plugin does not include players who are disabled during map changes
    I'm sorry, I don't understand the first part, but the plugin will log players who disconnect during map change.


    Quote:
    Originally Posted by Powerlord View Post
    You should consider using the LogToFileEx function instead of manually opening and closing files each time you write to them.

    For that matter, you may want to use OpenFile in OnPluginStart and CloseFile in OnPluginEnd, then use LogToOpenFileEx to write to the log... although FlushFile OnMapEnd wouldn't be a bad idea in that case.
    I didn't notice these functions before, thanks. LogToFileEx could simplify the code, but is it any more efficient that what I've done?
    Player 1 is offline
    SHAREN
    Senior Member
    Join Date: Dec 2011
    Old 11-29-2012 , 22:19   Re: [ANY] Log Connections
    Reply With Quote #7

    Quote:
    Originally Posted by Player 1 View Post
    I'm sorry, I don't understand the first part, but the plugin will log players who disconnect during map change.
    If the player left the game when changing map, the plugin will not log it.
    And I wonder how many players disconnect when the map changes.
    SHAREN is offline
    Send a message via Skype™ to SHAREN
    Player 1
    Member
    Join Date: Apr 2012
    Old 11-30-2012 , 16:31   Re: [ANY] Log Connections
    Reply With Quote #8

    Well I just tested and (at least on Nuclear Dawn) players will be logged during map change when disconnecting on their own or for failing to download files or what have you.

    You can tell from this example that I disconnected 2 seconds after map change. Here I set cl_allowdownload 0 on my client and changed my server to a custom map:
    Code:
    15:19:59 - <Xander> <STEAM_1:0:XXXX> <108.XXX.XXX.XXX> CONNECTED from <Unknown>
    
    15:20:34 - ===== Map change to sk_plaza =====
    
    15:20:36 - <Xander> <STEAM_1:0:XXXX> <108.XXX.XXX.XXX> DISCONNECTED after -1 minutes. <Disconnect by user.>
    I assumed these generic server events are the same across all mods, but perhaps they aren't. What game are you running?

    Last edited by Player 1; 11-30-2012 at 16:33.
    Player 1 is offline
    SHAREN
    Senior Member
    Join Date: Dec 2011
    Old 12-01-2012 , 02:27   Re: [ANY] Log Connections
    Reply With Quote #9

    cs source
    Try to find some players who joined, and no disconnection of the log (for the duration of 12 hours)
    translate.google.ru
    SHAREN is offline
    Send a message via Skype™ to SHAREN
    [email protected]
    New Member
    Join Date: Nov 2012
    Location: Germany
    Old 12-03-2012 , 17:39   Re: [ANY] Log Connections
    Reply With Quote #10

    Nice dude
    __________________
    Fire@FIGHTER is offline
    Send a message via Skype™ to Fire@FIGHTER
    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 20:15.


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