ludic/ns-network.html
2026-09-17 22:10:03 +00:00

22 lines
No EOL
3.3 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Network — Ludic</title>
<meta name="description" content="The low-level networking seam — send and poll datagrams, serialize and apply entity state, and read ownership and role.">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="docs.css">
</head>
<body>
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
<main class="wrap item">
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <span class="here">Network</span></div>
<div class="item-head"><span class="kind-badge kind-namespace">namespace</span><h1 id="top">Network</h1></div>
<p class="ns-blurb">The low-level networking seam — send and poll datagrams, serialize and apply entity state, and read ownership and role. Multiplayer is normally a compile-time property of the ECS, not glue you thread by hand: mark fields <code>@Sync</code> and models <code>@Owned</code> and the compiler generates the replication. These <code>Network.*</code> primitives are what that sugar lowers to, for when you drive the transport yourself. Offline they collapse to single-player defaults.</p>
<div class="ns-methods"><a class="ns-method" href="network-send.html"><code class="nm-sig">Network.send(peer, buf, len) -&gt; void</code><span class="nm-tip">Put a datagram on the wire.</span></a><a class="ns-method" href="network-poll.html"><code class="nm-sig">Network.poll(buf, cap) -&gt; int</code><span class="nm-tip">Read an inbound datagram.</span></a><a class="ns-method" href="network-serialize.html"><code class="nm-sig">Network.serialize(entity, buf) -&gt; int</code><span class="nm-tip">Serialize an entity's synced state.</span></a><a class="ns-method" href="network-apply.html"><code class="nm-sig">Network.apply(entity, buf) -&gt; int</code><span class="nm-tip">Apply serialized state to an entity.</span></a><a class="ns-method" href="network-owner.html"><code class="nm-sig">Network.owner(entity) -&gt; int</code><span class="nm-tip">The peer that owns an entity.</span></a><a class="ns-method" href="network-set_owner.html"><code class="nm-sig">Network.set_owner(entity, peer) -&gt; void</code><span class="nm-tip">Assign ownership of an entity.</span></a><a class="ns-method" href="network-is_server.html"><code class="nm-sig">Network.is_server() -&gt; bool</code><span class="nm-tip">Is this peer the server?</span></a><a class="ns-method" href="network-is_owner.html"><code class="nm-sig">Network.is_owner(entity) -&gt; bool</code><span class="nm-tip">Does this peer own the entity?</span></a><a class="ns-method" href="network-local_id.html"><code class="nm-sig">Network.local_id() -&gt; int</code><span class="nm-tip">This peer's own id.</span></a></div>
<a class="back" href="api.html">← All symbols</a>
</main>
<script src="ludic-highlight.js"></script>
<script>Ludic.installCards(); Ludic.flashTarget();</script>
</body></html>