ttrts/source/client/main.cpp

35 lines
621 B
C++
Raw Normal View History

#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 )
{
2014-12-29 21:54:34 +00:00
std::cout<<sk_usage<<std::endl;
return -1;
}
// Attempt to open the game file
std::string arg1 = argv[1];
2015-01-02 15:06:04 +00:00
// 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
2015-01-02 15:06:04 +00:00
return runFromFilesystem(argc,argv);
};