mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
@@ -68,7 +68,7 @@ dServer::dServer(const std::string& ip, int port, int instanceID, int maxConnect
|
||||
} else { mLogger->Log("dServer", "FAILED TO START SERVER ON IP/PORT: %s:%i", ip.c_str(), port); return; }
|
||||
|
||||
mLogger->SetLogToConsole(prevLogSetting);
|
||||
mPeer->SetMTUSize(1228); // This is hard coded by lu for some reason.
|
||||
|
||||
//Connect to master if we are not master:
|
||||
if (serverType != ServerType::Master) {
|
||||
SetupForMasterConnection();
|
||||
@@ -188,6 +188,7 @@ bool dServer::Startup() {
|
||||
mPeer->SetIncomingPassword("3.25 DARKFLAME1", 15);
|
||||
} else {
|
||||
UpdateBandwidthLimit();
|
||||
UpdateMaximumMtuSize();
|
||||
mPeer->SetIncomingPassword("3.25 ND1", 8);
|
||||
}
|
||||
|
||||
@@ -197,6 +198,11 @@ bool dServer::Startup() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void dServer::UpdateMaximumMtuSize() {
|
||||
auto maxMtuSize = mConfig->GetValue("maximum_mtu_size");
|
||||
mPeer->SetMTUSize(maxMtuSize.empty() ? 1228 : std::stoi(maxMtuSize));
|
||||
}
|
||||
|
||||
void dServer::UpdateBandwidthLimit() {
|
||||
auto newBandwidth = mConfig->GetValue("maximum_outgoing_bandwidth");
|
||||
mPeer->SetPerConnectionOutgoingBandwidthLimit(!newBandwidth.empty() ? std::stoi(newBandwidth) : 0);
|
||||
|
@@ -57,6 +57,7 @@ public:
|
||||
ReplicaManager* GetReplicaManager() { return mReplicaManager; }
|
||||
void UpdateReplica();
|
||||
void UpdateBandwidthLimit();
|
||||
void UpdateMaximumMtuSize();
|
||||
|
||||
int GetPing(const SystemAddress& sysAddr) const;
|
||||
int GetLatestPing(const SystemAddress& sysAddr) const;
|
||||
|
Reference in New Issue
Block a user