Skip to content

Remove deprecated files and update README copyright year#69

Open
katz-dev wants to merge 1 commit into
ProjectFairnessLabs:masterfrom
katz-dev:master
Open

Remove deprecated files and update README copyright year#69
katz-dev wants to merge 1 commit into
ProjectFairnessLabs:masterfrom
katz-dev:master

Conversation

@katz-dev
Copy link
Copy Markdown

This pull request adds detailed documentation to help diagnose and resolve issues with the vehicle save feature in vMenu. It introduces three new markdown files that provide step-by-step guides for critical fixes, diagnostic builds, and final debugging procedures. The main README files in .github have also been removed, likely to reduce duplication or outdated information.

The most important changes are:

Documentation for critical vehicle save fix:

  • Added CRITICAL_FIX_README.md with a comprehensive explanation of the vehicle save bug, root cause, code changes, installation, testing steps, troubleshooting, and a success checklist.

Diagnostic and debugging support:

  • Added DIAGNOSTIC_BUILD_README.md to guide users through installing a debug build with error logging, including instructions on how to capture and interpret F8 console output for troubleshooting save failures.
  • Added FINAL_DIAGNOSTIC_BUILD.md with instructions for using a final diagnostic build that includes exhaustive logging at each step of the save process, ensuring any failure point can be identified from console logs.

Repository cleanup:

  • Removed .github/README.md and .github/ISSUE_TEMPLATE/README.md to eliminate redundant or outdated documentation. [1] [2]

Copilot AI review requested due to automatic review settings April 20, 2026 07:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR primarily focuses on diagnosing and fixing issues with vMenu’s saved-vehicle flow (async save + menu refresh), while also adding several “how to test/install/debug” documents and some repo cleanup (removing older docs like .github/README.md, SUMMARY.md, README (1).md).

Changes:

  • Updates the vehicle save pipeline (notably SaveVehicle signature/flow, menu refresh behavior, added VehicleInfo.Category, and additional diagnostics).
  • Adds multiple markdown guides and batch scripts to build/install/verify/debug the fix.
  • Removes older/duplicated documentation files and adjusts licensing/readme content.

Reviewed changes

Copilot reviewed 24 out of 27 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
vMenu/CommonFunctions.cs Changes vehicle saving/spawning behavior, adds diagnostics, modifies VehicleInfo and SaveVehicle signature.
vMenu/menus/SavedVehicles.cs Updates menu behavior to trigger async save + refresh and adds logging/error surfacing.
vMenu/MainMenu.cs Alters gating logic for “World Related Options” entry (now based on config setting).
vMenuServer/MainServer.cs Significant constructor reformat; potential brace/scope issues in initialization block.
quick-install.bat, verify-fix.bat, build.bat Adds build/install helper scripts (currently with hard-coded local paths).
CRITICAL_FIX_README.md + other *.md Adds extensive diagnostic/install documentation (contains hard-coded local paths).
README.md, LICENSE.md Updates copyright/license text (currently inconsistent between files).
vMenuServer/config/permissions.cfg Removes a couple of commented/extra sections and tweaks a header.
.github/README.md, .github/ISSUE_TEMPLATE/README.md, SUMMARY.md, README (1).md Removes deprecated/duplicated documentation files.
Comments suppressed due to low confidence (1)

vMenu/MainMenu.cs:850

  • The World Related Options submenu button is now gated only by vmenu_enable_client_time_weather. This can make WorldSubmenu inaccessible even when it contains other enabled/allowed entries (e.g., Weather Options / NPC Density), because the button may never be added to the main menu. Consider always adding worldSubmenuBtn and relying on the existing WorldSubmenu.Size > 0 logic to bind/remove it; gate only the time/weather entry itself with the setting.
            var worldSubmenuBtn = new MenuItem("World Related Options", "Open this submenu for world related subcategories.") { Label = "→→→" };
            if (GetSettingsBool(Setting.vmenu_enable_client_time_weather))
            {
                Menu.AddMenuItem(worldSubmenuBtn);
                {
                    var menu2 = PlayerTimeWeatherOptionsMenu.GetMenu();
                    var button2 = new MenuItem("Time & Weather Options", "Change all time & weather related options here.")
                    {
                        Label = "→→→"
                    };
                    AddMenu(Menu, menu2, button2);
                }
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread verify-fix.bat
Comment on lines +8 to +16
echo [1/3] Checking if build files exist...
if exist "C:\Users\prabu\Desktop\webpro\build\net452\vMenuClient.net.dll" (
echo ✓ vMenuClient.net.dll found
) else (
echo ✗ vMenuClient.net.dll NOT FOUND
echo ERROR: Build files missing. Run build.bat first!
pause
exit /b 1
)
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

This script hard-codes an absolute build output path containing a specific username (C:\Users\prabu\...). That’s non-portable and leaks developer-local information into the repo. Consider using a relative path from the script location (e.g., %~dp0build\net452\...) or prompting for the build output directory.

Copilot uses AI. Check for mistakes.
Comment thread quick-install.bat
Comment on lines +39 to +45
REM Copy new files
echo Copying vMenuClient.net.dll...
copy "C:\Users\prabu\Desktop\webpro\build\net452\vMenuClient.net.dll" "%serverpath%\" /Y

echo Copying vMenuServer.net.dll...
copy "C:\Users\prabu\Desktop\webpro\build\net452\vMenuServer.net.dll" "%serverpath%\" /Y

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

This installer hard-codes absolute source paths (C:\Users\prabu\...) for the DLLs. That will fail for other contributors/users and also leaks a developer-local path. Consider copying from a relative repo path (e.g., build\net452\...) or deriving the path from the script directory (%~dp0).

Copilot uses AI. Check for mistakes.
Comment thread vMenu/CommonFunctions.cs
Comment on lines +1571 to +1577
Debug.WriteLine("[vMenu] SaveVehicle called");

// Only continue if the player is in a vehicle.
if (Game.PlayerPed.IsInVehicle())
{
#region new saving method
var mods = new Dictionary<int, int>();

foreach (var mod in veh.Mods.GetAllMods())
Debug.WriteLine("[vMenu] Player is in vehicle");

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

SaveVehicle now emits a large number of Debug.WriteLine messages on every save attempt. In normal use this will spam the client console and can make real errors harder to spot (and can have a small performance impact if saving is frequent). Consider wrapping this behind a debug setting/compile symbol, or using a single summary log line unless diagnostics are explicitly enabled.

Copilot uses AI. Check for mistakes.
Comment thread quick-install.bat
Comment on lines +20 to +27
echo Building latest version...
dotnet build vMenu.sln --configuration Release --no-restore

if %errorlevel% neq 0 (
echo ERROR: Build failed!
pause
exit /b 1
)
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

quick-install.bat runs dotnet build ... --no-restore without ensuring dependencies are restored. On a clean machine this will fail. Consider either running dotnet restore first (like build.bat does) or removing --no-restore so the script is self-contained.

Copilot uses AI. Check for mistakes.
Comment thread CRITICAL_FIX_README.md
Comment on lines +45 to +49
### Step 1: Copy the New Build
```
From: C:\Users\prabu\Desktop\webpro\build\net452\
To: [Your FiveM Server]\resources\vMenu\
```
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

This documentation hard-codes a developer-local path (C:\Users\prabu\Desktop\webpro\...). For a public repo, these steps won’t be usable by others and also leak local environment details. Consider replacing with a relative repo path (e.g., build\net452\) or placeholders ([YourUsername], [RepoRoot]) and explaining how to find the actual build output.

Copilot uses AI. Check for mistakes.
Comment thread vMenu/CommonFunctions.cs
Comment on lines +1602 to +1621

// TEMPORARY FIX: Disable GetMaterial calls as they hang the save process
// Using default value of 0 for material/finish
Debug.WriteLine("[vMenu] Using default material values (GetMaterial disabled to prevent hanging)");
var primaryFinish = 0;
var secondaryFinish = 0;

// ORIGINAL CODE (COMMENTED OUT DUE TO HANGING):
// Debug.WriteLine("[vMenu] Getting primary material (this may hang if GetMaterial has issues)...");
// var primaryFinish = 0;
// try
// {
// primaryFinish = await GetMaterial.GetPrimaryMaterialAsync(veh.Handle);
// Debug.WriteLine($"[vMenu] Primary material: {primaryFinish}");
// }
// catch (Exception matEx)
// {
// Debug.WriteLine($"[vMenu] WARNING: GetPrimaryMaterial failed: {matEx.Message}");
// primaryFinish = 0; // fallback to default
// }
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

SaveVehicle now hard-codes primaryFinish/secondaryFinish to 0 and comments out the GetMaterial calls. Beyond disabling chameleon/finish detection, this also affects downstream custom-color detection logic (e.g., custom colors that legitimately return RGB 0,0,0 can no longer be distinguished from “not custom” when finish is always 0). Consider implementing a timeout/fallback around the material calls (e.g., Task.WhenAny + default), or gating the behavior behind a config/debug flag so you avoid hangs without permanently regressing finish/custom-color handling.

Suggested change
// TEMPORARY FIX: Disable GetMaterial calls as they hang the save process
// Using default value of 0 for material/finish
Debug.WriteLine("[vMenu] Using default material values (GetMaterial disabled to prevent hanging)");
var primaryFinish = 0;
var secondaryFinish = 0;
// ORIGINAL CODE (COMMENTED OUT DUE TO HANGING):
// Debug.WriteLine("[vMenu] Getting primary material (this may hang if GetMaterial has issues)...");
// var primaryFinish = 0;
// try
// {
// primaryFinish = await GetMaterial.GetPrimaryMaterialAsync(veh.Handle);
// Debug.WriteLine($"[vMenu] Primary material: {primaryFinish}");
// }
// catch (Exception matEx)
// {
// Debug.WriteLine($"[vMenu] WARNING: GetPrimaryMaterial failed: {matEx.Message}");
// primaryFinish = 0; // fallback to default
// }
async Task<int> GetMaterialWithTimeout(Func<int, Task<int>> getMaterialAsync, string materialName, int fallbackValue = 0, int timeoutMs = 1000)
{
try
{
Debug.WriteLine($"[vMenu] Getting {materialName} material with timeout ({timeoutMs}ms)...");
var materialTask = getMaterialAsync(veh.Handle);
var completedTask = await Task.WhenAny(materialTask, Task.Delay(timeoutMs));
if (completedTask == materialTask)
{
var material = await materialTask;
Debug.WriteLine($"[vMenu] {materialName} material: {material}");
return material;
}
Debug.WriteLine($"[vMenu] WARNING: Timed out while getting {materialName} material. Using fallback value {fallbackValue}.");
}
catch (Exception matEx)
{
Debug.WriteLine($"[vMenu] WARNING: Failed to get {materialName} material: {matEx.Message}. Using fallback value {fallbackValue}.");
}
return fallbackValue;
}
var primaryFinish = await GetMaterialWithTimeout(GetMaterial.GetPrimaryMaterialAsync, "primary");
var secondaryFinish = await GetMaterialWithTimeout(GetMaterial.GetSecondaryMaterialAsync, "secondary");
// }

Copilot uses AI. Check for mistakes.
Comment thread vMenu/CommonFunctions.cs
case 1: // finished editing
return GetOnscreenKeyboardResult();
var result = GetOnscreenKeyboardResult();
Debug.WriteLine($"[vMenu] Keyboard finished, result: {result}");
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

GetUserInput logs the raw onscreen keyboard result to the client debug output. This can leak user-provided input into logs (potentially sensitive) and will be noisy in normal gameplay. Consider removing these logs or gating them behind an explicit debug setting/compile symbol.

Suggested change
Debug.WriteLine($"[vMenu] Keyboard finished, result: {result}");
Debug.WriteLine("[vMenu] Keyboard finished.");

Copilot uses AI. Check for mistakes.
Comment on lines +402 to +412
CitizenFX.Core.Debug.WriteLine("[vMenu] SaveVehicleAsync called from menu");
await SaveVehicle();
CitizenFX.Core.Debug.WriteLine("[vMenu] SaveVehicle completed, refreshing menu...");
UpdateMenuAvailableCategories();
CitizenFX.Core.Debug.WriteLine("[vMenu] Menu refreshed");
}
catch (Exception ex)
{
CitizenFX.Core.Debug.WriteLine($"[vMenu] ERROR in SaveVehicleAsync: {ex.Message}");
CitizenFX.Core.Debug.WriteLine($"[vMenu] Stack: {ex.StackTrace}");
Notify.Error($"Save failed: {ex.Message}");
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

SaveVehicleAsync adds verbose diagnostic logging and surfaces exception messages directly to players via Notify.Error($"Save failed: {ex.Message}"). For production builds this can spam the F8 console and expose internal exception details. Consider gating these logs behind a debug flag and showing a user-friendly error while keeping full details only in debug output.

Suggested change
CitizenFX.Core.Debug.WriteLine("[vMenu] SaveVehicleAsync called from menu");
await SaveVehicle();
CitizenFX.Core.Debug.WriteLine("[vMenu] SaveVehicle completed, refreshing menu...");
UpdateMenuAvailableCategories();
CitizenFX.Core.Debug.WriteLine("[vMenu] Menu refreshed");
}
catch (Exception ex)
{
CitizenFX.Core.Debug.WriteLine($"[vMenu] ERROR in SaveVehicleAsync: {ex.Message}");
CitizenFX.Core.Debug.WriteLine($"[vMenu] Stack: {ex.StackTrace}");
Notify.Error($"Save failed: {ex.Message}");
#if DEBUG
CitizenFX.Core.Debug.WriteLine("[vMenu] SaveVehicleAsync called from menu");
#endif
await SaveVehicle();
#if DEBUG
CitizenFX.Core.Debug.WriteLine("[vMenu] SaveVehicle completed, refreshing menu...");
#endif
UpdateMenuAvailableCategories();
#if DEBUG
CitizenFX.Core.Debug.WriteLine("[vMenu] Menu refreshed");
#endif
}
catch (Exception ex)
{
#if DEBUG
CitizenFX.Core.Debug.WriteLine($"[vMenu] ERROR in SaveVehicleAsync: {ex.Message}");
CitizenFX.Core.Debug.WriteLine($"[vMenu] Stack: {ex.StackTrace}");
#endif
Notify.Error("Failed to save vehicle.");

Copilot uses AI. Check for mistakes.
Comment thread README.md
Tom Grobbe - https://www.vespura.com/

Copyright © 2017-2023
Copyright © 2017-2022
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

README’s copyright year range was changed to 2017–2022, but LICENSE.md in this PR states 2017–2023. These should be consistent, and typically the range should not move backwards. Please confirm the intended year range and update both files accordingly.

Suggested change
Copyright © 2017-2022
Copyright © 2017-2023

Copilot uses AI. Check for mistakes.
Comment thread vMenu/MainMenu.cs
Comment on lines 836 to 840
// Add the vehicle options Menu.

var worldSubmenuBtn = new MenuItem("World Related Options", "Open this submenu for world related subcategories.") { Label = "→→→" };
if (IsAllowed(Permission.CTWMenu))
if (GetSettingsBool(Setting.vmenu_enable_client_time_weather))
{
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

The PR title focuses on removing deprecated files/updating copyright, but this change removes a permission gate (IsAllowed(Permission.CTWMenu)) in favor of a config toggle. That’s a behavioral change in access control and should be called out explicitly (and ideally kept permission-based) to avoid unintentionally widening access to world/time/weather functionality.

Copilot uses AI. Check for mistakes.
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