mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 08:15:35 +00:00
test state commit
This commit is contained in:
parent
57a58b1a38
commit
8c967a5608
@ -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; }
|
||||||
|
@ -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 {};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user