ttrts/source/client/main.cpp
mdiluzio 3ed25cd37f Fix up all logging output
Remove debug logging
Use cerr or clog in the correct places
refactor a few more functions
2015-01-04 11:59:58 +00:00

34 lines
621 B
C++

#include "game.h"
#include "filesystem.h"
#include "server.h"
#include "client.h"
#include <iostream>
static const char* sk_usage =
#include "usage.h"
;
// Main program entry point
int main(int argc, char* argv[])
{
// If no args, print usage
if ( argc == 1 )
{
std::cout<<sk_usage<<std::endl;
return -1;
}
// Attempt to open the game file
std::string arg1 = argv[1];
// Either run the client, the server, or from local filesystem
if( arg1 == "client" )
return runClient(argc-1,argv+1);
else if ( arg1 == "server" )
return runServer(argc-1,argv+1);
else
return runFromFilesystem(argc,argv);
};