Skip to content

chore: add more requirements#1481

Merged
doodlum merged 1 commit into
devfrom
more-requirements
Sep 17, 2025
Merged

chore: add more requirements#1481
doodlum merged 1 commit into
devfrom
more-requirements

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented Sep 17, 2025

Summary by CodeRabbit

  • Chores
    • Added CrashLogger.dll as a required component; the app will now alert if it’s missing.
    • Expanded the incompatible DLL list to block trainwreck.dll, preventing known conflicts.
    • Maintained VR-specific EngineFixes support; compatibility checks continue to enforce requirements and flag issues as before.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 17, 2025

Walkthrough

The plugin updates DLL validation lists in src/XSEPlugin.cpp by adding trainwreck.dll to the incompatible set and CrashLogger.dll to the required set. Existing loading and validation loops remain unchanged, so the new entries integrate into current error handling and reporting.

Changes

Cohort / File(s) Summary of Changes
DLL validation list updates
src/XSEPlugin.cpp
Added trainwreck.dll to incompatible DLLs; added CrashLogger.dll to required DLLs. Retained existing loop logic and error handling; list commas adjusted to include new entries.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Game as Game
  participant Plugin as XSEPlugin
  participant FS as Filesystem
  note over Plugin: Startup

  Game->>Plugin: Initialize()
  Plugin->>FS: Enumerate loaded DLLs
  FS-->>Plugin: DLL list

  rect rgba(230,240,255,0.5)
  note over Plugin: Incompatible check (new: trainwreck.dll)
  Plugin->>Plugin: If any incompatible DLL present
  alt Incompatible found
    Plugin-->>Game: Report error and abort
  else None found
    Plugin->>Plugin: Continue
  end
  end

  rect rgba(235,255,235,0.5)
  note over Plugin: Required check (new: CrashLogger.dll)
  Plugin->>Plugin: Verify required DLLs present
  alt Missing required
    Plugin-->>Game: Report missing dependency
  else All present
    Plugin-->>Game: Initialization complete
  end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • jiayev

Poem

Thump-thump, I check each shiny shell—
No trainwreck sneaks where plugins dwell.
CrashLogger hops in, bright and keen,
A carrot-orange trace machine.
Ears up, lists neat, dependencies tight—
Hippity-hop, we launch just right! 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: add more requirements" is concise, one sentence, and directly related to the changeset which adds additional DLL requirements and incompatible DLL entries (for example, trainwreck.dll and CrashLogger.dll). It is somewhat generic but still reflects the primary change rather than being off-topic. Under the check criteria a title that is partially related is acceptable, so this meets the requirement.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch more-requirements

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

Using provided base ref: 28c1112
Using base ref: 28c1112
Base commit date: 2025-09-17T15:33:07+01:00 (Wednesday, September 17, 2025 03:33 PM)
No actionable suggestions for changed features.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/XSEPlugin.cpp (2)

173-175: Safer incompatible-DLL detection: don’t LoadLibrary() the things you’re disabling

Adding SSEReShadeHelper.dll and trainwreck.dll makes sense (SSEReShadeHelper is obsolete; trainwreck is widely discouraged). But using LoadLibrary to “detect” these will execute their DllMain and keep them loaded, risking side effects and crashes. Prefer a non-executing presence/loaded check (filesystem + GetModuleHandleW) and never load them. (nexusmods.com)

Apply this diff to avoid executing entry points and to prevent accidental loading:

@@
- for (const auto dll : incompatibleDLLs) {
-   if (LoadLibrary(dll)) {
-     auto errorMessage = std::format("Incompatible DLL {} detected", stl::utf16_to_utf8(dll).value_or("<unicode conversion error>"s));
-     logger::error("{}", errorMessage);
-     errors.push_back(errorMessage);
-   }
- }
+ for (const auto dll : incompatibleDLLs) {
+   std::filesystem::path p{dll};
+   const bool presentOnDisk = std::filesystem::exists(p);
+   const bool alreadyLoaded = ::GetModuleHandleW(p.filename().c_str()) != nullptr;
+   if (presentOnDisk || alreadyLoaded) {
+     auto errorMessage = std::format("Incompatible DLL {} detected", stl::utf16_to_utf8(dll).value_or("<unicode conversion error>"s));
+     logger::error("{}", errorMessage);
+     errors.push_back(errorMessage);
+   }
+ }

Add this include (outside the changed hunk):

#include <filesystem>

Also applies to: 177-183


186-188: Crash logger requirement: allow “either-or” with NetScriptFramework to avoid breaking known setups

Requiring CrashLogger.dll is reasonable (it supports SSE/AE/VR), but many modlists still use NetScriptFramework (NSF). Crash Logger explicitly states only one crash logger should be active at a time; making CrashLogger.dll hard-required will disable Community Shaders for NSF users. Suggest: require “at least one of {CrashLogger.dll, NetScriptFramework.dll}”. (nexusmods.com)

Confirm whether any supported lists in your ecosystem still ship NSF; if yes, adopt the “either-or” check below.

Apply this diff to keep Engine Fixes required as-is and gate the crash-logger requirement flexibly:

@@
- const std::array requiredDLLs = {
-   REL::Module::IsVR() ? L"Data/SKSE/Plugins/EngineFixesVR.dll" : L"Data/SKSE/Plugins/EngineFixes.dll",
-   L"Data/SKSE/Plugins/CrashLogger.dll"
- };
+ const std::array requiredDLLs = {
+   REL::Module::IsVR() ? L"Data/SKSE/Plugins/EngineFixesVR.dll" : L"Data/SKSE/Plugins/EngineFixes.dll"
+ };
@@
- for (const auto dll : requiredDLLs) {
+ for (const auto dll : requiredDLLs) {
     if (!LoadLibrary(dll)) {
       auto errorMessage = std::format("Required DLL {} was missing", stl::utf16_to_utf8(dll).value_or("<unicode conversion error>"s));
       logger::error("{}", errorMessage);
       errors.push_back(errorMessage);
     }
   }
+
+ // Require at least one crash logger (CrashLogger or NetScriptFramework)
+ {
+   const std::array crashLoggerCandidates = {
+     L"Data/SKSE/Plugins/CrashLogger.dll",
+     L"Data/SKSE/Plugins/NetScriptFramework.dll"
+   };
+   bool hasLogger = false;
+   for (const auto dll : crashLoggerCandidates) {
+     std::filesystem::path p{dll};
+     if (std::filesystem::exists(p) || ::GetModuleHandleW(p.filename().c_str()) != nullptr) {
+       hasLogger = true;
+       break;
+     }
+   }
+   if (!hasLogger) {
+     auto errorMessage = std::format("Required crash logger (CrashLogger.dll or NetScriptFramework.dll) was missing");
+     logger::error("{}", errorMessage);
+     errors.push_back(errorMessage);
+   }
+ }

Note: trainwreck.dll being incompatible aligns with community guidance to avoid it. (reddit.com)

Also applies to: 190-196

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28c1112 and 7c1dc66.

📒 Files selected for processing (1)
  • src/XSEPlugin.cpp (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not include TODO/FIXME placeholders; provide complete, working solutions

Files:

  • src/XSEPlugin.cpp
src/**/*.{cpp,cxx,cc,h,hpp,hxx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{cpp,cxx,cc,h,hpp,hxx}: Ensure SE/AE/VR runtime compatibility; use runtime detection patterns (e.g., REL::RelocateMember())
Include robust error handling and resource management with graceful degradation in the plugin code

Files:

  • src/XSEPlugin.cpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build plugin and addons

@github-actions
Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@doodlum doodlum merged commit 3f462fa into dev Sep 17, 2025
17 checks passed
@alandtse alandtse deleted the more-requirements branch February 6, 2026 05:20
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.

2 participants