Skip to content

Networked

namespace Griff.Scenes;
public sealed class Networked : Component

How an entity takes part in a network game. Without one, an entity is shared (or local, if it’s a camera, HUD or menu) and belongs to nobody. Players’ characters get one by themselves, saying whose they are.

This is a component: its saved properties are on its component page.

public bool AlwaysSent { get; set; }

Always sent to everyone, however far away (see ViewDistance): a boss, a goal.

public NetMovement Movement { get; set; }

For a player’s character: who moves it.

public int Owner { get; set; }

The number of the player it belongs to (their character, or what they fired), set by the game; 0 for nobody. What it hits counts for them, and their team.

public NetSync Sync { get; set; }

Shared with everyone, or each machine’s own.

public static int OwnerIdOf(Entity? entity)

The number of the player entity belongs to: the Owner of the nearest of it and its parents that has one, or 0 if none does.