Skip to content

OnEntitySnapshot

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnEntitySnapshot( BaseNetworkable instance, Connection connection )
{
    Puts( "OnEntitySnapshot works!" );
}
csharp
private void OnEntitySnapshot( BaseNetworkable ent, Connection connection )
{
    Puts( "OnEntitySnapshot works!" );
}

Location

  • BaseNetworkable::SendAsSnapshot(Network.Connection connection, bool justCreated)
  • BasePlayer::SendEntitySnapshot(BaseNetworkable ent)
csharp
public void SendAsSnapshot(Connection connection, bool justCreated = false)
{
	if (Interface.CallHook("OnEntitySnapshot", this, connection) != null)
	{
		return;
	}
	NetWrite netWrite = Net.sv.StartWrite();
	connection.validate.entityUpdates = connection.validate.entityUpdates + 1u;
//---
csharp
private void SendEntitySnapshot(BaseNetworkable ent)
{
	if (Interface.CallHook("OnEntitySnapshot", ent, this.net.connection) != null)
	{
		return;
	}
	using (TimeWarning.New("SendEntitySnapshot", 0))
	{
//---

Released under the MIT License.