> ## Documentation Index
> Fetch the complete documentation index at: https://glua.bluejutzu.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Net Message Analysis Across Files

> GLua Language Server indexes both halves of every net message to catch unregistered strings, missing sends, orphaned receivers, and payload mismatches.

GLua Language Server indexes every `net.Start`, `net.Receive`, and `util.AddNetworkString` call across your workspace. It pairs the sending and receiving halves of each net message to detect registration errors, orphaned handlers, and mismatched data payloads.

## What is checked

The server validates net messages against four categories of problems:

* **Unregistered strings** — `net.Start` is called with a string that was never passed to `util.AddNetworkString`.
* **Missing sends** — `net.Start` is called but the message is never followed by `Send`, `Broadcast`, or `SendToServer`.
* **Orphaned receivers** — `net.Receive` is registered for a message name that nothing in the workspace ever sends.
* **Payload mismatches** — The sequence of `net.Write*` calls on the sender does not match the `net.Read*` calls on the receiver.

## Payload mismatch example

When the server and client read and write data in different orders or with different types, it surfaces a diagnostic.

<CodeGroup>
  ```lua Server theme={null}
  util.AddNetworkString("MyMessage")

  net.Start("MyMessage")
  net.WriteString("Hello")
  net.WriteEntity(someEntity)
  net.Broadcast()
  ```

  ```lua Client theme={null}
  net.Receive("MyMessage", function()
      local msg = net.ReadString()
      local id = net.ReadUInt(8) -- Mismatch: server wrote Entity, client reads UInt
  end)
  ```
</CodeGroup>

The server flags the mismatch because the server writes an `Entity` at position 2, but the client expects a `UInt`.

## Completion and rename

### Message name completion

Inside `net.Start` and `net.Receive`, the server suggests message names that are already registered with `util.AddNetworkString` anywhere in the workspace.

### Rename support

When you rename a network string in `util.AddNetworkString`, the change propagates to every `net.Start` and `net.Receive` that uses the same name.

## Net Message Graph

Use the **GLua: Show Net Message Graph** command to open a visual overview of every net message in your workspace. The graph shows senders, receivers, and payload shapes in one view.

<Tip>
  Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run `GLua: Show Net Message Graph` to explore your net message topology.
</Tip>


## Related topics

- [GLua Language Server: GMod Lua IDE Support](/index.md)
- [Get Started with GLua Language Server](/quickstart.md)
- [GLua Language Server Commands](/reference/commands.md)
- [GLua Diagnostic Rules Reference](/reference/rules.md)
