-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsv-main.cpp
More file actions
38 lines (31 loc) · 1.19 KB
/
Copy pathsv-main.cpp
File metadata and controls
38 lines (31 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "argparser.hpp"
#include "GCClient.hpp"
#include "server.hpp"
int main(int argc, char** argv)
{
ArgParser parser;
parser.AddOption("-version", "CSGO Server version", OptionAttr::RequiredWithValue, OptionValueType::STRING);
parser.AddOption("-port", "Server listening port", OptionAttr::RequiredWithValue, OptionValueType::INT16U);
parser.AddOption("-gslt", "Game server logon token", OptionAttr::OptionalWithValue, OptionValueType::STRING);
parser.AddOption("-rdip", "Redirect IP address (e.g. 127.0.0.1:27015)", OptionAttr::OptionalWithValue, OptionValueType::STRING);
parser.AddOption("-vac", "Enable VAC?", OptionAttr::OptionalWithoutValue, OptionValueType::NONE);
parser.AddOption("-mirror", "Enable mirroring server info from redrecting server?", OptionAttr::OptionalWithoutValue, OptionValueType::NONE);
try
{
parser.ParseArgument(argc, argv);
}
catch (const std::exception& e)
{
printf("%s\n", e.what());
return -1;
}
if (parser.HasOption("-mirror") && !parser.HasOption("-rdip"))
{
printf("When -mirror is enabled, you have to provide a redirect server socket by option -rdip\n");
return -1;
}
Server sv(parser);
sv.InitializeServer();
sv.RunServer();
return 0;
}