Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Patch * PatchMgr::FindPatchForClient(uint32 Version, const char * Locality)
- {
- Log.Debug("Patch", "Called");
- char tmplocality[5];
- uint32 ulocality;
- uint32 i;
- vector<Patch*>::iterator itr;
- Patch * fallbackPatch = NULL;
- for(i = 0; i < 4; ++i)
- tmplocality[i]= static_cast<char>( tolower(Locality[i]) );
- tmplocality[4]= 0;
- ulocality = *(uint32*)tmplocality;
- for(itr = m_patches.begin(); itr != m_patches.end(); ++itr)
- {
- // since localities are always 4 bytes we can do a simple int compare,
- // saving a string compare ;)
- Log.Debug("Patch", "Stuff %s", (*itr)->Version, (*itr)->uLocality);
- if((*itr)->uLocality==ulocality)
- {
- if(fallbackPatch== NULL && (*itr)->Version== 0)
- fallbackPatch = (*itr);
- if((*itr)->Version == Version)
- return (*itr);
- }
- }
- return fallbackPatch;
- }
Advertisement
Add Comment
Please, Sign In to add comment