개념 요약
Authority Actor의 상태를 최종 결정할 권한
Authority Actor 멀티플레이에서 보통 서버에 있는 원본 Actor
Proxy 서버 Authority Actor를 클라이언트가 복제받은 Actor
AutonomousProxy 소유 클라이언트가 조작 가능한 Proxy
SimulatedProxy 서버 상태를 받아 표시만 하는 Proxy
HasAuthority 현재 Actor의 LocalRole이 Authority인지 확인
NetMode World / 프로세스가 서버인지 클라이언트인지 구분
LocalRole 현재 머신에서의 Actor Role
RemoteRole 반대편 머신에서의 Actor Role

서버에 존재하는 Actor는 대부분 Authority다. 클라이언트에 존재하는 Actor는 대부분 서버 Actor의 Proxy다. 게임 결과를 바꾸는 로직은 HasAuthority()에서 처리하고, 입력·UI·카메라 같은 로컬 표현 로직은 IsLocallyControlled() 또는 IsLocalController()에서 처리한다.


Authority

Authority특정 Actor의 상태를 최종 결정할 권한을 의미한다.

멀티플레이 기준으로 서버에 존재하는 원본 Actor가 Authority를 가진다.
클라이언트에 존재하는 Actor는 서버 Actor를 복제받은 Proxy(허상)다.

구분 의미
ROLE_Authority 게임 상태를 최종 결정할 수 있는 원본 Actor
ROLE_AutonomousProxy 소유 클라이언트가 조작할 수 있는 복제본
ROLE_SimulatedProxy 다른 클라이언트에서 보이는 수동 복제본
ROLE_None 복제되지 않거나 네트워크 Role이 없는 상태

HasAuthority()가 true라면 현재 실행 중인 Actor는 보통 서버 쪽 원본 Actor라고 보면 된다.
그러면 서버에 있는 모든 Actor는 Authority인가
서버 World에 존재하는 Actor는 대부분 ROLE_Authority를 가진다.

서버에 존재하는 Actor 서버에서의 Role
GameMode ROLE_Authority
GameState ROLE_Authority
PlayerController ROLE_Authority
PlayerState ROLE_Authority
Pawn / Character ROLE_Authority
Monster ROLE_Authority
Projectile ROLE_Authority
Replicated Item Actor ROLE_Authority

Authority의 Proxy

flowchart LR
    A[Server Actor<br/>ROLE_Authority] --> B[Owner Client<br/>ROLE_AutonomousProxy]
    A --> C[Other Client<br/>ROLE_SimulatedProxy]
위치 역할
서버 원본 Actor. 상태 확정
소유 클라이언트 조작 가능한 복제본
다른 클라이언트 서버 상태를 받아 보여주는 복제본

클라이언트에 있는 Actor는 Proxy로 화면에 보이지만, 중요한 게임 상태를 최종 결정하지 않는다.

  • Autonomous Proxy : 소유 클라이언트가 조작할 수 있는 복제본.
    특징 설명
    서버 상태 수신 Replication으로 동기화
    로컬 입력 처리 가능
    서버로 요청 전송 Server RPC 가능
    게임 결과 확정 불가. 서버가 확정
if (IsLocallyControlled())
{
    // 내 캐릭터 입력, 카메라, UI 처리
}

입력은 클라이언트에서 받을 수 있지만, 실제 데미지 적용이나 스폰 확정은 서버에서 처리해야 한다.

  • Simulated Proxy : 내가 조작하지 않는 복제본이다.
    내 화면에 보이는 다른 플레이어의 캐릭터가 대표적이다.
    특징 설명
    서버 상태 수신 가능
    위치 보간 가능
    애니메이션 표시 가능
    로컬 입력 처리 불가
    서버 RPC 요청 보통 불가
    게임 결과 확정 불가
대상 내 클라이언트에서의 Role
내 캐릭터 ROLE_AutonomousProxy
친구 캐릭터 ROLE_SimulatedProxy
몬스터 보통 ROLE_SimulatedProxy

SimulatedProxy는 서버 상태를 받아 자연스럽게 보여주는 역할이다.


HasAuthority

캐릭터 수치에 영향을 주는 연산은 서버에서 진행된다.
HasAuthority()는 현재 Actor의 LocalRoleROLE_Authority인지 확인한다.

bool AActor::HasAuthority() const
{
    return GetLocalRole() == ROLE_Authority;
}

서버에서만 실행해야 하는 로직에 사용한다.

void AMyCharacter::ApplyDamage(float Damage)
{
    if (!HasAuthority())
    {
        return;
    }

    Health -= Damage;
}

NetMode와 Authority 차이

NetMode는 World 기준이고, Authority는 Actor 기준이다.

구분 기준 질문
NetMode World / 프로세스 지금 이 World가 서버인가 클라이언트인가
LocalRole Actor 현재 머신에서 이 Actor는 Authority인가 Proxy인가
HasAuthority() Actor 이 Actor가 상태 확정 권한을 가지고 있는가
ENetMode Mode = GetNetMode();

if (HasAuthority())
{
    // 이 Actor의 권한이 있는 곳
}

서버 World에 있다고 해서 항상 “내가 조작하는 Actor”인 것은 아니다.
클라이언트 World에 있다고 해서 항상 “입력 가능한 Actor”인 것도 아니다.

서버 권한 로직은 HasAuthority()로 판단하고, 로컬 입력/카메라/UI는 IsLocalController() 또는 IsLocallyControlled()로 판단한다.


LocalRole과 RemoteRole

LocalRole은 현재 머신에서의 Actor Role이다.
RemoteRole은 반대편 머신에서의 Actor Role이다.

Actor 상황 LocalRole RemoteRole
서버의 플레이어 Pawn ROLE_Authority ROLE_AutonomousProxy
소유 클라이언트의 내 Pawn ROLE_AutonomousProxy ROLE_Authority
다른 클라이언트의 친구 Pawn ROLE_SimulatedProxy ROLE_Authority
서버 전용 Actor ROLE_Authority ROLE_None

서버에 있는 Actor는 대부분 LocalRole == Authority다.


서버에서 Authority인 Actor 구분

서버에서는 여러 Actor가 모두 Authority일 수 있다.

Actor 서버 LocalRole 서버 RemoteRole 의미
클라이언트가 조작하는 Pawn Authority AutonomousProxy 소유 클라이언트가 조작
다른 클라이언트에게 보이는 몬스터 Authority SimulatedProxy 클라들은 보기만 함
서버 전용 GameMode Authority None 클라에 복제되지 않음

LocalRole만 보면 전부 Authority라서 구분이 어렵다.
RemoteRole까지 보면 소유 클라이언트가 있는 Actor인지, 단순 복제 Actor인지, 서버 전용 Actor인지 판단할 수 있다.


IsLocallyControlled와 Authority

HasAuthority()IsLocallyControlled()는 목적이 다르다.

함수 기준 사용처
HasAuthority() 서버 권한 Actor인가 데미지, 스폰, 게임 상태 변경
IsLocallyControlled() 현재 머신에서 조작 중인 Pawn인가 입력, 카메라, 상호작용 UI
IsLocalController() 현재 머신의 로컬 Controller인가 HUD 생성, 입력 설정
if (HasAuthority())
{
    // 서버 게임플레이 로직
}
if (IsLocallyControlled())
{
    // 내 캐릭터 로컬 입력 / 카메라 / UI
}
if (IsLocalController())
{
    // 내 PlayerController에서만 HUD 생성
}

Listen Server에서 주의할 점

Listen Server는 서버이면서 동시에 로컬 플레이어도 가진다.

대상 Role
Listen Server의 호스트 캐릭터 ROLE_Authority
원격 클라이언트의 자기 캐릭터 ROLE_AutonomousProxy
원격 클라이언트에서 보이는 호스트 캐릭터 ROLE_SimulatedProxy

Listen Server에서는 호스트가 화면을 보고 직접 플레이하지만, 호스트 캐릭터는 서버 World에 존재하므로 Authority다.


GameMode와 Authority

GameMode는 서버에만 존재한다.

객체 서버 클라이언트
GameMode 존재 없음
GameState 존재 복제됨
PlayerController 존재 소유 클라이언트에만 존재
Pawn 존재 복제됨

클라이언트에서 GetGameMode()를 호출하면 nullptr이 나올 수 있다.
GameMode 접근은 서버에서 처리한다.
클라이언트도 알아야 하는 정보는 GameState에 두는 것이 적합하다.

반응형

'TIL' 카테고리의 다른 글

Unreal Engine Angel Script  (0) 2026.08.03
UE NetRole  (0) 2026.07.31
MyaCat 발표 후 회고  (0) 2026.07.24
World Partition  (0) 2026.07.23
In Place 작업  (0) 2026.07.22