• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

CTF AE FlagGrab exploit patch

Joined
Jan 9, 2009
Messages
614
Reaction score
152
So, I got tired of people refusing packets from other players (which allowed them to grab a CTF Flag without being attacked), and fixed it. Since it's a pretty nasty exploit, I thought i'd share the fix (Note: Not telling where you put this, people that have any business opening th esource should know where it goes and what to replace).

Fix:
if( !CheckBitSet(pItem->GetSpawnTypeFlags(), WORLD_ITEM_STAND_ALINE) )
{
//If PlayerCount < 4 let them grab the flag even if they cheat, it doesn't matter.
if ((int)ZGetCharacterManager()->size() >= 4 && ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_CTF)
{
int nFoulCount = 0;
int nPlayerCount = 0;
for (auto itor = ZGetGameClient()->GetPeers()->begin(); itor != ZGetGameClient()->GetPeers()->end(); ++itor)
{
ZCharacter* pCharacter = ZGetCharacterManager()->Find((*itor).first);
//Valid connection to teamm8's is unnecessary for this fix
if (pCharacter->GetTeamID() == ZGetGame()->m_pMyCharacter->GetTeamID())
continue;
//ignore a connection to yourself
if (pCharacter->GetUID() == ZGetGame()->m_pMyCharacter->GetUID())
continue;
//Increment based on enemies team size
nPlayerCount+=1;
//if you fail to connect to a player of the opposite team,increment foulcount
if (pCharacter->m_dwStatusBitPackingValue.Ref().m_bLostConEffect)
{
++nFoulCount;
}
}
//this is assuming both teams have equal players, critique it how you like
if (nFoulCount >= nPlayerCount)
{
//add a check to prevent spam if you want, i think it's rather useful to spam the message
ZChatOutput("Error: Unable to obtain flag, please check your connection and rejoin.");
return;
}
//all is well, allow the player to capture the flag
ZPostRequestObtainWorldItem(ZGetGameClient()->GetPlayerUID(), pItem->GetID());
}
else
ZPostRequestObtainWorldItem(ZGetGameClient()->GetPlayerUID(), pItem->GetID());
}
else
{
ZPostLocalEventOptainSpecialWorldItem(int(pItem->GetItemID()));
}
 
Back
Top