API UO GetCharsListForShard - LIHACHTETAN/ClassicUO-BadNewbie-BasicIDE GitHub Wiki

UO.GetCharsListForShard

ClassicUO / Basic IDE

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

Returns the actual character names received from the server's character-selection packet for the current account/shard. ClassicUO caches that list in memory so the API can still return it after entering the world. If no cached list exists, the active LoginScene.Characters list is used; while already in game, the current player's name is the final fallback.

This command no longer returns the Basic profile serial as a fake character list.

Синтаксис

UO.GetCharsListForShard() -> Any

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

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

None; this command's registered overload takes no positional arguments.

Пропущенные аргументы

No parameters; no argument defaults apply.

Ограничения

The list reflects what the server supplied for the current shard/account during this client session.

  • It does not invent character names by scanning profile directories.
  • Empty slots from the server character list are removed.

Примеры

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

Пример 1

SUB Main()
    VAR chars = UO.GetCharsListForShard()
    UO.Print(chars)
END SUB

Пример 2

SUB Main()
    VAR result = UO.GetCharsListForShard()
    UO.Print(CStr(result))
END SUB

Пример 3

SUB Main()
    VAR result = UO.GetCharsListForShard()
    UO.Print(CStr(result))
END SUB

Пример 4

SUB ReadResult()
    VAR result = UO.GetCharsListForShard()
    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 обращается к клиенту. Прямые типизированные перегрузки перечислены выше и могут иметь отдельный маршрут.

return StringArray(bridge.GetCharactersForCurrentShard());

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

⚠️ **GitHub.com Fallback** ⚠️