Not beefy enough to write this in Tutorials, but it's an interesting trick someone might find useful.
Due to how map sharing works, this will be very efficient on popular maps but somewhat misleading on casual maps.
How often in Wc3 did you see 10 games created with 10 different versions of the very same map spinoff (any Hero Wars, TD... name yours)? People don't usually know or care there's a newer version available and will just click on the first buggy/outdated map they come across, but if you can tell them they are two clicks away from downloading the newer version from Mapster, you are guaranteed to see it spread a little more quickly.
Create these new variables:
Real mapVersion = 3.01 (static, manually modify the number each time you update your map)
Real mapLatest, = mapVersion by default.
Real mapCheck, can be local inside map initialization trigger.
Real mapOwned[#] array where # is the number of max players
When you load player scores, personal stats and stuff you need with your FOR K cycle, also put in it something like this:
mapCheck = Real mapLatest key from bank[K] section any
IF mapCheck > mapLatest THEN mapLatest = mapCheck this will set mapLatest to the highest version number any player has "heard of" so far
mapOwned[K] = Real mapOwned key from bank[K] section any
IF mapVersion > mapOwned[K] THEN mapOwned[K] = mapVersion all players have downloaded this map, so they at least have this version now.
finally, synchronizeBank[K] (whatever function you use to store updated keys in banks and save) will include:
key mapLatest section any = mapLatest
key mapOwned section any = mapOwned[K] which are the highest "heard of" version and the higher they have now.
Now, no matter what version they are playing on, for each player you can make that
IF mapOwned[K] < mapLatest THEN the map will show a dialog/message/whatever saying
what version they have, what version they should have, and where they can easily download it.
A button to permanently shut alerts off (till next newer version is out, then ask again) should be a good idea :)
Not beefy enough to write this in Tutorials, but it's an interesting trick someone might find useful.
Due to how map sharing works, this will be very efficient on popular maps but somewhat misleading on casual maps.
How often in Wc3 did you see 10 games created with 10 different versions of the very same map spinoff (any Hero Wars, TD... name yours)? People don't usually know or care there's a newer version available and will just click on the first buggy/outdated map they come across, but if you can tell them they are two clicks away from downloading the newer version from Mapster, you are guaranteed to see it spread a little more quickly.
Create these new variables:
Real mapVersion = 3.01 (static, manually modify the number each time you update your map)
Real mapLatest, = mapVersion by default.
Real mapCheck, can be local inside map initialization trigger.
Real mapOwned[#] array where # is the number of max players
When you load player scores, personal stats and stuff you need with your FOR K cycle, also put in it something like this:
mapCheck = Real mapLatest key from bank[K] section any
IF mapCheck > mapLatest THEN mapLatest = mapCheck
this will set mapLatest to the highest version number any player has "heard of" so far
mapOwned[K] = Real mapOwned key from bank[K] section any
IF mapVersion > mapOwned[K] THEN mapOwned[K] = mapVersion
all players have downloaded this map, so they at least have this version now.
finally, synchronizeBank[K] (whatever function you use to store updated keys in banks and save) will include:
key mapLatest section any = mapLatest
key mapOwned section any = mapOwned[K]
which are the highest "heard of" version and the higher they have now.
Now, no matter what version they are playing on, for each player you can make that
IF mapOwned[K] < mapLatest THEN the map will show a dialog/message/whatever saying
what version they have, what version they should have, and where they can easily download it.
A button to permanently shut alerts off (till next newer version is out, then ask again) should be a good idea :)