Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Using addons wont allow players to connect #3359 #3449

Merged
merged 3 commits into from
Jul 2, 2022

Conversation

cwisniew
Copy link
Member

@cwisniew cwisniew commented Jun 30, 2022

Identify the Bug or Feature request

resolves #3359

Description of the Change

Fixes the problems where the add on wasn't always fetched from the server correctly, and the issue that was causing the asset to be created empty.

Possible Drawbacks

None foreseeable.

Documentation Notes

None required as this should allow addons to be used as already documented.

Release Notes

  • Fixed an issue where using add-ons would cause problems for players trying to connect if they did not already have the add on.

This change is Reviewable

@kwvanderlinde
Copy link
Collaborator

A consequence of recognizing application/zip as Asset.Type.MTLIB is that I can now drag and drop other zip files into a campaign where previously I would be prevented from doing so. E.g., before this change, if I tried to drag a .mttable file onto a map, I would get this dialog:
image

But after this change I would just get a blank token with a broken image:
image

If this is deemed acceptable, then I am okay with this change. Otherwise a better approach may be to force the type of the asset that is passed to AddOnLibraryImporter.importFromAsset() rather than having the MTLIB type be auto-detected for all zip files.

@cwisniew
Copy link
Member Author

I think the ability to drag those types of files onto the map but only get a red X and nothing further is done with them is going to be a source of confusion. I will have to update the fix as a suggested.

@cwisniew
Copy link
Member Author

cwisniew commented Jul 1, 2022

Fixed, sadly it wasn't an issue with AddonImport, (that already does the correct thing) the issue is with asset transfer at which point the client doesn't know what was sent it just knows something was sent so it tries to create an asset before saving it to the asset cache.

I have added the ability for the getMediaType() to check the contents of a zip file to see if it is an addon and only return MTLIB in that case. Since the file is not passed for the version used in the drag and drop code it will not allow you to drop a mtlib (or any zip file).

In the future this could be extended to support drag and drop of mtlib files importing an add on library (same goes for maps and tables I guess) but it is beyond the scope of this fix.

Copy link
Collaborator

@kwvanderlinde kwvanderlinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @cwisniew)

@Phergus Phergus merged commit 089f6e3 into RPTools:develop Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Using addons prevents players from connecting to server
3 participants