-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable unity build to speed up compilation
- Loading branch information
1 parent
f52b7dc
commit af68e33
Showing
7 changed files
with
146 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "otpch.h" | ||
|
||
#include "configmanager.h" | ||
#include "otserv.h" | ||
#include "tools.h" | ||
|
||
extern ConfigManager g_config; | ||
|
||
static bool argumentsHandler(const std::vector<std::string_view>& args) | ||
{ | ||
for (const auto& arg : args) { | ||
if (arg == "--help") { | ||
std::clog << "Usage:\n" | ||
"\n" | ||
"\t--config=$1\t\tAlternate configuration file path.\n" | ||
"\t--ip=$1\t\t\tIP address of the server.\n" | ||
"\t\t\t\tShould be equal to the global IP.\n" | ||
"\t--login-port=$1\tPort for login server to listen on.\n" | ||
"\t--game-port=$1\tPort for game server to listen on.\n"; | ||
return false; | ||
} else if (arg == "--version") { | ||
printServerVersion(); | ||
return false; | ||
} | ||
|
||
auto tmp = explodeString(arg, "="); | ||
|
||
if (tmp[0] == "--config") | ||
g_config.setString(ConfigKeysString::CONFIG_FILE, tmp[1]); | ||
else if (tmp[0] == "--ip") | ||
g_config.setString(ConfigKeysString::IP, tmp[1]); | ||
else if (tmp[0] == "--login-port") | ||
g_config.setInteger(ConfigKeysInteger::LOGIN_PORT, std::stoi(tmp[1].data())); | ||
else if (tmp[0] == "--game-port") | ||
g_config.setInteger(ConfigKeysInteger::GAME_PORT, std::stoi(tmp[1].data())); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
int main(int argc, const char** argv) | ||
{ | ||
std::vector<std::string_view> args(argv, argv + argc); | ||
if (!argumentsHandler(args)) { | ||
return 1; | ||
} | ||
|
||
startServer(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2023 The Forgotten Server Authors. All rights reserved. | ||
// Use of this source code is governed by the GPL-2.0 License that can be found in the LICENSE file. | ||
|
||
#ifndef FS_OTSERV_H | ||
#define FS_OTSERV_H | ||
|
||
void printServerVersion(); | ||
void startServer(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters