Skip to content

API UO ExtChangeProfile

Codex edited this page Sep 19, 2026 · 4 revisions

UO.ExtChangeProfile

ClassicUO / Basic IDE

Оглавление · Алфавитный указатель · Profiles & Configuration

Extended profile selection for a disconnected client. The command validates that the target profile exists beneath the selected server-name folder, saves/unloads the current profile, stores the selected shard in ClassicUO settings and supplies the target character to the real login character-selection flow.

Синтаксис

UO.ExtChangeProfile(ProfileName:Any) -> Any
UO.ExtChangeProfile(ProfileName:Any, ShardName:Any) -> Any
UO.ExtChangeProfile(ProfileName:Any, ShardName:Any, CharName:Any) -> Any

Регистр имени не важен. Any — динамическое значение Basic; Unit — отсутствие возвращаемого значения. Integer — знаковое 32-битное число, Decimal — число с плавающей точкой. Правила типов, serial, индексов и ожиданий.

Параметры

Имя Назначение
ProfileName Позиционный аргумент этой перегрузки. Подробности использования указаны в описании/фактической ветви runtime ниже.
ShardName optional human-readable server/shard name. Empty uses the current/last selected server.
CharName optional character name. Empty uses the character identity stored with that profile when available.

Параметры обязательны внутри каждой показанной сигнатуры. Опустить аргумент можно только при наличии более короткой перегрузки; пропуск позиции посередине не подразумевается.

Допустимые значения

ProfileName — Quoted BASIC string. Fixed keywords/enums, when present, are listed in Behavior/Notes.

  • ShardName — Quoted BASIC string. Fixed keywords/enums, when present, are listed in Behavior/Notes.
  • CharName — Quoted BASIC string. Fixed keywords/enums, when present, are listed in Behavior/Notes.

Ограничения

The server folder uses the actual display server name, not V2, not IP:port, and not the internal shard identity key.

  • If CharName is empty, the .character-name metadata saved with the canonical profile is used.
  • The command does not bypass server authentication and cannot select a character the shard does not return.
  • Use UO.Connect() after a successful return when an immediate reconnect is desired.

Примеры

Каждый блок — самостоятельный скрипт из мануала проекта. Параметры демонстрационного объекта/контейнера и условия действия необходимо сопоставить с вашей игровой ситуацией.

Пример 1

SUB Main()
    VAR rc = UO.ExtChangeProfile('0x12345678', 'Age of Power', 'LIHACH')
    IF rc = 0 THEN
        UO.Connect()
    END IF
END SUB

Пример 2

SUB Main()
    VAR result = UO.ExtChangeProfile('example.txt')
    UO.Print(CStr(result))
END SUB

Пример 3

SUB Main()
    VAR arg1 = 'example.txt' # ProfileName
    VAR arg2 = 2 # ShardName
    VAR arg3 = 3 # CharName
    VAR result = UO.ExtChangeProfile(arg1, arg2, arg3)
    UO.Print(CStr(result))
END SUB

Пример 4

SUB Main()
    VAR result = UO.ExtChangeProfile('example.txt', 2)
    UO.Print(CStr(result))
END SUB

Пример 5

SUB Main()
    VAR arg1 = 'example.txt' # ProfileName
    VAR result = UO.ExtChangeProfile(arg1)
    UO.Print(CStr(result))
END SUB

Пример 6

SUB ReadResult()
    VAR arg1 = 'example.txt' # ProfileName
    VAR result = UO.ExtChangeProfile(arg1)
    UO.Print(CStr(result))
END SUB

SUB Main()
    ReadResult()
END SUB
Реализация и проверка контракта
  • InjectionScript.Runtime.InjectionApiUO+<>c__DisplayClass38_0.<RegisterStealthCompatibility>b__0

Соответствующая ветвь совместимого обработчика в InjectionApiUO.cs. Arg(i)/Text(i) читают позицию с нуля; bridge обращается к клиенту. Прямые типизированные перегрузки перечислены выше и могут иметь отдельный маршрут.

{
                    string requestedProfile = Text(0);
                    string requestedShard = arguments.Length > 1 ? Text(1) : string.Empty;
                    string requestedCharacter = arguments.Length > 2 ? Text(2) : string.Empty;
                    return new InjectionValue(bridge.ChangeProfileSelection(requestedProfile, requestedShard, requestedCharacter));
                }

Источник реестра и отчёт сверки. Примеры проверяются загрузчиком/парсером включённого runtime. Действия на игровом сервере этой проверкой не исполняются.

Clone this wiki locally