Skip to content

feat: Created a converter for the AttachmentIdentifier structure and a few other minor changes#799

Open
PUDGE133 wants to merge 7 commits intoExMod-Team:masterfrom
PUDGE133:master
Open

feat: Created a converter for the AttachmentIdentifier structure and a few other minor changes#799
PUDGE133 wants to merge 7 commits intoExMod-Team:masterfrom
PUDGE133:master

Conversation

@PUDGE133
Copy link
Copy Markdown

@PUDGE133 PUDGE133 commented Apr 1, 2026

Description

  • Deleted a non-existent room "HczStraightVariant"
  • Deleted incorrect error method "AttachmentIdentifier.TryParse"
  • Renamed "AttachmentName" converter because its name was incorrect and interfered with the new converter
  • Created a new converter "Attachment Identifier Converter" for the "Attachment Identifier" structure
  • Implemented new changes to the Loader class

What is the current behavior? (You can also link to an open issue here)
Everything works great.

What is the new behavior? (if this is a feature change)
The AttachmentIdentifier object is now correctly serialized and deserialized in the config.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
There are no critical changes. I removed a broken method that no sane person would use. I overrode the default serialization, which also won't do any harm, because deserialization didn't work, meaning no one was using it, and it won't break any configs.

Other information:


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

- Deleted incorrect error method "AttachmentIdentifier.TryParse"
- Renamed "AttachmentName" converter because its name was incorrect and interfered with the new converter
- Created a new converter "Attachment Identifier Converter" for the "Attachment Identifier" structure
- Implemented new changes to the Loader class
Comment thread EXILED/Exiled.API/Features/Room.cs
@PUDGE133 PUDGE133 requested a review from louis1706 April 1, 2026 12:17
Comment thread EXILED/Exiled.API/Features/Room.cs Outdated
PUDGE133 and others added 2 commits April 1, 2026 15:42
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
@louis1706 louis1706 requested a review from Someone-193 April 1, 2026 17:33
@PUDGE133
Copy link
Copy Markdown
Author

PUDGE133 commented Apr 4, 2026

What's taking so long? I'm ready to do a new PR on a different issue, but I'm afraid the changes will come right here.

@Unbistrackted
Copy link
Copy Markdown

Unbistrackted commented Apr 7, 2026

@PUDGE133 Shouldn't you just create a new branch that targets master (or dev if breaking changes ig) to do the new PR?

And, I don't want to be the annoying guy but they have their own stuff to do so, don't say What's taking so long?, it will be reviewed eventually

@PUDGE133
Copy link
Copy Markdown
Author

PUDGE133 commented Apr 7, 2026

@PUDGE133 Shouldn't you just create a new branch that targets master (or dev if breaking changes ig) to do the new PR?

And, I don't want to be the annoying guy but they have their own stuff to do so, don't say What's taking so long?, it will be reviewed eventually

I understand they have their own things to do. I'm just not very familiar with the git system and have no idea what actions might lead to what.

@Unbistrackted
Copy link
Copy Markdown

@PUDGE133 Shouldn't you just create a new branch that targets master (or dev if breaking changes ig) to do the new PR?
And, I don't want to be the annoying guy but they have their own stuff to do so, don't say What's taking so long?, it will be reviewed eventually

I understand they have their own things to do. I'm just not very familiar with the git system and have no idea what actions might lead to what.

Then search abt it, if you make a mistake it happens, and just move on

If you want a really easy experience, just use Github Desktop, should be easier to manage your branches

Comment on lines -132 to -151
/// <summary>
/// Converts the string representation of a <see cref="AttachmentIdentifier"/> to its <see cref="AttachmentIdentifier"/> equivalent.
/// A return value indicates whether the conversion is succeeded or failed.
/// </summary>
/// <param name="s">The <see cref="string"/> to convert.</param>
/// <param name="identifier">The converted <see cref="string"/>.</param>
/// <returns><see langword="true"/> if <see cref="string"/> was converted successfully; otherwise, <see langword="false"/>.</returns>
public static bool TryParse(string s, out AttachmentIdentifier identifier)
{
identifier = default;

foreach (AttachmentIdentifier attId in Features.Items.Firearm.AvailableAttachments.Values.SelectMany(kvp => kvp.Where(kvp2 => kvp2.Name.ToString() == s)))
{
identifier = attId;
return true;
}

return false;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a breaking change. Either keep this method here or change the target branch to Dev (which will only be released when Exiled 10 comes out)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The existence of this method itself is a critical bug, not the fact that I removed it in this PR. https://discord.com/channels/656673194693885975/1002713309876854924/1488609613258559681 There's not a single reference to this method in the code. It also seems unlikely that anyone has ever used it. Do you really want to keep this bug around until the next version of the game is released?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry for taking so long to respond to this. But to answer your question, yes I do want to keep this even if it's buggy as some other plugin could have used this method and then that entire plugin would throw a MissingMethodException whenever it tries to call this

/// Converts a <see cref="IEnumerable{T}"/> of <see cref="AttachmentName"/> to Yaml configs and vice versa.
/// </summary>
public sealed class AttachmentIdentifiersConverter : IYamlTypeConverter
public sealed class AttachmentNameConverter : IYamlTypeConverter
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is another breaking change. Albeit more minor

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This doesn't affect anything at all. Not only was the name incorrect, it also got in the way of developing a new feature.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If any Exiled plugin whatsoever used this converter in their own code, after this change they'd get a TypeLoadException. So I'm not approving of this PR until it's either set to target Dev, or if these breaking changes are removed

@PUDGE133
Copy link
Copy Markdown
Author

Well... then we'll wait until the new patch comes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants