Adds a more advanced and detailed investigate command, and adds the ability to query stored data in other plugins. Once upon a time there was a more detailed investigate command in Unturned, this plugin bassically re-adds that and more.
Plugin Dev’s can also look at the source code for the plugin on git for a better idea of how the plugin works.
- /investigate <playername | SteamID | IP address > [page number] – Shows list of players that match search query.
- rnint <new instance name> – Changes the instance name stored in the database that is used to tie the player info data to this server. This would be used for when you want to change the instance name on the server, you would need to run this command prior to restarting the server after the change. Console only command.
- delint <Instance ID> – Deletes all the player info data for the given Instance ID, use with caution, and it’s recommended to make a Database backup first. This command may take some time to complete if there’s a lot of data to remove. Console only command.
- investigate – allows you to use the investigate command.
- DatabaseAddress – The address to the Mysql database server.
- DatabaseUserName – Your username on the Mysql server.
- DatabasePassword – Your username password on the Mysql server.
- DatabaseName – The database you want the tables stored in.
- DatabaseTableName – The Name of the tables you want to use for the plugin.
- KeepaliveInterval – The length of time in minutes between each ping to the mysql server, the plugin uses a persistent connection to the Mysql server. Default 10 minutes.
- CacheTime – Time in number of minutes that records that were retrieved by steam id should be retrieved out of the cache instead of the database. This will speed up retrieval of data from this plugin in other plugins. Default 180 minutes, or 3 hours.
- ExpiredCheckInterval – How often to check the cache and and player data for expired data.
- ExpiresAfter – Used to set how long to keep player info records in the database, in days. Set to 0 to disable this feature.
- VipCheckGroupName – Use what you have set as the id for the vip group on your server(case sinsitive.), defaults to “vip.”
- public PlayerData PlayerInfoLib.Database.QueryById(CSteamID steamId, bool cached = true) – For getting data by SteamID. First param is the CSteamID of the player you want to lookup, the second is an optional param, set to false if you want to skip the cache when looking up player data. Returns a PlayerData typed object.
- public List<PlayerData> PlayerInfoLib.Database.QueryByName(string playerName, QueryType queryType, out uint totalRecods, bool pagination = true, uint page = 1, uint limit = 4) – For getting data by name or ip address. First param is the name of the player or the ip of a player you want to look up, the second is the query type you want to perform, there’s four possible ones you can use: SteamName, CharName, Both, IP. totalRecords returns the number of records found in the query. The next three are optional params, that are used for pagination of the output. This returns a List of PlayerData typed data.
- These methods will try to find players that have played on the server it being queried on first before looking for the info for the last server they played on.
- SteamID, SteamName, CharacterName, IP – The primary data for the player.
- LastLoginGlobal – The last time They were seen on any server, in DateTime format.
- TotalPlayTime – The total amount of time that a player has played on the server’s in seconds.
- LastLoginLocal – The last time they’ve played on the server that this data has been queried on, in DateTime format.
- LastServerName – The name of the last server they played on.
- Other data:
- LastServerID – The instance id of the last server the player played on, used in the IsLocal method in the class.
- ServerID – The instance id of either the local server, the last server the player played on if a local record wasn’t found for the player, or 0 if no record for the last server they played on was found.
- CacheTime – Stores the DateTime of when the data was stored in the cache.
- CleanedBuildables and CleanedPlayerData – For future use in the wrecking ball plugin.
- IsLocal() – Checks to see if the data in the class belongs to this server or not.
- IsValid() – Checks to see if the data is valid, this will be false if the player data wasn’t found by a steam id search.
- IsCacheExpired() – Used for checking to see if the data has expired or not(for Caching).
- IsVip() – Returns if the player has Vip on the server. Searches all groups a player has to find a match to the group name set in the plugin config. For players in higher groups, it requires that these groups inherit the vip group, in the inheritence chain, for this to come back as true.
- 188.8.131.52: This update adds two commands(check the commands secotion on their usege), and an automatic player data cleanup feature player data that is older than the time set in the config. You will need to delete and regenerate the translations file for this update, as it adds more translations lines.
- 184.108.40.206: Updated the database to handle emoji characters and other special 4 byte UTF8 characters(required conversion of the steam/char name tables to utf8mb4.).
- 220.127.116.11: Add an IsVip feature to the player data class. Works by searching through set and inherited groups for a group that matches what is in the config.
<?xml version="1.0" encoding="utf-8"?>
<PlayerInfoLibConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Default english translation
Commands and permissions
Fix MySQL statement on QueryById
Fixing the weird mysql statements
Add a IsVip feature to the player data class.
Update the database schema to allow emoji characters, 4 byte UTF8 characters.
Update to Unturned 18.104.22.168
Lib output script for my plugins.
Added house keeping commands and code, and some other misc fixes/changes.
Reworked the player component a little bit.
Move portion of the code that updates the player info on connect, as the ip address isn't always set fully by this time.
Fixed bug with getting the cleanup list
Update to add support for the auto cleanup feature in the wrecking ball plugin.
Rework the GetInstanceID method again.
Fix a Mysql Reader bug in getting the instance id.
Samll bug fix, typo in the time played formatting.
Added a total play time feature, that shows the total time that a player has played on the server's in this database.
Small change to the QueryByName method.
Fix one small bug, it total record output in the QueryByName method.
Changed the IP column to a UInt32 type, saves space in both the data is uses and the index space.
More formatting of the investigate output, Misc.
INCOMPLETE: worked on the formatting of the investigate command some more, and also added the ability to search by IP address.
INCOMPLETE: Tweaked the Queries to be a little less complex while working the same way as the other one, and ordered named output by newest global time first.
INCOMPLETE: FIxed a typo in one of the queries, done some more work in the investigate output(needs to be shortened for output to the chat ingame though.)
INCOMPLETE: Tweaked the queries some more, added some data checking methods to the PlayerData class.
INCOMPLETE: Simplify the QueryByName method a bit.
INCOMPLETE: Tweaked the sql queries, Further testing needed on QueryByName.
INCOMPLETE: Working save function, Mostly working info query methods(needs tweaking with the sql.), incomplete investigate command.
22.214.171.124: Incomplete investigate command, incomplete QueryByID and QueryByName methods, Working player info saving.