Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Rework hash checking code #3618

Closed
wzdev-ci opened this issue Jul 10, 2012 · 13 comments
Closed

Rework hash checking code #3618

wzdev-ci opened this issue Jul 10, 2012 · 13 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by vexed


On the commits that were shown here:

Fix: Sensibly handle multiple maps with the same name (#3531, #3180, 15c04ab10f, 2056093027, 1461b3a5a8)

(and others that try to fix that)

We still don't have a good way to differentiate between "internal" (comes with the game, aka hash = NULL) vs external (hash is whatever), and it is causing lots of issues.

If person hosts a external map, and comes back to do anything that uses a internal map, then the game exits out since it is using the old hash it has stored from the previous run.

Since that hash is also saved & loaded on exit, (so MP games will have the hash of the last used map) it fubars pretty much everything, in all ways you can start a SP game / tutorial / fastplay and mod overrides of the aforementioned things.

We should do one of these options:

  1. revert hash checking code --will cause desyncs if people have different maps with the same name.

  2. Don't bother saving the hash and the last map used for MP/Skirmish games. (Would only be slightly inconvenient, since we use the default map)

  3. Run around the code base and try to figure out the best location to reset the hash, while not breaking anything else.

  4. Only use hashes for (true) MP games (or in other words, host sends a checksum of the map they got hosted, and we try to find that specific hash on client's machine, if not, we download it. Hash is only calculated when they hit the map host button.)

The other problem with this is, (besides the odd crashing of the game with map transfers and people getting map files that end up with all 0 hashes in their names) people are ending up with lots of files in the map directories as people apparently host maps that have been altered at one point, without changing the name of the map as was warned about.

That, and of course the limited GUI interface that we have that makes it almost impossible to tell which map is the original author's map.


Issue migrated from trac:3618 at 2022-04-16 09:58:05 -0700

@wzdev-ci
Copy link
Contributor Author

dak180 changed milestone from unspecified to 3.1

@wzdev-ci
Copy link
Contributor Author

NoQ commented


How about

  1. completely remove the notion of a 'built-in map', providing a /map/ folder with regular .wz map files in the program data folder instead?

Would this help solving the issues?

This also allows including map-mods with the game in case anybody likes this idea.

This also cleans up the addon.lev file in the mp.wz folder, keeping only tileset data definitions in it (which is friendly to the tileset4 support).

@wzdev-ci
Copy link
Contributor Author

Per commented


I vote for option 2. The last map option is pretty buggy anyhow.

@wzdev-ci
Copy link
Contributor Author

vexed commented


Something like this ?

@wzdev-ci
Copy link
Contributor Author

vexed uploaded file 0001-Don-t-load-map-hash-on-skirmish-MP-games-anymore-jus.patch (3.4 KiB)

@wzdev-ci
Copy link
Contributor Author

Per commented


Yeah. Except I'd prefer if you just removed all trace of the default map/maxplayer stuff while you were at it.

@wzdev-ci
Copy link
Contributor Author

vexed commented


While that patch seems to work, it won't work if there is a mod of a SP game with a custom map.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 2, 2012

Per Inge Mathisen changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 2, 2012

Per Inge Mathisen changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 2, 2012

Per Inge Mathisen commented


No longer save default map, max players and map hash. Patch originally by vexed. Closes #3618

  • Changeset: [/changeset/398f77ede082063bd1bc607d5814e9630f663967 398f77ede082063bd1bc607d5814e9630f663967]
  • URL: [398]f77ede082063bd1bc607d5814e9630f663967

@wzdev-ci wzdev-ci closed this as completed Aug 2, 2012
@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 2, 2012

Per Inge Mathisen commented


No longer save default map, max players and map hash. Patch originally by vexed. Closes #3618

  • Changeset: [/changeset/398f77ede082063bd1bc607d5814e9630f663967 398f77ede082063bd1bc607d5814e9630f663967]
  • URL: [398]f77ede082063bd1bc607d5814e9630f663967

2 similar comments
@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 2, 2012

Per Inge Mathisen commented


No longer save default map, max players and map hash. Patch originally by vexed. Closes #3618

  • Changeset: [/changeset/398f77ede082063bd1bc607d5814e9630f663967 398f77ede082063bd1bc607d5814e9630f663967]
  • URL: [398]f77ede082063bd1bc607d5814e9630f663967

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 8, 2012

Per Inge Mathisen commented


No longer save default map, max players and map hash. Patch originally by vexed. Closes #3618

  • Changeset: [/changeset/398f77ede082063bd1bc607d5814e9630f663967 398f77ede082063bd1bc607d5814e9630f663967]
  • URL: [398]f77ede082063bd1bc607d5814e9630f663967

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant