RustTip

OnPowergridStageChanged

OxideCarbonElectronic
void OnPowergridStageChanged(PowergridManager powergridManager, int local2)
Works — the game method in this build is the one the hook was written for.

Parameters

powergridManager
PowergridManager
local2
int

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnPowergridStageChanged(PowergridManager powergridManager, int local2)
{
    Puts("OnPowergridStageChanged");
}

Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.

Injection point

Rust.opj (Oxide)
void PowergridManager.ServerTick()

Passes: PowergridManager powergridManager, int local2

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, l2)Assembly-CSharp.dll

Where it is called (this branch's game code)

// …
				using (FlagsUpdateScope flagsUpdateScope = StartSetFlags(FlagsUpdateMode.SendNetworkUpdate_Flags))
				{
					flagsUpdateScope.Set(Flags.On, b);
				}
				stageChangeWorkQueue.RestartWorkQueue();
				int i = 0;
				for (int count = fuseBoxes.Count; i < count; i++)
				{
					Interface.CallHook("OnPowergridStageChanged", this, num2);
					fuseBoxes[i].Server_OnPowergridStageChanged();
				}
			}
		}
		hasTickedOnce = true;
	}
}

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.