Send shown pictures on join #73
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes an issue where currently shown pictures would not reappear after reconnecting. A prominent example is player sprites in all FC Caverns areas (Yume 2kki) not being shown until the player changes effects. Entering FC Caverns currently triggers a reconnect which means the issue is fairly easy to encounter.
Small note about packet order:
riis currently sent beforepns, which means it's possible for the client to attempt to send shown pictures before it receives allowed picture names and prefixes. The only case I can think of when the client doesn't already have picture names from the previous join is during the initial game launch.An alternative would be to send pictures when
pnsis received, that way the initial issue would be solved and the code wouldn't depend on when or in which order packets are sent. This is not done here because pictures can persist between map changes (RPG Maker 2003 1.12 and newer,erase_on_map_change).Pnspackets are not resent during room changes and as such would cause the picture not to be displayed after changing maps. One example can be seen in the EasyRPG test suite (TestGame-2003, Image operations → third character from the right, red armor) with serverpicture_prefixesset to"number". I could not find any examples of allowed persistent pictures in games currently hosted on YNO.