Autor Wiadomość
Nigga
PostWysłany: Wto 14:21, 25 Mar 2008    Temat postu: [FIX] Auto Clear Map

Lo que hace es remover lo items que quedan en la memoria del hg, la idea es ponerle el timer a 24 horas, asi se evita delay y lag.



Kod:

 
dwItemCleanLastTime = GetTickCount();
   dwItemCleanDelay =432000000;   //432000k ms = 24 horas
   dwItemDeleteDelay = 216000000; //300k ms = 5 mins


24 horas dura el item en el piso y 5 min delay del item.


Kod:


 
void CGame::AutoClearMap()
{

int i, k, j, m_y, m_x;
short dX, dY;
char cMapName[11];

if (iDice(1,5) == 1) {
for (i = 0; i < DEF_MAXMAPS; i++) { //Enum all maps
if (m_pMapList[i] != NULL) { //Is allocated map
 m_x = m_pMapList[i]->m_sSizeX;
 m_y = m_pMapList[i]->m_sSizeY;
 for(j = 1; j < m_x; j++) {
  for(k = 1; k < m_y; k++){
   m_pMapList[i]->CleanTile(j, k, dwItemDeleteDelay);
  }
 }
}
}

for(i = 1; i < DEF_MAXCLIENTS; i++) {
if (m_pClientList[i] != NULL) {
dX = m_pClientList[i]->m_sX;
dY = m_pClientList[i]->m_sY;
ZeroMemory(cMapName,sizeof(cMapName));
strcpy(cMapName, m_pClientList[i]->m_cMapName);
RequestTeleportHandler(i,"2   ", cMapName, dX, dY);
}
}

PutLogList("(!!!) AutoClearMap Executed!");

//Update last clean time
dwItemCleanLastTime = GetTickCount();
}
}

Powered by phpBB © 2001,2002 phpBB Group