Raised This Month: $32 Target: $400
 8% 

Last Seen v0.1 (5/21)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
FLOOR_MASTER
Senior Member
Join Date: Mar 2008
Plugin ID:
387
Plugin Version:
0.1
Plugin Category:
Statistical
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Display when a user was last seen.
    Old 05-22-2008 , 00:57   Last Seen v0.1 (5/21)
    Reply With Quote #1

    Last Seen allows you to easily find out when a player was last on the server or any number of servers if using a common database. Last Seen is compatible with both MySQL and SQLite, but you will naturally only be able to use the multi-server search functionality with MySQL.

    In the simplest case, Last Seen can tell you when a particular player was last on the server...



    Last Seen handles multiple matches by displaying them most recently seen first:


    Last Seen can display matches that were on a different server:
    Configuration
    • seen_db_config (default "default")
      • Specifies what configuration in addons/sourcemod/configs/database.cfg to use to connect to a MySQL or SQLite DB.
    • seen_table (default "last_seen")
      • The name of the database table to store Last Seen data in. If you run multiple servers, you may want to change this for different game types or for individual servers, depending on whether you servers share databases and whether you want Last Seen data shared across multiple servers.

    Commands
    • !seen <partial name match>
      • As shown in the above screenshots, display when the specified player was last seen

    Version History
    • 2008-05-21 - v0.1
      • Initial release

    Installation
    • Copy seen.smx to addons/sourcemod/scripting
    You do not need seen.inc unless you are developing plugins that use natives Last Seen provides.
    Attached Files
    File Type: sp Get Plugin or Get Source (seen.sp - 2051 views - 15.0 KB)
    File Type: inc seen.inc (1.8 KB, 588 views)
    FLOOR_MASTER is offline
    FLOOR_MASTER
    Senior Member
    Join Date: Mar 2008
    Old 05-22-2008 , 00:57   Re: Last Seen v0.1 (5/21)
    Reply With Quote #2

    For plugin developers...

    Natives
    • GetNameFromAuthString(const String:auth[], GetNameFromAuthStringCallback:callback, any:data=0)
      • From a SteamID, lookup the most recently used name and return the data to the specified callback function. See seen.inc for more details. Here's an example plugin:

        PHP Code:
        #include <sourcemod>
        #include <seen>

        public Plugin:myinfo = {
            
        name "Name",
            
        author "Author",
            
        description "Description"
            
        version "0.0.0.0",
            
        url "Internet"
        };

        public 
        OnPluginStart() {
            
        RegConsoleCmd("sm_lookup_name"Cmd_Lookup);
        }

        public 
        Action:Cmd_Lookup(clientargs) {
            
        decl String:arg[32];

            if (!
        args) {
                
        ReplyToCommand(client"usage: sm_lookup_name <steamid>");
                return 
        Plugin_Handled;
            }

            
        GetCmdArgString(argsizeof(arg));
            
        GetNameFromAuthString(argCB_GotNameFromAuthString);

            return 
        Plugin_Handled;
        }
            
        public 
        CB_GotNameFromAuthString(bool:result, const String:steamid[], const String:name[]) {
            if (
        result) {
                
        PrintToServer("For steamid \"%s\", found name \"%s\""steamidname);
            }
            else {
                
        PrintToServer("Could not find a name for steamid \"%s\""steamid);
            }

    FLOOR_MASTER is offline
    LocutusH
    Senior Member
    Join Date: Dec 2007
    Location: Hungary
    Old 05-22-2008 , 02:30   Re: Last Seen v0.1 (5/21)
    Reply With Quote #3

    Can you somehow code it, that the information is taken from the hlstatsx database? Since thats also logging this info.
    __________________
    LocutusH is offline
    Fredd
    Veteran Member
    Join Date: Jul 2007
    Old 05-22-2008 , 11:35   Re: Last Seen v0.1 (5/21)
    Reply With Quote #4

    FLOOR_MASTER: look good, but i suggest you use clientprefs.....
    __________________
    Need a private coder? AMXX, SourceMOD, MMS? PM me!
    Fredd is offline
    FLOOR_MASTER
    Senior Member
    Join Date: Mar 2008
    Old 05-22-2008 , 15:55   Re: Last Seen v0.1 (5/21)
    Reply With Quote #5

    I considered it but it seemed unsuitable because, from my understanding of clientprefs, clientprefs is more suited for accessing data on clients that are presently connected to the server. Last Seen's key feature is finding information about offline clients. Also, due to the lookup features I've added (lookup name for SteamID, independent of who is connected to the server) and plan to add, searching for the appropriate data through clientprefs is either grossly inefficient or impossible.
    FLOOR_MASTER is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 05-23-2008 , 03:36   Re: Last Seen v0.1 (5/21)
    Reply With Quote #6

    If only forums had a last seen option... lol What is with all these mysql plugins... Hlstatsx does this too.
    __________________

    DontWannaName is offline
    FLOOR_MASTER
    Senior Member
    Join Date: Mar 2008
    Old 05-24-2008 , 08:49   Re: Last Seen v0.1 (5/21)
    Reply With Quote #7

    Is that information provided in-game? I'm not too familiar with the full-featured stats packages so any feature overlap is not intentional (I simply sought to write a plugin that suited my needs and share it in case someone else had some utility for it).

    I did just now find out about the Last Connect History plugin which provides similar functionality. I'd note that Last Seen is more useful from a usability standpoint in that you can lookup players by name rather than SteamID. Last Seen also supports server-spanning lookups which is useful for larger communities.
    FLOOR_MASTER is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 05-24-2008 , 15:37   Re: Last Seen v0.1 (5/21)
    Reply With Quote #8

    Not bashing you, im sure people would use this. Online it tells you on hlstatsx when the player last joined the server.
    __________________

    DontWannaName is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 05-24-2008 , 15:41   Re: Last Seen v0.1 (5/21)
    Reply With Quote #9

    People don't always want all of the features of HLStatsX. It's nice if you just want this feature, but don't want everything that HLStatsX has to offer.
    bl4nk is offline
    tcviper
    Veteran Member
    Join Date: Oct 2005
    Location: Netherlands
    Old 05-26-2008 , 05:11   Re: Last Seen v0.1 (5/21)
    Reply With Quote #10

    __________________

    Last edited by tcviper; 06-02-2009 at 09:28.
    tcviper is offline
    Send a message via MSN to tcviper
    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 08:52.


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