A lot of updates
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "InstanceHandler.h"
|
||||
#include "VirtualServer.h"
|
||||
#include "./manager/ConversationManager.h"
|
||||
#include "./music/MusicBotManager.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::chrono;
|
||||
@@ -12,7 +13,6 @@ using namespace ts::server;
|
||||
using namespace ts::protocol;
|
||||
using namespace ts::buffer;
|
||||
|
||||
extern InstanceHandler* serverInstance;
|
||||
inline void banClientFlood(VirtualServer* server, const shared_ptr<ConnectedClient>& cl, time_point<system_clock> until){
|
||||
auto time = until.time_since_epoch().count() == 0 ? 0L : chrono::ceil<chrono::seconds>(until - system_clock::now()).count();
|
||||
|
||||
@@ -21,7 +21,7 @@ inline void banClientFlood(VirtualServer* server, const shared_ptr<ConnectedClie
|
||||
|
||||
for(const auto &client : server->findClientsByUid(cl->getUid())) {
|
||||
server->notify_client_ban(client, server->getServerRoot(), reason, time);
|
||||
client->closeConnection(system_clock::now() + seconds(1));
|
||||
client->close_connection(system_clock::now() + seconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void VirtualServer::executeServerTick() {
|
||||
lastTick = system_clock::now();
|
||||
|
||||
system_clock::time_point timing_begin, timing_end;
|
||||
milliseconds timing_update_states, timing_client_tick, timing_channel, timing_statistic, timing_groups, timing_ccache;
|
||||
milliseconds timing_update_states, timing_client_tick, timing_channel, timing_statistic, timing_groups, timing_ccache, music_manager;
|
||||
|
||||
auto client_list = this->getClients();
|
||||
|
||||
@@ -269,6 +269,12 @@ void VirtualServer::executeServerTick() {
|
||||
END_TIMINGS(timing_ccache);
|
||||
}
|
||||
|
||||
{
|
||||
BEGIN_TIMINGS();
|
||||
this->musicManager->execute_tick();
|
||||
END_TIMINGS(music_manager);
|
||||
}
|
||||
|
||||
if(system_clock::now() - lastTick > milliseconds(100)) {
|
||||
//milliseconds timing_update_states, timing_client_tick, timing_channel, timing_statistic;
|
||||
logError(this->serverId, "Server tick tooks to long ({}ms => Status updates: {}ms Client tick: {}ms, Channel tick: {}ms, Statistic tick: {}ms, Groups: {}ms, Conversation cache: {}ms)",
|
||||
|
||||
Reference in New Issue
Block a user