You're not making much sense to me. I suggest you read the api docs again or maybe have a look at one of the unitsync users like SpringLobby or Tasclient.
Joined: 08 Feb 2010, 22:21 Location: Saint-Petersburg, Russia
SpringLobby loads "MapNameList" and "ModNameList" through iterating all the maps and mods. If we want to find any map we just need to verify it in the list. I thought of a such way. so no other way exists I think.
I think you can check for existence of a single map like this:
If you get a '0' return value from calling GetMapInfo with the map's name and GetNextError returns a string starting with "Could not find a map" after the call, that means the map doesn't exist. (See the 'throw' statement in GetMapFile inside unitsync.cpp for the exact wording on error message)
The way the check is implemented internally in ArchiveScanner is by iterating through all maps:
Code:
for (std::map<std::string, ArchiveInfo>::const_iterator aii = archiveInfo.begin(); aii != archiveInfo.end(); ++aii) { if (s == aii->second.archiveData.name) { return aii->second.archiveData.mapfile; } }
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum