Zappy Server
C++ game server: world, rules, scheduler, network
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
#include <iostream>
2
3
#include "core/Args.hpp"
4
#include "
core/Server.hpp
"
5
6
int
main
(
int
argc,
char
** argv)
7
{
8
Args
args(argc, argv);
9
if
(!args.
isValid
() || args.
isHelpRequested
())
return
args.
exitCode
();
10
11
try
{
12
Server
server(args.
getConfig
());
13
server.
run
();
14
}
catch
(
const
std::exception& e) {
15
std::cerr <<
"Fatal: "
<< e.what() <<
"\n"
;
16
return
1;
17
}
18
return
0;
19
}
Server.hpp
Args
Definition
Args.hpp:43
Args::exitCode
int exitCode() const
Gets the exit code for the application.
Definition
Args.cpp:93
Args::getConfig
ServerConfig getConfig() const
Gets the configuration for the server application.
Definition
Args.cpp:91
Args::isHelpRequested
bool isHelpRequested() const
Checks if the help flag was provided in the arguments.
Definition
Args.cpp:90
Args::isValid
bool isValid() const
Checks if the parsed arguments are valid and if the application should run.
Definition
Args.cpp:89
Server
Owns every subsystem and runs the main game loop.
Definition
Server.hpp:20
Server::run
void run()
Run the game loop until the process is stopped.
Definition
Server.cpp:98
main
int main(int argc, char **argv)
Definition
main.cpp:6
server
src
main.cpp
Generated by
1.9.8