Show / Hide Table of Contents

Class Stats

Inheritance
System.Object
Stats
Implements
IStats
IDisplayablePlugin
IGUIPlugin
IServerPlugin
IHasDisplayTabs
IDisplayTab
IThreadedPlugin
IShutdownablePlugin
IInitializablePlugin
IConfigurablePlugin
IEditablePlugin
System.IDisposable
Namespace: Eco.Stats
Assembly: Eco.Stats.dll
Syntax
public class Stats : Object, IStats, IDisplayablePlugin, IGUIPlugin, IServerPlugin, IHasDisplayTabs, IDisplayTab, IThreadedPlugin, IShutdownablePlugin, IInitializablePlugin, IConfigurablePlugin, IEditablePlugin, IDisposable

Constructors

Stats()

Declaration
public Stats()

Stats(PluginConfig<StatsConfig>, String)

Declaration
public Stats(PluginConfig<StatsConfig> config, string storageDirectory)
Parameters
Type Name Description
PluginConfig<StatsConfig> config
System.String storageDirectory

Fields

GetStatsTime

Declaration
public static Func<double> GetStatsTime
Field Value
Type Description
System.Func<System.Double>

Properties

ParamChanged

Declaration
public ThreadSafeAction<object, string> ParamChanged { get; set; }
Property Value
Type Description
ThreadSafeAction<System.Object, System.String>

PluginConfig

Declaration
public IPluginConfig PluginConfig { get; }
Property Value
Type Description
IPluginConfig

Methods

AddIndex(String, String)

Declaration
public void AddIndex(string collectionName, string propName)
Parameters
Type Name Description
System.String collectionName
System.String propName

AddIndex(Type, String)

Declaration
public void AddIndex(Type type, string propName)
Parameters
Type Name Description
System.Type type
System.String propName

AddTimeIndex(StatInfo)

Declaration
public void AddTimeIndex(StatInfo info)
Parameters
Type Name Description
StatInfo info

CountStat(String, Single, Double, Int32)

Returns count for stat. For ICountStat it will use sum of value in Count property, otherwise it will return count of records. If you need info for several users you should avoid use it, use CountStatPerPlayer instead.

Declaration
public float CountStat(string stat, float time, double withinSeconds, int userID)
Parameters
Type Name Description
System.String stat
System.Single time
System.Double withinSeconds
System.Int32 userID
Returns
Type Description
System.Single

CountStat(Type, Single, Double, Int32)

Returns count for stat. For ICountStat it will use sum of value in Count property, otherwise it will return count of records. If you need info for several users you should avoid use it, use CountStatPerPlayer instead.

Declaration
public float CountStat(Type stat, float time, double withinSeconds, int userID)
Parameters
Type Name Description
System.Type stat
System.Single time
System.Double withinSeconds
System.Int32 userID
Returns
Type Description
System.Single

CountStatPerPlayer(String, Single, Double)

Returns a dictionary userId -> value of stat for all users existed. Usefull if you need data for every user, this will be much faster than run CountStat user by user.

Declaration
public Dictionary<int, float> CountStatPerPlayer(string stat, float time, double withinSeconds)
Parameters
Type Name Description
System.String stat
System.Single time
System.Double withinSeconds
Returns
Type Description
System.Collections.Generic.Dictionary<System.Int32, System.Single>

CountStatPerPlayer(Type, Single, Double)

Declaration
public Dictionary<int, float> CountStatPerPlayer(Type stat, float time, double withinSeconds)
Parameters
Type Name Description
System.Type stat
System.Single time
System.Double withinSeconds
Returns
Type Description
System.Collections.Generic.Dictionary<System.Int32, System.Single>

DeltaValue(String, Int32)

Declaration
public float DeltaValue(string collection, int time)
Parameters
Type Name Description
System.String collection
System.Int32 time
Returns
Type Description
System.Single

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Finalize()

Declaration
protected override void Finalize()

Flush()

Declaration
public void Flush()

GetCategory()

Declaration
public string GetCategory()
Returns
Type Description
System.String

GetDisplayText()

Declaration
public string GetDisplayText()
Returns
Type Description
System.String

GetEditObject()

Declaration
public object GetEditObject()
Returns
Type Description
System.Object

GetStatus()

Declaration
public string GetStatus()
Returns
Type Description
System.String

Initialize(TimedTask)

Declaration
public void Initialize(TimedTask timer)
Parameters
Type Name Description
TimedTask timer

MostRecentValue(String)

Declaration
public float MostRecentValue(string collection)
Parameters
Type Name Description
System.String collection
Returns
Type Description
System.Single

OnEditObjectChanged(Object, String)

Declaration
public void OnEditObjectChanged(object o, string param)
Parameters
Type Name Description
System.Object o
System.String param

QueryCollection<T>(String)

Declaration
public List<T> QueryCollection<T>(string collectionName)
Parameters
Type Name Description
System.String collectionName
Returns
Type Description
System.Collections.Generic.List<T>
Type Parameters
Name Description
T

QueryFirstBefore(String, Int32)

Returns TimeValue recorded before or at time.

Declaration
public TimeValue QueryFirstBefore(string collectionName, int time)
Parameters
Type Name Description
System.String collectionName
System.Int32 time
Returns
Type Description
TimeValue

QueryNeighbors(String, Int32)

Declaration
public List<TimeValue> QueryNeighbors(string collectionName, int second)
Parameters
Type Name Description
System.String collectionName
System.Int32 second
Returns
Type Description
System.Collections.Generic.List<TimeValue>

QueryRangeGeneric(StatInfo, Int32, Int32)

Declaration
public IEnumerable<BsonDocument> QueryRangeGeneric(StatInfo info, int startingSecond, int endingSecond)
Parameters
Type Name Description
StatInfo info
System.Int32 startingSecond
System.Int32 endingSecond
Returns
Type Description
System.Collections.Generic.IEnumerable<LiteDB.BsonDocument>

QueryTimeValueRange(StatInfo, Int32, Int32)

Declaration
public List<TimeValue> QueryTimeValueRange(StatInfo info, int startingSecond, int endingSecond)
Parameters
Type Name Description
StatInfo info
System.Int32 startingSecond
System.Int32 endingSecond
Returns
Type Description
System.Collections.Generic.List<TimeValue>

QueryTimeValueRange(String, Int32, Int32)

Declaration
public List<TimeValue> QueryTimeValueRange(string collectionName, int startingSecond, int endingSecond)
Parameters
Type Name Description
System.String collectionName
System.Int32 startingSecond
System.Int32 endingSecond
Returns
Type Description
System.Collections.Generic.List<TimeValue>

Record(IStat)

Declaration
public void Record(IStat obj)
Parameters
Type Name Description
IStat obj

Record(Int32, String, Single)

Do a simple time/value record.

Declaration
public void Record(int time, string collection, float value)
Parameters
Type Name Description
System.Int32 time
System.String collection
System.Single value

RecordBulk(IEnumerable<IStat>)

Declaration
public void RecordBulk(IEnumerable<IStat> objs)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IStat> objs

RecordCustom(String, Int32, Single, Int32, Nullable<Single>)

Declaration
public void RecordCustom(string statName, int time, float count, int userId, Nullable<float> value)
Parameters
Type Name Description
System.String statName
System.Int32 time
System.Single count
System.Int32 userId
System.Nullable<System.Single> value

Run()

Declaration
public void Run()

ShutdownAsync()

Declaration
public Task ShutdownAsync()
Returns
Type Description
System.Threading.Tasks.Task

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

Implements

IStats
IDisplayablePlugin
IGUIPlugin
IServerPlugin
IHasDisplayTabs
IDisplayTab
IThreadedPlugin
IShutdownablePlugin
IInitializablePlugin
IConfigurablePlugin
IEditablePlugin
System.IDisposable
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾