2015-01-02 14:04:37 +00:00
|
|
|
#include "game.h"
|
2015-01-02 14:09:29 +00:00
|
|
|
#include "filesystem.h"
|
2015-01-02 15:03:29 +00:00
|
|
|
#include "server.h"
|
|
|
|
#include "client.h"
|
2014-12-30 18:36:01 +00:00
|
|
|
|
2015-01-02 14:04:37 +00:00
|
|
|
#include <iostream>
|
2014-12-31 14:07:34 +00:00
|
|
|
|
2014-12-16 13:13:04 +00:00
|
|
|
static const char* sk_usage =
|
2014-12-18 13:40:54 +00:00
|
|
|
#include "usage.h"
|
|
|
|
;
|
2014-12-20 15:35:18 +00:00
|
|
|
|
2014-12-16 13:12:48 +00:00
|
|
|
// Main program entry point
|
2014-12-16 13:13:03 +00:00
|
|
|
int main(int argc, char* argv[])
|
2014-12-16 13:12:48 +00:00
|
|
|
{
|
2014-12-16 13:13:03 +00:00
|
|
|
// If no args, print usage
|
|
|
|
if ( argc == 1 )
|
|
|
|
{
|
2014-12-29 21:54:34 +00:00
|
|
|
std::cout<<sk_usage<<std::endl;
|
2014-12-30 18:36:01 +00:00
|
|
|
return -1;
|
2014-12-16 13:13:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Attempt to open the game file
|
2015-01-02 15:03:29 +00:00
|
|
|
std::string arg1 = argv[1];
|
2014-12-30 18:36:01 +00:00
|
|
|
|
2015-01-02 15:06:04 +00:00
|
|
|
// Either run the client, the server, or from local filesystem
|
2015-01-02 15:03:29 +00:00
|
|
|
if( arg1 == "client" )
|
2015-01-02 15:13:05 +00:00
|
|
|
return runClient(argc-1,argv+1);
|
2015-01-02 15:03:29 +00:00
|
|
|
else if ( arg1 == "server" )
|
2015-01-02 15:13:05 +00:00
|
|
|
return runServer(argc-1,argv+1);
|
2015-01-02 15:03:29 +00:00
|
|
|
else
|
2015-01-02 15:06:04 +00:00
|
|
|
return runFromFilesystem(argc,argv);
|
2014-12-16 13:13:03 +00:00
|
|
|
|
2014-12-16 13:33:11 +00:00
|
|
|
};
|
2015-01-04 11:59:58 +00:00
|
|
|
|