[Українська](Runtime-Helpers-B) · [Русский](RU-Runtime-Helpers-B) · [English](EN-Runtime-Helpers-B) · [Deutsch](DE-Runtime-Helpers-B) · [Français](FR-Runtime-Helpers-B) · [Italiano](IT-Runtime-Helpers-B) · [Español](ES-Runtime-Helpers-B) · [繁體中文](ZH-TW-Runtime-Helpers-B) · [日本語](JA-Runtime-Helpers-B) · [한국어](KO-Runtime-Helpers-B) # Допоміжні функції B Внутрішній код реалізації, не самостійний скрипт. ## `ClassicUO.CSharp.CSharpCallbacks.CommandWords` Виконує показані виклики та оновлення стану. **Параметри:** `string command` **Джерело:** `Project_Full/src/ClassicUO.CSharp/CSharpCallbacks.cs:449`. `private static string[] CommandWords(string command)` **Результат:** `string[]`. **Умови:** - `quote != '\0'` - `letter == quote` - `letter is '\'' or '"'` - `char.IsWhiteSpace(letter)` **Виклики:** - `word.Append` - `char.IsWhiteSpace` - `words.Add` - `word.ToString` - `word.Clear` - `words.ToArray` Внутрішній код реалізації, не самостійний скрипт. ```csharp INTERNALIMPLEMENTATION private static string[] CommandWords(string command) { var words = new List(); var word = new System.Text.StringBuilder(); char quote = '\0'; bool started = false; foreach (char letter in command) { if (quote != '\0') { if (letter == quote) quote = '\0'; else word.Append(letter); started = true; } else if (letter is '\'' or '"') { quote = letter; started = true; } else if (char.IsWhiteSpace(letter)) { if (started) { words.Add(word.ToString()); word.Clear(); started = false; } } else { word.Append(letter); started = true; } } if (quote != '\0') throw new ArgumentException("Unclosed quote in callback command."); if (started) words.Add(word.ToString()); return words.ToArray(); } ``` ## `ClassicUO.CSharp.CSharpCallbacks.IsRunning` Виконує показані виклики та оновлення стану. **Параметри:** `string name` **Джерело:** `Project_Full/src/ClassicUO.CSharp/CSharpCallbacks.cs:168`. `public bool IsRunning(string name)` **Результат:** `bool`. **Виклики:** - `Verify` - `active.Any` - `call.Name.Equals` - `(name ?? "").Trim` Внутрішній код реалізації, не самостійний скрипт. ```csharp INTERNALIMPLEMENTATION public bool IsRunning(string name) { Verify(); lock (sync) return active.Any(call => call.Name.Equals((name ?? "").Trim(), StringComparison.OrdinalIgnoreCase) && !call.Cancellation.IsCancellationRequested); } ``` ## `ClassicUO.Game.GameActions.Attack` Виконує показані виклики та оновлення стану. **Параметри:** `World world, uint serial` **Джерело:** `Project_Full/src/ClassicUO.Client/Game/GameActions.cs:265`. `public static void Attack(World world, uint serial)` **Результат:** `void`. **Умови:** - `ScriptGameActionContext.For(world) == null && ProfileManager.CurrentProfile.EnabledCriminalActionQuery` - `m != null && (world.Player.NotorietyFlag == NotorietyFlag.Innocent || world.Player.NotorietyFlag == NotorietyFlag.Ally) && m.NotorietyFlag == NotorietyFlag.Innocent && m != world.Player` - `s` **Виклики:** - `ScriptGameActionContext.For` - `world.Mobiles.Get` - `Socket.Send_AttackRequest` - `UIManager.Add` Внутрішній код реалізації, не самостійний скрипт. ```csharp INTERNALIMPLEMENTATION public static void Attack(World world, uint serial) { if (ScriptGameActionContext.For(world) == null && ProfileManager.CurrentProfile.EnabledCriminalActionQuery) { Mobile m = world.Mobiles.Get(serial); if (m != null && (world.Player.NotorietyFlag == NotorietyFlag.Innocent || world.Player.NotorietyFlag == NotorietyFlag.Ally) && m.NotorietyFlag == NotorietyFlag.Innocent && m != world.Player) { QuestionGump messageBox = new QuestionGump ( world, ResGeneral.ThisMayFlagYouCriminal, s => { if (s) { Socket.Send_AttackRequest(serial); } } ); UIManager.Add(messageBox); return; } } world.TargetManager.NewTargetSystemSerial = serial; world.TargetManager.LastAttack = serial; Socket.Send_AttackRequest(serial); } ``` ## `ClassicUO.Game.GameActions.RequestPartyQuit` Виконує показані виклики та оновлення стану. **Параметри:** `PlayerMobile player` **Джерело:** `Project_Full/src/ClassicUO.Client/Game/GameActions.cs:559`. `public static void RequestPartyQuit(PlayerMobile player)` **Результат:** `void`. **Виклики:** - `Socket.Send_PartyRemoveRequest` Внутрішній код реалізації, не самостійний скрипт. ```csharp INTERNALIMPLEMENTATION public static void RequestPartyQuit(PlayerMobile player) { Socket.Send_PartyRemoveRequest(player.Serial); } ``` ## `ClassicUO.Game.GameActions.RequestPartyRemoveMember` Виконує показані виклики та оновлення стану. **Параметри:** `uint serial` **Джерело:** `Project_Full/src/ClassicUO.Client/Game/GameActions.cs:554`. `public static void RequestPartyRemoveMember(uint serial)` **Результат:** `void`. **Виклики:** - `Socket.Send_PartyRemoveRequest` Внутрішній код реалізації, не самостійний скрипт. ```csharp INTERNALIMPLEMENTATION public static void RequestPartyRemoveMember(uint serial) { Socket.Send_PartyRemoveRequest(serial); } ``` ## `ClassicUO.Game.GameActions.UseSecondaryAbility` Виконує показані виклики та оновлення стану. **Параметри:** `World world` **Джерело:** `Project_Full/src/ClassicUO.Client/Game/GameActions.cs:957`. `public static void UseSecondaryAbility(World world)` **Результат:** `void`. **Умови:** - `world?.Player == null` - `((byte) ability & 0x80) == 0` **Виклики:** - `SendAbility` Внутрішній код реалізації, не самостійний скрипт. ```csharp INTERNALIMPLEMENTATION public static void UseSecondaryAbility(World world) { if (world?.Player == null) return; ref Ability ability = ref world.Player.Abilities[1]; if (((byte) ability & 0x80) == 0) { for (int i = 0; i < 2; i++) { world.Player.Abilities[i] &= (Ability) 0x7F; } SendAbility(world, (byte)ability, false); } else { SendAbility(world, 0, false); } ability ^= (Ability) 0x80; } ``` ## `ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ActivateGumpButton` Виконує показані виклики та оновлення стану. **Параметри:** `int gumpId, int buttonId` **Джерело:** `Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3246`. `public int ActivateGumpButton(int gumpId, int buttonId)` **Результат:** `int`. **Виклики:** - `Invoke` - `ActivateGumpButtonUnsafe` - `ResolveGumpUnsafe` Внутрішній код реалізації, не самостійний скрипт. ```csharp INTERNALIMPLEMENTATION public int ActivateGumpButton(int gumpId, int buttonId) => Invoke(() => ActivateGumpButtonUnsafe(ResolveGumpUnsafe(gumpId), buttonId)); ``` ## `ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ActivateGumpButtonUnsafe` Виконує показані виклики та оновлення стану. **Параметри:** `Gump gump, int buttonId` **Джерело:** `Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3252`. `private static int ActivateGumpButtonUnsafe(Gump gump, int buttonId)` **Результат:** `int`. **Умови:** - `gump == null` - `gump is SessionServerGump logical` - `field == null || logical.IsDisposed` - `field.Action == ButtonAction.SwitchPage` **Виклики:** - `logical.Fields.FirstOrDefault` - `logical.ChangePage` - `logical.OnButtonClick` - `Descendants(gump).OfType