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

[BUG]: Failed to load plugin: Global Variables not initialized yet in CSSharp v238 #71

Open
kus opened this issue May 31, 2024 · 2 comments

Comments

@kus
Copy link

kus commented May 31, 2024

A new update for CounterStrikeSharp came out today which has the text fix: improve error handling if globals are accessed before ready.

When using CounterStrikeSharp v238 you now get the following error, it works by downgrading back to v237.

I get the error on both Windows and Ubuntu.

09:21:32 [INFO] (cssharp:PluginContext) Loading plugin RockTheVote
09:21:32 [EROR] (cssharp:PluginManager) Failed to load plugin from /home/steam/cs2/game/csgo/addons/counterstrikesharp/plugins/RockTheVote/RockTheVote.dll
CounterStrikeSharp.API.Core.NativeException: Global Variables not initialized yet.
   at CounterStrikeSharp.API.Core.ScriptContext.CheckErrors() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/ScriptContext.cs:line 176
   at CounterStrikeSharp.API.Core.NativeAPI.GetMapName() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/API.cs:line 262
   at cs2_rockthevote.Core.MapCooldown.<.ctor>b__5_0(Object e, Map[] maps) in /Users/kus/dev/personal/counter-strike/cssharp/cs2-rockthevote/Core/MapCooldown.cs:line 17
   at cs2_rockthevote.MapLister.LoadMaps() in /Users/kus/dev/personal/counter-strike/cssharp/cs2-rockthevote/CrossCutting/MapLister.cs:line 45
   at cs2_rockthevote.DependencyManager`2.OnPluginLoad(TPlugin plugin) in /Users/kus/dev/personal/counter-strike/cssharp/cs2-rockthevote/CrossCutting/DependencyManager.cs:line 52
   at cs2_rockthevote.Plugin.Load(Boolean hotReload) in /Users/kus/dev/personal/counter-strike/cssharp/cs2-rockthevote/Plugin.cs:line 62
   at CounterStrikeSharp.API.Core.Plugin.PluginContext.Load(Boolean hotReload) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/PluginContext.cs:line 218
   at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.LoadPlugin(String path) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 125
   at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.Load() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 93
@audiomaster99
Copy link

CSS issue, downgrade to v237

@kus
Copy link
Author

kus commented Jun 1, 2024

@audiomaster99 yeah, but the issue is the plugin is accessing the global variables before they are initialised so that should be fixed.

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

No branches or pull requests

2 participants