EN API UO GetGlobalShared - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
UO.GetGlobalShared
C# signatures
string UO.GetGlobalShared(object? name);
Behavior and result
SetGlobal and GetGlobal share one namespace across every script/profile, including separate Full Client and Client processes. Values are strings; an absent key returns "N/A". Keys are case sensitive; region overloads identify a region/name pair. Manager/Game Manager/CSharp/globals.json is read fresh under a process-shared lock and survives restart. Shared forms explicitly alias this same store.
Parameters
name— Case-sensitive shared key name.
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
Chat commands
#getglobalshared team.delay
Complete C# examples
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
1
UO.Print(UO.GetGlobalShared("team.target"));
2
UO.SetGlobal("team.message", "Привіт");
string value = UO.GetGlobalShared("team.message");
UO.Print(value);
3
foreach (string key in new[] { "team.target", "team.delay" })
UO.Print(UO.GetGlobalShared(key));
4
new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
api.Print(api.GetGlobalShared("team.target"));
}
}
Internal calls
CSharpGameApi.GetGlobalShared
-> CSharpScriptGlobals
-> InjectionScript.Runtime.State.Globals.GetGlobalShared
Globals -> SharedGlobalStore -> named mutex -> atomic JSON replacement