Skip to content

ES API UO GetGlobal

Bad Newbie edited this page Oct 16, 2026 · 3 revisions

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

UO.GetGlobal

Firmas C#

string UO.GetGlobal(object? name);
dynamic UO.GetGlobal(object? globalRegion, object? varName);

Comportamiento y resultado

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.

Parámetros

  • 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.

Comandos del chat

#getglobal team.target
#get global team.message

Ejemplos C# completos

Cada bloque es un .csx completo. Sustituya serials, tipos y coordenadas de ejemplo. El orden y los argumentos C# con nombre siguen la firma.

1

string value = UO.GetGlobal("team.target");
UO.Print(value);

2

string value = UO.GetGlobal("team.delay");
if (int.TryParse(value, out int milliseconds))
    UO.Print(milliseconds.ToString());

3

UO.Print(Convert.ToString(UO.GetGlobal("team", "delay")));

4

new CommandSample().Execute(UO);

sealed class CommandSample
{
    public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
    {
        string value = api.GetGlobal("team.target");
        api.Print(value);
    }
}

Llamadas internas

CSharpGameApi.GetGlobal
  -> CSharpScriptGlobals
  -> InjectionScript.Runtime.InjectionApiUO.RegisterClientApiCompatibility
  -> InjectionScript.Runtime.State.Globals.GetGlobal
Globals -> SharedGlobalStore -> named mutex -> atomic JSON replacement

InjectionScript.Runtime.State.SharedGlobalStore.Get

Clone this wiki locally