- Add hybrid deployment modes: local_dev (MVP) and production_pwa (optional) - Integrate WarFactory engine reuse with hot-reload 0.4ms - Define multi-target compilation strategy (DLL/SO/WASM) - Detail both deployment modes with cost analysis - Add progressive roadmap: Phase 1 (local), Phase 2 (POC WASM), Phase 3 (cloud) - Budget clarified: $10-20/mois (local) vs $13-25/mois (cloud) - Document open questions for technical validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
131 lines
4.3 KiB
Markdown
131 lines
4.3 KiB
Markdown
# Security Measures
|
|
|
|
**Points 311-330 - Security Measures** - Server authority, anti-cheat, client prediction, psychological warfare
|
|
|
|
## Server Authority
|
|
|
|
### Authoritative Design
|
|
**Server contrôle toute la simulation** :
|
|
|
|
- **Server Authority** : Simulation, logique métier, état de jeu complets
|
|
- **Client Responsibilities** : Rendu, interface, cache local uniquement
|
|
- **Zero Game Logic** : Aucune logique métier côté client
|
|
- **Bandwidth** : Clients reçoivent state updates, n'envoient que commands
|
|
|
|
### Mode-Based Security
|
|
**Sécurité adaptative selon contexte** :
|
|
|
|
```cpp
|
|
// Solo Mode
|
|
- **Local config override** autorisé
|
|
- **Cheat-friendly** pour expérimentation
|
|
|
|
// Multiplayer Mode
|
|
- **Server autoritaire** sur toutes les configs
|
|
- **Anti-cheat automatique** via validation
|
|
- **Zero tolerance** pour modifications
|
|
```
|
|
|
|
## Anti-cheat System
|
|
|
|
### Anti-cheat Psychologique
|
|
**Stratégie : Cheat attempts → "bugs" simulés progressifs**
|
|
|
|
```cpp
|
|
class AntiCheatPsycho {
|
|
void onCheatDetected(CheatType type) {
|
|
switch(type) {
|
|
case SPEED_HACK:
|
|
simulateRandomLag(50ms, 500ms);
|
|
break;
|
|
case RESOURCE_HACK:
|
|
simulateVisualGlitches(tanks, 5%);
|
|
break;
|
|
case DAMAGE_HACK:
|
|
simulateDesync(movement, 2%);
|
|
break;
|
|
}
|
|
}
|
|
};
|
|
```
|
|
|
|
### Design-Based Anti-cheat
|
|
- **Anti-cheat naturel** : Server authoritative pour toute logique métier
|
|
- **Anti-cheat par design** : Architecture empêche cheating structurellement
|
|
- **Anti-cheat automatique** : Validation intégrée dans l'architecture
|
|
|
|
## Client Prediction System
|
|
|
|
### V1 vs V2 Prediction Architecture
|
|
|
|
#### V1 : Thin Client (No Prediction)
|
|
- **Server authoritative** : Toute validation côté serveur
|
|
- **Latence perceptible** : 50-150ms délai action/feedback
|
|
- **Sécurité maximale** : Zero logique côté client
|
|
- **Simplicité** : Une seule source de vérité
|
|
|
|
#### V2 : Shared Logic Prediction
|
|
- **Logique métier partagée** : Client/serveur utilisent même code
|
|
- **Prédiction locale** : Feedback instantané côté client
|
|
- **Réconciliation serveur** : Validation authoritative maintenue
|
|
- **Latence zéro perçue** : Performance optimale
|
|
|
|
### Migration Progressive V1→V2
|
|
**Code adaptable sans réécriture** :
|
|
|
|
```cpp
|
|
// Code adaptable V1/V2 sans réécriture
|
|
if (config.enable_v2_prediction) {
|
|
// V2: Client prediction + server validation
|
|
} else {
|
|
// V1: Server authoritative (fallback sûr)
|
|
}
|
|
```
|
|
|
|
### Performance Targets
|
|
- **V1 Client Target** : 30+ fps stable
|
|
- **V2 Client Target** : 60+ fps avec prediction
|
|
- **V2 Network** : 30ms server, 0ms perceived client
|
|
|
|
## Psychological Warfare
|
|
|
|
### Anti-cheat Psychologique Avancé
|
|
**Guerre psychologique contre cheaters** :
|
|
|
|
- **Bugs simulés progressifs** : Dégradation subtile performance
|
|
- **Faux positifs contrôlés** : Doute sur efficacité cheats
|
|
- **Désynchronisation sélective** : Chaos apparent pour cheaters
|
|
- **Retention légitimes** : Joueurs normaux non affectés
|
|
|
|
### Stratégies Comportementales
|
|
- **SPEED_HACK** → Random lag simulation (50-500ms)
|
|
- **RESOURCE_HACK** → Visual glitches sur assets (5% tanks)
|
|
- **DAMAGE_HACK** → Movement desync (2% déviation)
|
|
- **Escalation progressive** : Intensité augmente avec persistance
|
|
|
|
## Mode-Based Security
|
|
|
|
### Development Mode
|
|
- **Config unrestricted** : Toute modification autorisée
|
|
- **Debug tools** : Access complet aux outils développement
|
|
- **No anti-cheat** : Liberté totale pour testing
|
|
|
|
### Solo Mode
|
|
- **Modding friendly** : Config system disponible
|
|
- **Local authority** : Player contrôle paramètres
|
|
- **Experimentation** : Cheat autorisé pour fun
|
|
|
|
### Multiplayer Mode
|
|
- **Server authority** : Contrôle total serveur
|
|
- **Anti-cheat active** : Système complet activé
|
|
- **Zero tolerance** : Aucune modification autorisée
|
|
- **Validation stricte** : Tous inputs validés
|
|
|
|
## Sources
|
|
|
|
**Documentation originale :**
|
|
- `docs/global/architecture-technique.md` - Server Authority design
|
|
- `docs/toCheck/architecture-modulaire.md` - Anti-cheat psychologique
|
|
- `docs/architecture-technique.md` - Client prediction V1/V2
|
|
|
|
**Points couverts :** 20 spécifications sécurité détaillées |