summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-03-13 16:58:14 -0400
committerAdam <Adam@anope.org>2012-03-13 16:58:14 -0400
commitbeae4775cfd6692c30573a6e6ae4fa748d377fed (patch)
treeaa8ee9bea66d9280827c593e9545ebe759dc8aee
parentcff91a532f77bdcc68ebf116d4953f7436af6df6 (diff)
Bug #1382 - Save maxusercount and maxusertime
-rw-r--r--modules/commands/os_stats.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/modules/commands/os_stats.cpp b/modules/commands/os_stats.cpp
index afa3b7e19..19ac54a27 100644
--- a/modules/commands/os_stats.cpp
+++ b/modules/commands/os_stats.cpp
@@ -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");