Quote:
Originally Posted by Barameu
Here is a tip
Code:
int nCount = g_UserMng.GetCount();
if (dwTick > m_dwTickBuffServer)
{
if (nCount >= 100)
{
DoBuff
}
}
|
First of all, that is silly.
I personally would find it to be much better to apply the buff when a user logs on to the server rather than having it a "tick". Then the buff should last unsigned long max size for the timer.
This way, you would remove the buff when the requirements are not met when the user logs on or a user on the server logs off. This way, you're not doing DoBuff() for all users multiple times in the lifetime of the user like some of the systems out there.
You can just do it when the online count changes and requirements are or are not met. When the requirements are not met, you can iterate over the user map and remove the buff and vice versa.