mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-26 14:00:22 +00:00
test state commit
This commit is contained in:
1 parent
57a58b1a38
commit
8c967a5608
2 files changed
+3
-1
No files matched your search
@@ -71,6 +71,7 @@ public:
|
|||||||
void ClearCars();
|
void ClearCars();
|
||||||
[[nodiscard]] int GetID() const { return mID; }
|
[[nodiscard]] int GetID() const { return mID; }
|
||||||
[[nodiscard]] int GetUnicycleID() const { return mUnicycleID; }
|
[[nodiscard]] int GetUnicycleID() const { return mUnicycleID; }
|
||||||
|
bool mUDPCONNECTED = false;
|
||||||
[[nodiscard]] bool IsConnected() const { return mIsConnected; }
|
[[nodiscard]] bool IsConnected() const { return mIsConnected; }
|
||||||
[[nodiscard]] bool IsSynced() const { return mIsSynced; }
|
[[nodiscard]] bool IsSynced() const { return mIsSynced; }
|
||||||
[[nodiscard]] bool IsSyncing() const { return mIsSyncing; }
|
[[nodiscard]] bool IsSyncing() const { return mIsSyncing; }
|
||||||
|
|||||||
+2
-1
@@ -105,6 +105,7 @@ void TNetwork::UDPServerMain() {
|
|||||||
} else {
|
} else {
|
||||||
Client->SetUDPAddr(client);
|
Client->SetUDPAddr(client);
|
||||||
Client->SetIsConnected(true);
|
Client->SetIsConnected(true);
|
||||||
|
Client->mUDPCONNECTED = true;
|
||||||
}
|
}
|
||||||
Client->UdpReceived += Data.size();
|
Client->UdpReceived += Data.size();
|
||||||
++Client->UdpPacketsReceived;
|
++Client->UdpPacketsReceived;
|
||||||
@@ -387,7 +388,7 @@ bool TNetwork::TCPSend(TClient& c, const std::vector<uint8_t>& Data, bool IsSync
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<uint8_t> TNetwork::TCPRcv(TClient& c) {
|
std::vector<uint8_t> TNetwork::TCPRcv(TClient& c) {
|
||||||
if (c.IsDisconnected()) {
|
if (c.IsDisconnected() || (c.mUDPCONNECTED && !c.IsConnected())) {
|
||||||
beammp_error("Client disconnected, cancelling TCPRcv");
|
beammp_error("Client disconnected, cancelling TCPRcv");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user