-
Notifications
You must be signed in to change notification settings - Fork 7
v0.10.5 Fixes and Additions #38
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
Merged
decaprime
merged 29 commits into
decaprime:main
from
Odjit:update/v0.10.5_Fixes_and_Additions
Apr 15, 2026
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
3e7146c
No longer keeping hard references to Assembly's instead just purely t…
Odjit 6e3fe65
As we now support command overloading and choosing which command to e…
Odjit 0272bb2
Adding the ability to handle the remainder of a command input with a …
Odjit 987255e
Command history won't store anymore duplicate sets of command/args
Odjit 650805f
Fixing a few compile warnings
Odjit 7a0ee8d
Command History persists across server restarts. Loaded at first com…
Odjit 487e87f
Moved Command History code into its own static class
Odjit c4bbc1e
Changed to storing history based on the context's name instead of pla…
Odjit 0939845
Realized the context wasn't being updated on the history commands whe…
Odjit 0feff69
Start of version checking installed plugins
Odjit f0e425b
When admins auth do a version check and let them know what needs upda…
Odjit 10691f0
Fixing line endings
Odjit 93ca6a5
Adds .version command to VCF for allowing anyone to see what plugins …
Odjit 144f8ea
* Version command admin only now
Odjit 83970b0
Should only be checking the name not dependencies for the package for…
Odjit 623419f
Deciding to remove Thunderstore Version checking of Plugins and only …
Odjit 628c858
Fixing _remainder to work properly with command groups and commands t…
Odjit c603235
SImplifying VersionChecker removing unnecessary code that we don't ha…
Odjit 26e008b
Fixing line endings
Odjit ccd6b0c
Remove Thunderstore version checking documentation and fix .version d…
Odjit 414c020
Fix command history replay using stale context instead of current con…
Odjit 001a98a
Remove UnityMainThreadDispatcher as it is no longer needed
Odjit 36d0bcf
Input parsing now uses CommandRegistry.ParseInput and fixed _remainde…
Odjit c73976c
Moving saving command history to be async to not halt the chat proces…
Odjit abffa43
Changing _remainder to use a Remainder parameter which if used has to…
Odjit 289b266
Chat messages had a potential to be processed on the client out of or…
Odjit f4f427c
Updated README.md with remainder parameter information
Odjit fca8433
💚 Unit test fix for non-determism in parallel and across platform
decaprime 52fedb7
Command history wasn't marked as loaded if the history file was missi…
Odjit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Unity.Entities; | ||
| using VampireCommandFramework.Common; | ||
|
|
||
| namespace VampireCommandFramework.Basics; | ||
|
|
||
| internal static class VersionCommands | ||
| { | ||
| [Command("version", description: "Lists all installed plugins and their versions", adminOnly: true)] | ||
| public static void VersionCommand(ICommandContext ctx) | ||
| { | ||
| // Get the user entity if this is a ChatCommandContext | ||
| var userEntity = ctx is ChatCommandContext chatCtx ? chatCtx.Event.SenderUserEntity : default; | ||
|
|
||
| VersionChecker.ListAllPluginVersions(userEntity); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| using BepInEx.Unity.IL2CPP; | ||
| using ProjectM; | ||
| using ProjectM.Network; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using Unity.Collections; | ||
| using Unity.Entities; | ||
| using VampireCommandFramework.Breadstone; | ||
|
|
||
| namespace VampireCommandFramework.Common; | ||
|
|
||
|
|
||
| internal static class VersionChecker | ||
| { | ||
| public static void ListAllPluginVersions(Entity userEntity = default) | ||
| { | ||
| try | ||
| { | ||
| // Get all loaded plugins | ||
| var installedPlugins = GetInstalledPlugins(); | ||
|
|
||
| if (installedPlugins.Count == 0) | ||
| { | ||
| LogInfoAndSendMessageToClient(userEntity, "No plugins found."); | ||
| return; | ||
| } | ||
|
|
||
| LogInfoAndSendMessageToClient(userEntity, $"Installed Plugins ({installedPlugins.Count}):"); | ||
|
|
||
| // Sort plugins by name for easier reading | ||
| foreach (var plugin in installedPlugins.OrderBy(p => p.Name)) | ||
| { | ||
| var pluginMessage = $"{plugin.Name.Color(Color.Command)}: {plugin.Version.Color(Color.Green)}"; | ||
| var formattedMessage = $"[vcf] ".Color(Color.Primary) + pluginMessage; | ||
| SendMessageToClient(userEntity, formattedMessage); | ||
| } | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| Log.Error($"Error listing plugin versions: {ex.Message}"); | ||
| } | ||
| } | ||
|
|
||
| static void SendMessageToClient(Entity userEntity, string message) | ||
| { | ||
| if (userEntity == default) return; | ||
|
|
||
| try | ||
| { | ||
| if (VWorld.Server?.EntityManager == null) return; | ||
| if (!VWorld.Server.EntityManager.Exists(userEntity)) return; | ||
| if (!VWorld.Server.EntityManager.HasComponent<User>(userEntity)) return; | ||
|
|
||
| var user = VWorld.Server.EntityManager.GetComponentData<User>(userEntity); | ||
| if (!user.IsConnected) return; | ||
|
|
||
| var msg = new FixedString512Bytes(message); | ||
| ServerChatUtils.SendSystemMessageToClient(VWorld.Server.EntityManager, user, ref msg); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| Log.Debug($"Could not send message to client (user may have disconnected): {ex.Message}"); | ||
| } | ||
| } | ||
|
|
||
| static void LogInfoAndSendMessageToClient(Entity userEntity, string message) | ||
| { | ||
| Log.Info(message); | ||
| SendMessageToClient(userEntity, message); | ||
| } | ||
|
|
||
| /// Gets information about all installed BepInEx plugins | ||
| private static List<InstalledPluginInfo> GetInstalledPlugins() | ||
| { | ||
| var plugins = new List<InstalledPluginInfo>(); | ||
|
|
||
| foreach (var pluginKvp in IL2CPPChainloader.Instance.Plugins) | ||
| { | ||
| var pluginInfo = pluginKvp.Value; | ||
| if (pluginInfo?.Metadata != null) | ||
| { | ||
| plugins.Add(new InstalledPluginInfo | ||
| { | ||
| GUID = pluginInfo.Metadata.GUID, | ||
| Name = pluginInfo.Metadata.Name, | ||
| Version = pluginInfo.Metadata.Version.ToString() | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| return plugins; | ||
| } | ||
|
|
||
|
|
||
| /// Information about an installed plugin | ||
| private class InstalledPluginInfo | ||
| { | ||
| public string GUID { get; set; } | ||
| public string Name { get; set; } | ||
| public string Version { get; set; } | ||
| } | ||
|
|
||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.