LabAPI Player Analytics Tool
KittsPlayerAnalyticsSystem is a tool that tracks when players join, leave, etc for SCP Secret Laboratory using LabAPI.
If you enjoy this project and would like to support future development, I would greatly appreciate it if you considered donating via my Ko-Fi.
The NuGet Package offers easy intergation of this tool. You can find the NuGet Packages here:
There are two options when it comes to installing KittsPlayerAnalyticsSystem, normal and MongoDB.
The difference between the two is that normal stores everything in a .JSON and MongoDB stores everything in a Mongo database.
To install KittsPlayerAnalyticsSystem on your server, you will need:
Newtonsoft.Jsonv13.0.4or later.KittsPlayerAnalyticsSystemlatest verion.
To install KittsPlayerAnalyticsSystem with MonogDB on your server, you will need:
DnsClientv1.6.1or later.Microsoft.Extensions.Logging.Abstractionsv2.0.0or later.MognoDB.Bsonv3.6.0or later.MongoDB.Driverv3.6.0or later.Newtonsoft.Jsonv13.0.4or later.KittsPlayerAnalyticsSystemlatest verion.
All of these files can be found in the latest release.
Once you have these:
- Place
DnsClient.dllin thedependenciesfolder, if applicable. - Place
Microsoft.Extensions.Logging.Abstractions.dllin thedependenciesfolder, if applicable. - Place
MognoDB.Bson.dllin thedependenciesfolder, if applicable. - Place
MognoDB.Driver.dllin thedependenciesfolder, if applicable. - Place
Newtonsoft.Json.dllin thedependenciesfolder. - Place
KittsInfractionSystem.dllin thepluginsfolder.
Run the server and you're set!
| Parameter | Type | Description | Default Value |
|---|---|---|---|
IsEnabled |
bool |
Is plugin enabled. | true |
Debug |
bool |
Sends debug logs to console. | false |
MongoDBURI |
string |
MongoDB URI. | "mongodb://username:password@ip:port/" |
MongoDBName |
string |
MongoDB name. | KittsPlayerAnalyticsSystem |
MongoDBCollectionName |
string |
MongoDB collection name if using database. | PlayerAnalyticsData |
UseMongoDB |
bool |
Should save to MongoDB, saves to JSON if flase, does not migrate data. | false |
PlayerAnalyticsPermission |
string |
Permission for player analytics command. | "kts.playeranalytics" |
# Is plugin enabled
is_enabled: true
# Sends debug logs to console
debug: false
# Permission for player analytics command
player_analytics_permission: kts.playeranalytics# Is plugin enabled
is_enabled: true
# Sends debug logs to console
debug: false
# MongoDB URI
mongo_d_b_u_r_i: mongodb://username:password@ip:port/
# MongoDB name
mongo_d_b_name: KittsPlayerAnalyticsSystem
# MongoDB collection name
mongo_d_b_collection_name: PlayerAnalyticsData
# Permission for player analytics command
player_analytics_permission: kts.playeranalyticsTo install in your project, simply reference the KittsPlayerAnalyticsSystem.dll file, found in the latest release.
KittsPlayerAnalyticsSystem.dll is mainly a tool and does not have much to offer when referencing, the most important part is the PlayerAnalyticAdded action which is called when an infraction is added.
| Parameter / Method | Type / Return Type | Description |
|---|---|---|
PlayerAnalyticAdded |
Action<PlayerAnalyticData> |
Action called when an PlayerAnalyticData is added. |
AddPlayerAnalytic(Player, PlayerAnalyticsType) |
void |
Adds a new PlayerAnalyticData to the database. |
GetPlayerAnalytic(string) |
IReadOnlyList<PlayerAnalyticData> |
Gets a list of all PlayerAnalyticData. |
GetPlayerAnalytics(TimePeriod) |
IReadOnlyList<PlayerAnalyticData> |
Gets a list of all PlayerAnalyticData matching the time period. |
GetPrettyPlayerAnalytic(PlayerAnalyticData) |
string |
Gets a pretty string of target PlayerAnalyticData. |
GetPrettyPlayerAnalytic(List<PlayerAnalyticData>) |
string |
Gets a pretty string from a list of PlayerAnalyticDatas. |
GetPrettyPlayerAnalytic(TimePeriod, PlayerAnalyticsType) |
string |
Gets a pretty string of all analytics matching the time period and type. |
GetPrettyPlayerAnalytic(TimePeriod) |
string |
Gets a pretty string of all analytics matching time period. |
GetPrettyColouredPlayerAnalytic(PlayerAnalyticData) |
string |
Gets a pretty coloured string of target PlayerAnalyticData. |
GetPrettyColouredPlayerAnalytics(List<PlayerAnalyticData>) |
string |
Gets a pretty coloured string from a list of PlayerAnalyticDatas. |
GetPrettyColouredPlayerAnalytics(TimePeriod, PlayerAnalyticsType) |
string |
Gets a pretty coloured string of all PlayerAnalyticDatas matching the time period and type. |
GetPrettyColouredPlayerAnalytics(TimePeriod) |
string |
Gets a pretty coloured string of all PlayerAnalyticDatas matching time period. |
I have decided to not include an exmaple as it's VERY easy to use, just attach you own function to the action as shwon below
public void OnPlayerAnalyticAdded(PlayerAnalyticData data)
{
// Do something when player analytic added
// For exmaple you can log the data to the console
}
// Make sure to attach the function to the action somewhere
PlayerAnalyticsManager.PlayerAnalyticAdded += OnPlayerAnalyticAdded;
If you have found a bug please make an issue on GitHub or the quickest way is to message me on discord at kittscloud.
Also message me on discord if you have feedback for me, I'd appreciate it very much. Thank you!