summaryrefslogtreecommitdiffstats
path: root/AnvilStats/AnvilStats.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-27 22:02:25 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-27 22:02:25 +0200
commit6ccc4e36743485c50c58ec0f43d08181ba20958a (patch)
tree09de7f83dda7b2d856de21caaf2b25e73a15f45e /AnvilStats/AnvilStats.cpp
parentMade Anvil the default storage schema (diff)
downloadcuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar
cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.gz
cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.bz2
cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.lz
cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.xz
cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.zst
cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.zip
Diffstat (limited to '')
-rw-r--r--AnvilStats/AnvilStats.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/AnvilStats/AnvilStats.cpp b/AnvilStats/AnvilStats.cpp
new file mode 100644
index 000000000..1682f76f0
--- /dev/null
+++ b/AnvilStats/AnvilStats.cpp
@@ -0,0 +1,53 @@
+
+// AnvilStats.cpp
+
+// Implements the main app entrypoint
+
+#include "Globals.h"
+#include "Statistics.h"
+#include "Processor.h"
+
+
+
+
+
+int main(int argc, char * argv[])
+{
+ if (argc < 2)
+ {
+ LOG("Usage: %s <method number> [<world folder>]", argv[0]);
+ LOG("\nNo method number present, aborting.");
+ return -1;
+ }
+
+ AString WorldFolder;
+ if (argc > 2)
+ {
+ WorldFolder = argv[2];
+ }
+ else
+ {
+ WorldFolder = "." + cFile::PathSeparator;
+ }
+
+ cCallbackFactory * Factory = NULL;
+ switch (atol(argv[1]))
+ {
+ case 0: Factory = new cStatisticsFactory; break;
+ default:
+ {
+ LOG("Unknown method \"%s\", aborting.", argv[1]);
+ return -2;
+ }
+ }
+ cProcessor Processor;
+ Processor.ProcessWorld(WorldFolder, *Factory);
+
+ delete Factory;
+
+ LOG("Done");
+}
+
+
+
+