AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Last Seen v0.1 (5/21) (https://forums.alliedmods.net/showthread.php?t=71695)

FLOOR_MASTER 05-22-2008 00:57

Last Seen v0.1 (5/21)
 
2 Attachment(s)
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...
http://www.2fort2furious.com/images/lastseen_simple.png

http://www.2fort2furious.com/images/...en_simple2.png
Last Seen handles multiple matches by displaying them most recently seen first:
http://www.2fort2furious.com/images/lastseen_multi.png

http://www.2fort2furious.com/images/lastseen_multi2.png
Last Seen can display matches that were on a different server:
http://www.2fort2furious.com/images/lastseen_diffip.png
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.

FLOOR_MASTER 05-22-2008 00:57

Re: Last Seen v0.1 (5/21)
 
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);
          }



LocutusH 05-22-2008 02:30

Re: Last Seen v0.1 (5/21)
 
Can you somehow code it, that the information is taken from the hlstatsx database? Since thats also logging this info.

Fredd 05-22-2008 11:35

Re: Last Seen v0.1 (5/21)
 
FLOOR_MASTER: look good, but i suggest you use clientprefs.....

FLOOR_MASTER 05-22-2008 15:55

Re: Last Seen v0.1 (5/21)
 
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.

DontWannaName 05-23-2008 03:36

Re: Last Seen v0.1 (5/21)
 
If only forums had a last seen option... lol :P What is with all these mysql plugins... :D Hlstatsx does this too.

FLOOR_MASTER 05-24-2008 08:49

Re: Last Seen v0.1 (5/21)
 
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.

DontWannaName 05-24-2008 15:37

Re: Last Seen v0.1 (5/21)
 
Not bashing you, im sure people would use this. Online it tells you on hlstatsx when the player last joined the server.

bl4nk 05-24-2008 15:41

Re: Last Seen v0.1 (5/21)
 
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.

tcviper 05-26-2008 05:11

Re: Last Seen v0.1 (5/21)
 
:)


All times are GMT -4. The time now is 21:34.

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