OnClanLogoChanged
OxideCarbonClanCalled when a clan logo is changed.
void OnClanLogoChanged(LocalClan local0, byte[] newLogo, ulong bySteamId)Works — the game method in this build is the one the hook was written for.
Parameters
- local0
- LocalClan
- newLogo
- byte[]
- bySteamId
- ulong
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnClanLogoChanged(LocalClan local0, byte[] newLogo, ulong bySteamId)
{
Puts("OnClanLogoChanged");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void LocalClan.<SetLogo>d__60.MoveNext()
Passes: LocalClan local0, byte[] newLogo, ulong bySteamId
WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l0, this.newLogo, this.bySteamId)Rust.Clans.Local.dll
Where it is called (this branch's game code)
// …
else if (localClan.Logo != null && localClan.Logo.Length == newLogo.Length && Enumerable.SequenceEqual(localClan.Logo, newLogo))
{
result = ClanResult.Success;
}
else if (localClan._backend.Database.UpdateClanLogo(localClan.ClanId, newLogo))
{
localClan._backend.Database.AppendLog(localClan.ClanId, "set_logo", bySteamId);
localClan.Changed(ClanDataSource.Logo);
Interface.CallHook("OnClanLogoChanged", localClan, this.newLogo, this.bySteamId);
result = ClanResult.Success;
}
else
{
result = ClanResult.Fail;
}
}
catch (Exception exception)
// …Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.