OnRemoteIdentifierUpdate
OxideCarbonEntityCalled when a remote identifier is updated.
object OnRemoteIdentifierUpdate(PoweredRemoteControlEntity poweredRemoteControlEntity, string newID)Работает — метод игры в этой сборке тот же, под который написан хук.
Параметры
- poweredRemoteControlEntity
- PoweredRemoteControlEntity
- newID
- string
Возвращаемое значение
objectВерните не null, чтобы отменить действие игры.
Пример
object — можно повлиять на игру: вернуть значение, чтобы изменить или отменить действие.
private object OnRemoteIdentifierUpdate(PoweredRemoteControlEntity poweredRemoteControlEntity, string newID)
{
Puts("OnRemoteIdentifierUpdate");
// ничего не меняем — игра продолжит как обычно
return null;
// повлиять на игру:
// return false; // не null — действие игры отменяется
}Работает и в Oxide, и в Carbon: Carbon загружает плагины Oxide без изменений.
Место встраивания
Rust.opj (Oxide)
void PoweredRemoteControlEntity.UpdateIdentifier(string, bool)
Передаёт: PoweredRemoteControlEntity poweredRemoteControlEntity, string newID
РаботаетReturnBehavior: ExitWhenValidTypeArgumentBehavior: UseArgumentString (this, a0)Assembly-CSharp.dll
Где вызывается (код игры этой ветки)
public void UpdateIdentifier(string newID, bool clientSend = false)
{
if (Interface.CallHook("OnRemoteIdentifierUpdate", this, newID) != null)
{
return;
}
_ = rcIdentifier;
if (isServer)
{
if (!RemoteControlEntity.IDInUse(newID))
{
// …Источники: Rust.opj из OxideMod/Oxide.Rust (MIT) и метаданные хуков документации Carbon (MIT). Код методов — декомпиляция сервера этой ветки.