Skip to content

ES API UO SetGlobalShared

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

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

UO.SetGlobalShared

Firmas C#

void UO.SetGlobalShared(object? name, object? value);

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.
  • value — Valor guardado como texto.

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

#setglobalshared team.delay 350

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.SetGlobalShared("team.target", 0x40001234);
UO.Print(UO.GetGlobal("team.target"));

2

UO.SetGlobal("team.message", "Привіт");
UO.Print(UO.GetGlobalShared("team.message"));

3

string key = "team.delay";
UO.SetGlobalShared(key, 350);
UO.Print(UO.GetGlobalShared(key));

4

new CommandSample().Execute(UO);

sealed class CommandSample
{
    public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
    {
        api.SetGlobalShared("team.target", 0x40001234);
        api.Print(api.GetGlobal("team.target"));
    }
}

Llamadas internas

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

InjectionScript.Runtime.State.SharedGlobalStore.Set

Clone this wiki locally