Files
nexus/wiki/concepts/Server-Authoritative-Model.md
2026-04-26 12:02:53 +08:00

1.4 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
Server-Authoritative Model concept
unreal-multiplayer-architect
2026-04-26

Definition

服务器权威模型是 UE5 多人游戏网络架构的核心原则服务器拥有真相Server Owns Truth所有游戏状态变更必须在服务器执行客户端仅发送请求RPC由服务器验证后复制结果。

Core Principles

  • 所有游戏逻辑和状态变更必须运行在服务器端
  • 客户端仅负责输入发送、本地预测和视觉表现
  • HasAuthority() 检查必须在每次状态变更前执行
  • 服务器有权拒绝任何非法客户端请求

Implementation in UE5

void AMyCharacter::TakeDamage(float DamageAmount)
{
    // 必须先检查权威
    if (!HasAuthority()) return; // 客户端绝对不能直接修改生命值
    
    Health -= DamageAmount;
    // 服务器修改后自动复制到所有客户端
}

Connection to Other Concepts

Relationship to Agent

UnrealMultiplayerArchitect 是该模型的严格执行者,其核心规则强制所有游戏状态变更必须通过服务器权威验证。

Aliases

  • Server Authority
  • Server-Owns-Truth
  • Server-Authoritative Networking