AnvilStats: initial project import, can do block and biome statistics
git-svn-id: http://mc-server.googlecode.com/svn/trunk@895 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
53
AnvilStats/AnvilStats.cpp
Normal file
53
AnvilStats/AnvilStats.cpp
Normal file
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user