Skip to content

Commit

Permalink
Renaming COUNTID -> COUNTER
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathSpirit committed Jan 8, 2025
1 parent a06d6e3 commit a9f425e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions includes/FastEngine/network/C_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ class FGE_API PacketReorderer
enum class Stats
{
OLD_REALM,
OLD_COUNTID,
OLD_COUNTER,
WAITING_NEXT_REALM,
WAITING_NEXT_COUNTID,
WAITING_NEXT_COUNTER,
RETRIEVABLE
};

Expand Down
8 changes: 4 additions & 4 deletions sources/network/C_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ PacketReorderer::Stats PacketReorderer::checkStat(ProtocolPacketPtr const& packe

if (counter < currentCounter)
{ //We are missing a packet
return Stats::OLD_COUNTID;
return Stats::OLD_COUNTER;
}

//We can't switch to the next counter, we wait for the correct packet to arrive
return Stats::WAITING_NEXT_COUNTID;
return Stats::WAITING_NEXT_COUNTER;
}
bool PacketReorderer::isForced() const
{
Expand Down Expand Up @@ -144,11 +144,11 @@ PacketReorderer::Stats PacketReorderer::Data::checkStat(ProtocolPacket::CounterT

if (this->_counter < currentCounter)
{ //We are missing a packet
return Stats::OLD_COUNTID;
return Stats::OLD_COUNTER;
}

//We can't switch to the next counter, we wait for the correct packet to arrive
return Stats::WAITING_NEXT_COUNTID;
return Stats::WAITING_NEXT_COUNTER;
}

} // namespace fge::net
8 changes: 4 additions & 4 deletions sources/network/C_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ ServerNetFluxUdp::process(ClientSharedPtr& refClient, ProtocolPacketPtr& packet,

if ((headerFlags & FGE_NET_HEADER_DO_NOT_DISCARD_FLAG) == 0)
{
if (stat == PacketReorderer::Stats::OLD_COUNTID)
if (stat == PacketReorderer::Stats::OLD_COUNTER)
{
refClient->advanceLostPacketCount();
--this->_g_remainingPackets;
return FluxProcessResults::NOT_RETRIEVABLE;
}
}

if (stat == PacketReorderer::Stats::WAITING_NEXT_REALM || stat == PacketReorderer::Stats::WAITING_NEXT_COUNTID)
if (stat == PacketReorderer::Stats::WAITING_NEXT_REALM || stat == PacketReorderer::Stats::WAITING_NEXT_COUNTER)
{
refClient->advanceLostPacketCount(); //We are missing a packet
}
Expand Down Expand Up @@ -477,15 +477,15 @@ FluxProcessResults ClientSideNetUdp::process(ProtocolPacketPtr& packet)

if ((headerFlags & FGE_NET_HEADER_DO_NOT_DISCARD_FLAG) == 0)
{
if (stat == PacketReorderer::Stats::OLD_REALM || stat == PacketReorderer::Stats::OLD_COUNTID)
if (stat == PacketReorderer::Stats::OLD_REALM || stat == PacketReorderer::Stats::OLD_COUNTER)
{
this->_client.advanceLostPacketCount();
--this->_g_remainingPackets;
return FluxProcessResults::NOT_RETRIEVABLE;
}
}

if (stat == PacketReorderer::Stats::WAITING_NEXT_REALM || stat == PacketReorderer::Stats::WAITING_NEXT_COUNTID)
if (stat == PacketReorderer::Stats::WAITING_NEXT_REALM || stat == PacketReorderer::Stats::WAITING_NEXT_COUNTER)
{
this->_client.advanceLostPacketCount(); //We are missing a packet
}
Expand Down

0 comments on commit a9f425e

Please sign in to comment.