Network Security
Prevent cheating in multiplayer.
Introduction
Prevent cheating in multiplayer. This page provides a complete guide to network security in Appley, covering everything from setup to advanced techniques.
Networking is a core area of Appley. Understanding network security will help you build better games and use the platform more effectively. This documentation is designed for professional level users.
Requirements
Before working with network security, ensure you have the following:
- A Studio plan subscription (required for multiplayer)
- Understanding of client-server architecture
- An Appley project with multiplayer scenes
- Knowledge of sync and RPC concepts
Estimated Completion Time
Step-by-Step Guide
Follow these steps to work with network security in your Appley project:
Enable multiplayer
In project settings, enable multiplayer networking for network security.
Set up the lobby
Create a lobby system with room codes and player limits.
Define networked state
Mark variables as networked to auto-sync across clients.
Implement RPCs
Use network.rpc() for remote procedure calls between clients and host.
Test multiplayer
Open the game in two browser tabs to test client-host communication.
FluxScript Example
Below is an Appley Scripting (Flux Scripting) code example demonstrating network security:
// Networking — Network Security
on start {
if network.isHost {
network.spawn("enemy", vec3(0, 0, 10))
}
}
on playerJoined(player) {
ui.toast(player.name + " joined!")
network.sync("scoreboard", scoreboard)
}
networked score = 0
on update(dt) {
if network.isLocalPlayer {
if input("w") player.move(forward, dt)
if input("f") {
network.rpc("fireWeapon", { pos: player.position })
}
}
}
on rpc("fireWeapon", data) {
effects.spawn("muzzle_flash", data.pos)
audio.play("shoot")
}Node Script Example
The same logic can be implemented using Node Scripting. Here is the equivalent node graph:
[On Start] ──► [Branch: isHost] ──► [Spawn: enemy]
[On Player Joined] ──► [Toast: name + " joined"]
──► [Sync: scoreboard]
[On Update] ──► [Branch: isLocalPlayer]
──► [Input "f"] ──► [RPC: "fireWeapon"]Interchangeable Systems
Common Mistakes
Avoid these frequent mistakes when working with network security:
Trusting client-side data
Validate all client input on the host before applying.
Syncing too many variables
Only sync essential state; use RPCs for events.
Not handling player disconnection
Clean up objects and state when a player leaves.
Using large networked payloads
Keep sync data small — send IDs, not full objects.
Troubleshooting
If you encounter issues with network security, try these solutions:
Players cannot connect
High latency and lag
State desync between clients
Players see different game states
Performance Tips
Optimize your use of network security with these performance tips:
- Use host-authoritative architecture — the host validates all game-critical actions.
- Implement client-side prediction for responsive player movement.
- Use interpolation for remote entities to smooth over network jitter.
- Send only essential data — use IDs and enums, not full strings.
Related Pages
Explore these related documentation pages:
Example Project
Download a complete example project demonstrating network security:
