Repository navigation
ES API UO GetGlobal
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
string UO.GetGlobal(object? name);
dynamic UO.GetGlobal(object? globalRegion, object? varName);SetGlobal y GetGlobal comparten valores entre todos los scripts, perfiles y procesos Full Client/Client. Los valores son cadenas; una clave ausente devuelve "N/A". Se distingue mayúsculas; las formas region usan region/name. Manager/Game Manager/CSharp/globals.json persiste y se relee bajo bloqueo entre procesos. Las formas Shared usan el mismo almacén.
-
globalRegion— Espacio de nombres combinado con la clave. -
name— Nombre de clave compartida que distingue mayúsculas. -
varName— Nombre de clave compartida que distingue mayúsculas.
Cada bloque es un .csx completo. Sustituya serials, tipos y coordenadas de ejemplo. El orden y los argumentos C# con nombre siguen la firma.
#getglobal team.target
#get global team.message
Cada bloque es un .csx completo. Sustituya serials, tipos y coordenadas de ejemplo. El orden y los argumentos C# con nombre siguen la firma.
string value = UO.GetGlobal("team.target");
UO.Print(value);string value = UO.GetGlobal("team.delay");
if (int.TryParse(value, out int milliseconds))
UO.Print(milliseconds.ToString());UO.Print(Convert.ToString(UO.GetGlobal("team", "delay")));new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
string value = api.GetGlobal("team.target");
api.Print(value);
}
}CSharpGameApi.GetGlobal
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.RegisterClientApiCompatibility
-> InjectionScript.Runtime.State.Globals.GetGlobal
Globals -> SharedGlobalStore -> named mutex -> atomic JSON replacement
ClassicUO — Bad Newbie & C# Scripts IDE