Skip to content

EN API UO Resend

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

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

UO.Resend

Hide hides a loaded object locally without using Hiding. Resend/Resync clears this local hiding and restores the previous drawing state of loaded objects, including after repeated Hide. Object data is retained; the server Hidden flag is unchanged.

Home · C# · IDE · UO API · A–Z · Examples · Languages

C# signatures

void UO.Resend();

Sends a request to resync the world.

Parameters

There are no parameters.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • Resync sends NetClient.Socket.Send_Resync on the game thread. This is an update request, not a reconnection, or an acknowledgment that data has been received.
  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.

Standalone C# scripts

Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.

Simple example

Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.

The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.

UO.Print("Calling UO.Resend");
UO.Resend();

1. Direct call - direct script

Parameters and execution flow:

  • Sends a request to resync the world.
UO.Resend();

2. Explicit option - script function

Parameters and execution flow:

  • Resync sends NetClient.Socket.Send_Resync on the game thread. This is an update request, not a reconnection, or an acknowledgment that data has been received.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.IsOnline()))
    {
        UO.Resend();
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3. Full Helper Function - Script Class

Parameters and execution flow:

  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.Resend();
        UO.Wait(500);
        UO.Print(UO.GetX());
        return null;
    }
}

Command implementation

C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.

UO.Resend() — UO.Resend()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "resend": bridge.Resync(); break;

Clone this wiki locally