> For the complete documentation index, see [llms.txt](https://asperazera.gitbook.io/simple-event-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asperazera.gitbook.io/simple-event-system/advanced/networking.md).

# Networking

Simple Event System follows a strict **Server Authoritative** architecture. The core logic resides in the `GameState`, but **only the Server** has the right to trigger events to ensure security and data consistency.

***

### 📡 Sending Events: Two Modes

There are two separate nodes. **Both nodes have a built-in Authority check.** If a Client attempts to call them, the execution is ignored.

#### 1. Send Game Event (Server Local)

**Use for:** Game Logic, AI decisions, Quest updates, Score calculations.

* **Behavior:** Checks for Authority. If executed by the Server, it triggers the Event Dispatcher **locally on the Server only**.
* **Result:** Only Server-side actors (GameMode, AI Controllers, Server-side logic) will receive this event. Clients will remain unaware.

{% hint style="info" %}
**Best Practice:** Use this when you need to update game state (like `Round -= 3`). Let standard variable replication (`RepNotify`) handle the synchronization to clients.
{% endhint %}

#### 2. Send Game Event Replicated (Multicast)

**Use for:** **UI Notifications** and maybe VFX or SFX in some scenarios.

* **Behavior:** Checks for Authority. If executed by the Server, it triggers a **NetMulticast RPC**.
* **Result:** The event is broadcast to **ALL connected Clients** (and the Server itself) simultaneously.

<figure><img src="/files/XmsdKJNGyxDVJc42p5Bp" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Use this for "Transient" events—things that happen in a moment and don't need to be saved (like an explosion sound).
{% endhint %}

***

{% hint style="info" %}

### 🛡️ Security & Client Interaction

To prevent cheating, **Clients cannot use these nodes directly.**

If a Client (Remote machine) calls `Send Game Event` or `Send Game Event Replicated`, the system will simply **do nothing**. This prevents hackers from injecting fake events (e.g., "Add 1000 Gold").

#### How to trigger an event from a Client?

If a player performs an action (e.g., presses a button), you must route the logic through the Server:

1. **Client:** Calls a standard **Run On Server** event (RPC) inside their Character or PlayerController (e.g., `Server_Interact`).
2. **Server:** Validates the action (Is the player close enough? Do they have the key?).
3. **Server:** Calls **`Send Game Event`** (for logic) or **`Send Game Event Replicated`** (for effects).
   {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://asperazera.gitbook.io/simple-event-system/advanced/networking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
