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

Default Plugin Versions to AssemblyVersion when not provided #618

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

KillStr3aK
Copy link
Contributor

@KillStr3aK KillStr3aK commented Oct 9, 2024

#340

Output 1

public class Test : BasePlugin
{
    public override string ModuleAuthor => "CounterStrikeSharp & Contributors";

    public override string ModuleName => "Test Plugin";

    public override string ModuleDescription => "Plugin for testing out new features.";

    public override void Load(bool hotReload)
    {
        
    }
}
css_plugins list
  List of all plugins currently loaded by CounterStrikeSharp: 1 plugins loaded.
  [#1:LOADED]: "Test Plugin" (1.0.0.0) by CounterStrikeSharp & Contributors
    Plugin for testing out new features.

Output 2

public class Test : BasePlugin
{
    public override string ModuleAuthor => "CounterStrikeSharp & Contributors";

    public override string ModuleName => "Test Plugin";

    public override string ModuleDescription => "Plugin for testing out new features.";

    public override string ModuleVersion => "1.5 debug commit: 12345cbd";

    public override void Load(bool hotReload)
    {
        
    }
}
css_plugins list
  List of all plugins currently loaded by CounterStrikeSharp: 1 plugins loaded.
  [#1:LOADED]: "Test Plugin" (1.5 debug commit: 12345cbd) by CounterStrikeSharp & Contributors
    Plugin for testing out new features.

@KillStr3aK KillStr3aK marked this pull request as ready for review October 9, 2024 12:03
@KillStr3aK KillStr3aK requested a review from roflmuffin as a code owner October 9, 2024 12:03
if (Plugin is BasePlugin basePlugin)
{
// if no override we look for assembly version
if (basePlugin._version == "<unknown>")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe basePlugin.ModuleVersion instead of the backing field?

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.

1 participant