shieldSecurity System

Overview

The GC2 Networking Security System provides comprehensive server-authoritative protection for all Game Creator 2 networking modules. It includes:

  • Rate Limiting: Prevents request spam from clients

  • Sequence Validation: Detects replay attacks

  • State Validation: Detects state desynchronization and cheating

  • Violation Tracking: Logs, warns, blocks, or kicks malicious clients

  • Optional Source Patches: Deep integration for maximum security

Architecture

Quick Start

1. Add NetworkSecurityManager to Scene

2. Configure Security Settings

In the Inspector on NetworkSecurityManager:

Setting
Default
Description

Enable Rate Limiting

true

Limit requests per second

Max Requests Per Second

20

Per-module request limit

Enable Anomaly Detection

true

Track violation patterns

Violation Threshold

5

Violations before action

Violation Action

TempBlock

LogOnly/LogAndWarn/TempBlock/Kick

Temp Block Duration

30s

Block duration for TempBlock

Enable State Validation

true

Periodic state checks

3. Integrate with Controllers

Optional Source Patches

For maximum security, you can patch GC2 source files to add deep network validation hooks. This prevents clients from bypassing network validation by calling GC2 methods directly.

Patch Menu

Access via: Game Creator > Networking Layer > Patches

Module
What Gets Patched

Abilities

Caster.Cast(), Learn(), UnLearn()

Stats

RuntimeStatData.Base, AddModifier(), RemoveModifier()

RuntimeAttributeData.Value

Inventory

TBagContent.Use(), Drop()

BagWealth.Set(), Add()

Melee

MeleeStance.InputCharge/Execute(), PlaySkill(), Hit()

Skill.OnHit()

Shooter

ShooterStance.PullTrigger(), ReleaseTrigger(), Reload()

WeaponData.Shoot()

How to Apply Patches

  1. Go to Game Creator > Networking Layer > Patches > [Module] > Patch

  2. Review the dialog explaining changes

  3. Click "Apply Patch"

  4. Backups are created automatically

How to Remove Patches

  1. Go to Game Creator > Networking Layer > Patches > [Module] > Unpatch

  2. Original files are restored from backup

Check Patch Status

  • Single module: Game Creator > Networking Layer > Patches > [Module] > Check Status

  • All modules: Game Creator > Networking Layer > Patches > Status Overview...

Security Violation Types

Type
Description

RateLimitExceeded

Client sending too many requests

InvalidSequence

Out-of-order or duplicate request IDs (replay attack)

ReplayAttack

Request ID already processed

OutOfBoundsValue

Value outside acceptable range

StateDesync

Client state doesn't match server

UnauthorizedAction

Action not permitted for client

InvalidTarget

Targeting entity client shouldn't access

Violation Actions

Configure in NetworkSecurityConfig:

Action
Behavior

LogOnly

Log to console only

LogAndWarn

Log + send warning to client

TempBlock

Temporarily block client requests

Kick

Disconnect client from server

Custom

Call your custom handler

Module-Specific Configuration

You can configure different security settings per module:

Enable module overrides in Inspector by checking "Use Module Overrides".

State Validators

State validators periodically compare client-reported state with server-authoritative state:

Configure validation interval and discrepancy threshold per module.

Events

Subscribe to security events for custom handling:

Best Practices

  1. Always validate on server: Never trust client data

  2. Use rate limiting: Prevent request flooding

  3. Enable state validation: Catch desync early

  4. Apply patches for competitive games: Maximum security

  5. Test thoroughly: Security can cause false positives

  6. Log violations: Track potential exploits

  7. Tune thresholds: Balance security vs. false positives

Troubleshooting

"Rate limited" errors for legitimate players

  • Increase MaxRequestsPerSecond for the module

  • Increase RateLimitWindow for burst tolerance

False positive state desync

  • Increase ValidationInterval

  • Increase MaxDiscrepancies threshold

  • Check for high network latency

Patches fail to apply

  • GC2 source may have been updated

  • Check console for specific error

  • Create GitHub issue with GC2 version

File Locations

File
Purpose

Security/NetworkSecurityTypes.cs

Config, enums, helpers

Security/NetworkSecurityManager.cs

Central manager singleton

Security/StateValidators.cs

State validation classes

Security/SecurityIntegration.cs

Controller integration helpers

Patches/GC2PatcherBase.cs

Abstract patcher base

Patches/GC2PatchManager.cs

Menu items & status window

Patches/[Module]Patcher.cs

Module-specific patchers

Library/GameCreator2NetworkingLayer/Patches/Backups/[Module]/

Auto-generated backup files

Version Compatibility

  • Unity: 6 LTS

  • Game Creator 2: 2.18.6+

  • DaimahouGames Abilities: 2.0+

Support

For issues or questions, please open a GitHub issue with:

  • Unity version

  • GC2 module versions

  • Console error logs

  • Steps to reproduce

Last updated