Skip to content

EN API UO SetGlobalShared

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

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

UO.SetGlobalShared

C# signatures

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

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.
  • value — Value stored as text.

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

#setglobalshared team.delay 350

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

Internal calls

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

InjectionScript.Runtime.State.SharedGlobalStore.Set

Clone this wiki locally