1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 11:46:37 +02:00

Bug #1382 - Save maxusercount and maxusertime

This commit is contained in:
Adam
2012-03-13 16:58:14 -04:00
parent cff91a532f
commit beae4775cf
+27 -1
View File
@@ -13,6 +13,30 @@
#include "module.h"
struct Stats : Serializable
{
Anope::string serialize_name() const
{
return "Stats";
}
serialized_data serialize() anope_override
{
serialized_data data;
data["maxusercnt"] << maxusercnt;
data["maxusertime"] << maxusertime;
return data;
}
static void unserialize(serialized_data &data)
{
data["maxusercnt"] >> maxusercnt;
data["maxusertime"] >> maxusertime;
}
};
/**
* Count servers connected to server s
* @param s The server to start counting from
@@ -187,10 +211,12 @@ class CommandOSStats : public Command
class OSStats : public Module
{
CommandOSStats commandosstats;
SerializeType stats_type;
Stats stats_saver;
public:
OSStats(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandosstats(this)
commandosstats(this), stats_type("Stats", Stats::unserialize)
{
this->SetAuthor("Anope");