-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 (#4545)
- Loading branch information
Showing
7 changed files
with
144 additions
and
117 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(ConfigManager::CONFIG_FILE, tmp[1]); | ||
else if (tmp[0] == "--ip") | ||
g_config.setString(ConfigManager::IP, tmp[1]); | ||
else if (tmp[0] == "--login-port") | ||
g_config.setNumber(ConfigManager::LOGIN_PORT, std::stoi(tmp[1].data())); | ||
else if (tmp[0] == "--game-port") | ||
g_config.setNumber(ConfigManager::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
fee42e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ClCompile Include="..\src\main.cpp" />
is missing invc17/theforgottenserver.vcxproj
file