Skip to content

ES API UO GetGlobalShared

Bad Newbie edited this page Oct 16, 2026 · 1 revision

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

UO.GetGlobalShared

Firmas C#

string UO.GetGlobalShared(object? name);

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

  • name — 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

#getglobalshared team.delay

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

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"));
    }
}

Llamadas internas

CSharpGameApi.GetGlobalShared
  -> CSharpScriptGlobals
  -> InjectionScript.Runtime.State.Globals.GetGlobalShared
Globals -> SharedGlobalStore -> named mutex -> atomic JSON replacement

InjectionScript.Runtime.State.SharedGlobalStore.Get

Clone this wiki locally