Skip to content

[BUG] Plugin Loading Bug - Server loads cached/wrong plugin instead of new plugin #94

@hrznx

Description

@hrznx

SwiftlyS2 Version

v0.2.38

Game

Counter-Strike 2

Operating System

Linux

Bug Description

SwiftlyS2 loads incorrect plugin data even when deploying fresh builds with correct metadata. The server consistently loads cached "MyFirstPlugin" entries instead of the actual "InvisiblePlugin" being deployed.

Steps to Reproduce

  1. Create and deploy a working plugin (e.g., "MyFirstPlugin")

  2. Create a new plugin with different metadata:

[PluginMetadata(Id = "InvisiblePlugin", Version = "1.0.0", Name = "InvisiblePlugin", Author = "STX", Description = "Make players invisible")]
public partial class InvisiblePlugin : BasePlugin
  1. Build with dotnet clean; dotnet build; dotnet publish
  2. Deploy to /addons/swiftlys2/plugins/InvisiblePlugin/ (extracted folder structure)
  3. Run sw plugins load InvisiblePlugin
  4. Check sw plugins list

Expected Behavior

│ Name │ Status │ Version │ Author │
│ InvisiblePlugin │ Loaded │ 1.0.0 │ STX │

Actual Behavior

│ Name │ Status │ Version │ Author │
│ MyFirstPlugin │ Loaded │ 1.0.0 │ Developer │
│ MyFirstPlugin │ Loaded │ 1.0.0 │ Developer │

Logs/Console Output


Plugin Information

No response

Additional Context

Suggested Fix

  • Add plugin cache clearing mechanism
  • Improve plugin loading error messages
  • Prevent duplicate plugin entries
  • Better metadata validation on load

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions