mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-10 02:08:20 +00:00
parent
38eb441ca1
commit
51dd56f0a0
@ -1762,6 +1762,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
|
|
||||||
scriptedActivityComponent->ReloadConfig();
|
scriptedActivityComponent->ReloadConfig();
|
||||||
}
|
}
|
||||||
|
Game::server->UpdateMaximumMtuSize();
|
||||||
Game::server->UpdateBandwidthLimit();
|
Game::server->UpdateBandwidthLimit();
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"Successfully reloaded config for world!");
|
ChatPackets::SendSystemMessage(sysAddr, u"Successfully reloaded config for world!");
|
||||||
}
|
}
|
||||||
|
@ -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; }
|
} else { mLogger->Log("dServer", "FAILED TO START SERVER ON IP/PORT: %s:%i", ip.c_str(), port); return; }
|
||||||
|
|
||||||
mLogger->SetLogToConsole(prevLogSetting);
|
mLogger->SetLogToConsole(prevLogSetting);
|
||||||
mPeer->SetMTUSize(1228); // This is hard coded by lu for some reason.
|
|
||||||
//Connect to master if we are not master:
|
//Connect to master if we are not master:
|
||||||
if (serverType != ServerType::Master) {
|
if (serverType != ServerType::Master) {
|
||||||
SetupForMasterConnection();
|
SetupForMasterConnection();
|
||||||
@ -188,6 +188,7 @@ bool dServer::Startup() {
|
|||||||
mPeer->SetIncomingPassword("3.25 DARKFLAME1", 15);
|
mPeer->SetIncomingPassword("3.25 DARKFLAME1", 15);
|
||||||
} else {
|
} else {
|
||||||
UpdateBandwidthLimit();
|
UpdateBandwidthLimit();
|
||||||
|
UpdateMaximumMtuSize();
|
||||||
mPeer->SetIncomingPassword("3.25 ND1", 8);
|
mPeer->SetIncomingPassword("3.25 ND1", 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,6 +198,11 @@ bool dServer::Startup() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dServer::UpdateMaximumMtuSize() {
|
||||||
|
auto maxMtuSize = mConfig->GetValue("maximum_mtu_size");
|
||||||
|
mPeer->SetMTUSize(maxMtuSize.empty() ? 1228 : std::stoi(maxMtuSize));
|
||||||
|
}
|
||||||
|
|
||||||
void dServer::UpdateBandwidthLimit() {
|
void dServer::UpdateBandwidthLimit() {
|
||||||
auto newBandwidth = mConfig->GetValue("maximum_outgoing_bandwidth");
|
auto newBandwidth = mConfig->GetValue("maximum_outgoing_bandwidth");
|
||||||
mPeer->SetPerConnectionOutgoingBandwidthLimit(!newBandwidth.empty() ? std::stoi(newBandwidth) : 0);
|
mPeer->SetPerConnectionOutgoingBandwidthLimit(!newBandwidth.empty() ? std::stoi(newBandwidth) : 0);
|
||||||
|
@ -57,6 +57,7 @@ public:
|
|||||||
ReplicaManager* GetReplicaManager() { return mReplicaManager; }
|
ReplicaManager* GetReplicaManager() { return mReplicaManager; }
|
||||||
void UpdateReplica();
|
void UpdateReplica();
|
||||||
void UpdateBandwidthLimit();
|
void UpdateBandwidthLimit();
|
||||||
|
void UpdateMaximumMtuSize();
|
||||||
|
|
||||||
int GetPing(const SystemAddress& sysAddr) const;
|
int GetPing(const SystemAddress& sysAddr) const;
|
||||||
int GetLatestPing(const SystemAddress& sysAddr) const;
|
int GetLatestPing(const SystemAddress& sysAddr) const;
|
||||||
|
@ -26,5 +26,13 @@ dump_folder=
|
|||||||
# Either the folder with /res or with /client and /versions
|
# Either the folder with /res or with /client and /versions
|
||||||
client_location=
|
client_location=
|
||||||
|
|
||||||
# The maximum outgoing bandwidth in bits
|
# The maximum outgoing bandwidth in bits. If your clients are having
|
||||||
|
# issues with enemies taking a while to catch up to them, increse this value.
|
||||||
maximum_outgoing_bandwidth=80000
|
maximum_outgoing_bandwidth=80000
|
||||||
|
|
||||||
|
# The Maximum Translation Unit (MTU) size for packets. If players are
|
||||||
|
# getting stuck at 55% on the loading screen, lower this number to
|
||||||
|
# reduce the chances of packet loss. This value only has an effect
|
||||||
|
# from 512 <= maximum_mtu_size <= 1492 so make sure to keep this
|
||||||
|
# value within that range.
|
||||||
|
maximum_mtu_size=1228
|
||||||
|
Loading…
Reference in New Issue
Block a user