Initial work on TCP transport layer:

* Optionally compiled additional TCP transport layer.
* Config to enable it.
* Tested and functional with lcdr's tcpudp dll, udp being disabled in the dll due to port issues.
* Removed unused RakNet replica manager and id manager. We've got our own replica manager since pre-open-source.
* Utilizes async boost behavior.

Todo:
* Figure out how to do ping calculations.
* Fix crashes on universe shutdown.
* Test TLS on a VPS.
* Remove unnecessary logging.
* Test with lots of clients.
* Finish "master" to "manager" naming refactor.
This commit is contained in:
wincent
2024-10-13 22:42:59 +02:00
parent 8d54db7851
commit 4004534732
28 changed files with 2341 additions and 386 deletions

View File

@@ -5,6 +5,7 @@
#include "Database.h"
#include "Logger.h"
#include "Game.h"
#include "dServer.h"
//! The persistent ID request
struct PersistentIDRequest {
@@ -25,7 +26,7 @@ namespace {
void ObjectIDManager::RequestPersistentID(const std::function<void(uint32_t)> callback) {
const auto& request = Requests.emplace_back(++CurrentRequestID, callback);
MasterPackets::SendPersistentIDRequest(Game::server, request.requestID);
MasterPackets::SendPersistentIDRequest(Game::server->GetTransportLayerPtr(), request.requestID);
}
//! Handles a persistent ID response

View File

@@ -45,9 +45,10 @@
// Enums
#include "eGameMasterLevel.h"
#include "eMasterMessageType.h"
#include "eManagerMessageType.h"
#include "eInventoryType.h"
#include "ePlayerFlag.h"
#include <RakNetTransportLayer.h>
namespace DEVGMCommands {
@@ -503,7 +504,7 @@ namespace DEVGMCommands {
void ShutdownUniverse(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
//Tell the master server that we're going to be shutting down whole "universe":
CBITSTREAM;
BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN_UNIVERSE);
BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eManagerMessageType::SHUTDOWN_UNIVERSE);
Game::server->SendToMaster(bitStream);
ChatPackets::SendSystemMessage(sysAddr, u"Sent universe shutdown notification to master.");
@@ -1247,8 +1248,16 @@ namespace DEVGMCommands {
scriptedActivityComponent->ReloadConfig();
}
Game::server->UpdateMaximumMtuSize();
Game::server->UpdateBandwidthLimit();
if (Game::server->GetTransportType() == TransportType::RakNet) {
const auto& transport = Game::server->GetTransportLayer();
auto* raknetTransport = static_cast<RakNetTransportLayer*>(transport.get());
raknetTransport->UpdateMaximumMtuSize();
raknetTransport->UpdateBandwidthLimit();
}
ChatPackets::SendSystemMessage(sysAddr, u"Successfully reloaded config for world!");
}