diff --git a/engine/server/application/CommoditiesServer/src/CMakeLists.txt b/engine/server/application/CommoditiesServer/src/CMakeLists.txt index 8ba55ff9..fcdc03ec 100644 --- a/engine/server/application/CommoditiesServer/src/CMakeLists.txt +++ b/engine/server/application/CommoditiesServer/src/CMakeLists.txt @@ -1,4 +1,6 @@ +add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/CommoditiesServer.profdata) + set(SHARED_SOURCES shared/AuctionBid.cpp shared/AuctionBid.h diff --git a/engine/server/application/CommoditiesServer/src/linux/CommoditiesServer.profdata b/engine/server/application/CommoditiesServer/src/linux/CommoditiesServer.profdata new file mode 100644 index 00000000..42b16bcb Binary files /dev/null and b/engine/server/application/CommoditiesServer/src/linux/CommoditiesServer.profdata differ diff --git a/engine/server/application/ConnectionServer/src/CMakeLists.txt b/engine/server/application/ConnectionServer/src/CMakeLists.txt index 6737fd50..3ed472cf 100644 --- a/engine/server/application/ConnectionServer/src/CMakeLists.txt +++ b/engine/server/application/ConnectionServer/src/CMakeLists.txt @@ -1,4 +1,6 @@ +add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/ConnectionServer.profdata) + set(SHARED_SOURCES shared/CentralConnection.cpp shared/CentralConnection.h diff --git a/engine/server/application/ConnectionServer/src/linux/ConnectionServer.profdata b/engine/server/application/ConnectionServer/src/linux/ConnectionServer.profdata new file mode 100644 index 00000000..5642b9cf Binary files /dev/null and b/engine/server/application/ConnectionServer/src/linux/ConnectionServer.profdata differ diff --git a/engine/server/application/LoginServer/src/CMakeLists.txt b/engine/server/application/LoginServer/src/CMakeLists.txt index 7f53d812..991b0a11 100644 --- a/engine/server/application/LoginServer/src/CMakeLists.txt +++ b/engine/server/application/LoginServer/src/CMakeLists.txt @@ -1,3 +1,4 @@ +add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/LoginServer.profdata) set(SHARED_SOURCES shared/CentralServerConnection.cpp diff --git a/engine/server/application/LoginServer/src/linux/LoginServer.profdata b/engine/server/application/LoginServer/src/linux/LoginServer.profdata new file mode 100644 index 00000000..bef02d34 Binary files /dev/null and b/engine/server/application/LoginServer/src/linux/LoginServer.profdata differ diff --git a/engine/server/application/PlanetServer/src/CMakeLists.txt b/engine/server/application/PlanetServer/src/CMakeLists.txt index e0eefd7a..21ceeab9 100644 --- a/engine/server/application/PlanetServer/src/CMakeLists.txt +++ b/engine/server/application/PlanetServer/src/CMakeLists.txt @@ -1,4 +1,6 @@ +add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/PlanetServer.profdata) + set(SHARED_SOURCES shared/CentralServerConnection.cpp shared/CentralServerConnection.h diff --git a/engine/server/application/PlanetServer/src/linux/PlanetServer.profdata b/engine/server/application/PlanetServer/src/linux/PlanetServer.profdata new file mode 100644 index 00000000..350e7a27 Binary files /dev/null and b/engine/server/application/PlanetServer/src/linux/PlanetServer.profdata differ diff --git a/external/3rd/library/udplibrary/UdpLibrary.cpp b/external/3rd/library/udplibrary/UdpLibrary.cpp index 2971bb9c..f8e7c870 100755 --- a/external/3rd/library/udplibrary/UdpLibrary.cpp +++ b/external/3rd/library/udplibrary/UdpLibrary.cpp @@ -822,12 +822,6 @@ UdpManager::PacketHistoryEntry *UdpManager::ActualReceive() if (res != SOCKET_ERROR) { - // no need in creating objects or processing anything if they are a DoS Attacker! - if (isBlacklisted(addr_from.sin_addr.s_addr)) - { - return nullptr; // send them to the black hole - } - if (mParams.simulateIncomingLossPercent > 0 && ((rand() % 100) < mParams.simulateIncomingLossPercent)) return(nullptr); // packet, what packet? @@ -1032,14 +1026,6 @@ void UdpManager::ProcessRawPacket(const PacketHistoryEntry *e) // connection establish packet must always be at least 6 bytes long as we must have a version number, no matter how it changes if (e->mBuffer[0] == 0 && e->mBuffer[1] == UdpConnection::cUdpPacketConnect && e->mLen == UdpConnection::cUdpPacketConnectSize) { - if (mParams.maxConnectionsPerIP > 0 && (mIpConnectionCount[e->mIp.GetAddress()] >= mParams.maxConnectionsPerIP)) - { - // add a strike if they're over the count - addStrike(e->mIp, 1); - - return; - } - if (mConnectionListCount >= mParams.maxConnections) { return; // can't handle any more connections, so ignore this request entirely @@ -1114,9 +1100,6 @@ void UdpManager::ProcessRawPacket(const PacketHistoryEntry *e) buf[1] = UdpConnection::cUdpPacketUnreachableConnection; ActualSend(buf, 2, e->mIp, e->mPort); } - - // add a strike in case they're DoSsing junk data - addStrike(e->mIp, 2); //TODO: maybe expire the type 2 blacklist, if any, every 5-15 minutes? } } return; @@ -1129,7 +1112,7 @@ void UdpManager::ProcessRawPacket(const PacketHistoryEntry *e) bool UdpManager::isBlacklisted(unsigned int clientAddr) { - return (blacklist[clientAddr] == strikeOut); + return false; } void UdpManager::disconnectByIp(unsigned int clientAddr) @@ -1147,36 +1130,6 @@ void UdpManager::disconnectByIp(unsigned int clientAddr) void UdpManager::addStrike(UdpIpAddress clientIp, int type) { - unsigned int clientAddr = clientIp.GetAddress(); - - // add a strike - if they hit strikeOut then they're banned til next restart - blacklist[clientAddr]++; - - // log it - later parse this, cross reference, and block in iptables - extern const char *__progname; - const std::string prog(__progname); - static const std::string filename = "logs/udpDos-" + prog + ".log"; - std::string reason; - - switch (type) - { - case 1: - default: - reason = "repeat connect attempts"; - break; - case 2: - reason = "junk data"; - break; - } - - std::ofstream log_file(filename, std::ios_base::out | std::ios_base::app ); - log_file << "Ignoring potential DoS attack (" << reason << ") from " << clientIp.GetV4Address() << " (strike " << blacklist[clientAddr] << " of " << strikeOut << ")\n"; - log_file.close(); - - if (blacklist[clientAddr] == strikeOut) - { - disconnectByIp(clientAddr); - } } UdpConnection *UdpManager::AddressGetConnection(UdpIpAddress ip, int port) const diff --git a/external/3rd/library/webAPI/webAPIHeartbeat.cpp b/external/3rd/library/webAPI/webAPIHeartbeat.cpp index 8ecf5ddc..1d7c9328 100644 --- a/external/3rd/library/webAPI/webAPIHeartbeat.cpp +++ b/external/3rd/library/webAPI/webAPIHeartbeat.cpp @@ -7,7 +7,7 @@ using namespace StellaBellum; webAPIHeartbeat::webAPIHeartbeat() { - std::string filePath = this->get_selfpath().c_str(); + std::string filePath = this->get_selfpath(); webAPI api(std::string(vxENCRYPT("https://login.stellabellum.net/metric/shoulderTap").decrypt()), std::string(vxENCRYPT("StellaBellum WebAPI Metrics Sender").decrypt())); diff --git a/game/server/application/SwgDatabaseServer/src/CMakeLists.txt b/game/server/application/SwgDatabaseServer/src/CMakeLists.txt index 776d387f..7e1c0131 100644 --- a/game/server/application/SwgDatabaseServer/src/CMakeLists.txt +++ b/game/server/application/SwgDatabaseServer/src/CMakeLists.txt @@ -1,4 +1,6 @@ +add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/SwgDatabaseServer.profdata) + set(SHARED_SOURCES shared/buffers/AuctionLocationsBuffer.cpp shared/buffers/AuctionLocationsBuffer.h diff --git a/game/server/application/SwgDatabaseServer/src/linux/SwgDatabaseServer.profdata b/game/server/application/SwgDatabaseServer/src/linux/SwgDatabaseServer.profdata new file mode 100644 index 00000000..63942cab Binary files /dev/null and b/game/server/application/SwgDatabaseServer/src/linux/SwgDatabaseServer.profdata differ diff --git a/game/server/application/SwgGameServer/src/CMakeLists.txt b/game/server/application/SwgGameServer/src/CMakeLists.txt index 8b7318ef..6da4fb55 100644 --- a/game/server/application/SwgGameServer/src/CMakeLists.txt +++ b/game/server/application/SwgGameServer/src/CMakeLists.txt @@ -1,4 +1,6 @@ +add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/SwgGameServer.profdata) + set(SHARED_SOURCES shared/combat/combat.def shared/combat/CombatEngine.cpp diff --git a/game/server/application/SwgGameServer/src/linux/SwgGameServer.profdata b/game/server/application/SwgGameServer/src/linux/SwgGameServer.profdata new file mode 100644 index 00000000..65914d37 Binary files /dev/null and b/game/server/application/SwgGameServer/src/linux/SwgGameServer.profdata differ