OnRespawnInformationGiven
OxideCarbonPlayerCalled when respawn information given occurs.
void OnRespawnInformationGiven(BasePlayer basePlayer, List<ProtoBuf.RespawnInformation.SpawnOptions> list)Works — the game method in this build is the one the hook was written for.
Parameters
- basePlayer
- BasePlayer
- list
- List<ProtoBuf.RespawnInformation.SpawnOptions>
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnRespawnInformationGiven(BasePlayer basePlayer, List<ProtoBuf.RespawnInformation.SpawnOptions> list)
{
Puts("OnRespawnInformationGiven");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void BasePlayer.SendRespawnOptions()
Passes: BasePlayer basePlayer, List<ProtoBuf.RespawnInformation.SpawnOptions> list
WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, l0)Assembly-CSharp.dll
Where it is called (this branch's game code)
// …
{
if (NexusServer.Started && ZoneController.Instance.CanRespawnAcrossZones(this))
{
CollectExternalAndSend();
return;
}
List<RespawnInformation.SpawnOptions> spawnOptions = Facepunch.Pool.Get<List<RespawnInformation.SpawnOptions>>();
GetRespawnOptionsForPlayer(spawnOptions, userID);
Interface.CallHook("OnRespawnInformationGiven", this, spawnOptions);
SendToPlayer(spawnOptions, loading: false);
async void CollectExternalAndSend()
{
List<RespawnInformation.SpawnOptions> list = Facepunch.Pool.Get<List<RespawnInformation.SpawnOptions>>();
GetRespawnOptionsForPlayer(list, userID);
List<RespawnInformation.SpawnOptions> allSpawnOptions = Facepunch.Pool.Get<List<RespawnInformation.SpawnOptions>>();
foreach (RespawnInformation.SpawnOptions item in list)
{
// …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.