mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 22:23:03 +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
+6
-1
@@ -104,6 +104,12 @@ void TTCPServer::Authentication(SOCKET TCPSock) {
|
|||||||
return;
|
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()
|
if (AuthResponse["username"].IsString() && AuthResponse["roles"].IsString()
|
||||||
&& AuthResponse["guest"].IsBool() && AuthResponse["identifiers"].IsArray()) {
|
&& AuthResponse["guest"].IsBool() && AuthResponse["identifiers"].IsArray()) {
|
||||||
|
|
||||||
@@ -166,7 +172,6 @@ bool TTCPServer::TCPSend(TClient& c, const std::string& Data, bool IsSync) {
|
|||||||
c.EnqueueMissedPacketDuringSyncing(Data);
|
c.EnqueueMissedPacketDuringSyncing(Data);
|
||||||
return true;
|
return true;
|
||||||
} else if (!c.IsSyncing() && c.IsSynced() && c.MissedPacketQueueSize() != 0) {
|
} else if (!c.IsSyncing() && c.IsSynced() && c.MissedPacketQueueSize() != 0) {
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
||||||
while (c.MissedPacketQueueSize() > 0) {
|
while (c.MissedPacketQueueSize() > 0) {
|
||||||
std::string QData = c.MissedPacketQueue().front();
|
std::string QData = c.MissedPacketQueue().front();
|
||||||
c.MissedPacketQueue().pop();
|
c.MissedPacketQueue().pop();
|
||||||
|
|||||||
+1
-1
@@ -97,7 +97,7 @@ void TUDPServer::SendToAll(TClient* c, const std::string& Data, bool Self, bool
|
|||||||
if (!ClientPtr.expired()) {
|
if (!ClientPtr.expired()) {
|
||||||
auto Client = ClientPtr.lock();
|
auto Client = ClientPtr.lock();
|
||||||
if (Self || Client.get() != c) {
|
if (Self || Client.get() != c) {
|
||||||
if (Client->IsSynced()) {
|
if (Client->IsSynced() || Client->IsSyncing()) {
|
||||||
if (Rel || C == 'W' || C == 'Y' || C == 'V' || C == 'E') {
|
if (Rel || C == 'W' || C == 'Y' || C == 'V' || C == 'E') {
|
||||||
if (C == 'O' || C == 'T' || Data.length() > 1000)
|
if (C == 'O' || C == 'T' || Data.length() > 1000)
|
||||||
mTCPServer.SendLarge(*Client, Data);
|
mTCPServer.SendLarge(*Client, Data);
|
||||||
|
|||||||
Reference in New Issue
Block a user