mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
SendToAll: also send while syncing
the missed packet queue handles this case
This commit is contained in:
committed by
Anonymous275
parent
83145d7466
commit
05c5fb047c
@@ -104,6 +104,12 @@ void TTCPServer::Authentication(SOCKET TCPSock) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AuthResponse.IsObject()) {
|
||||
ClientKick(*Client, "Backend returned invalid auth response format.");
|
||||
error("Backend returned invalid auth response format. This should never happen.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (AuthResponse["username"].IsString() && AuthResponse["roles"].IsString()
|
||||
&& AuthResponse["guest"].IsBool() && AuthResponse["identifiers"].IsArray()) {
|
||||
|
||||
@@ -166,7 +172,6 @@ bool TTCPServer::TCPSend(TClient& c, const std::string& Data, bool IsSync) {
|
||||
c.EnqueueMissedPacketDuringSyncing(Data);
|
||||
return true;
|
||||
} else if (!c.IsSyncing() && c.IsSynced() && c.MissedPacketQueueSize() != 0) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
while (c.MissedPacketQueueSize() > 0) {
|
||||
std::string QData = c.MissedPacketQueue().front();
|
||||
c.MissedPacketQueue().pop();
|
||||
|
||||
@@ -97,7 +97,7 @@ void TUDPServer::SendToAll(TClient* c, const std::string& Data, bool Self, bool
|
||||
if (!ClientPtr.expired()) {
|
||||
auto Client = ClientPtr.lock();
|
||||
if (Self || Client.get() != c) {
|
||||
if (Client->IsSynced()) {
|
||||
if (Client->IsSynced() || Client->IsSyncing()) {
|
||||
if (Rel || C == 'W' || C == 'Y' || C == 'V' || C == 'E') {
|
||||
if (C == 'O' || C == 'T' || Data.length() > 1000)
|
||||
mTCPServer.SendLarge(*Client, Data);
|
||||
|
||||
Reference in New Issue
Block a user