2 Commits

Author SHA1 Message Date
16de963301 fix(net): S_CHAR_INFO so' aplica em si mesmo (anti name overwrite por proxy)
Bug: handler aceitava qualquer S_CHAR_INFO do server (proprio + catch-up de
proxies pre-existentes) e sobrescrevia o PlayerState local. Resultado: nome
do ultimo proxy recebido virava o nome do char local na tela.

Fix: bail se InEntityId != ZeusEntityId (proxies remotos sao roteados pelo
registry no UZeusWorldSubsystem; nameplate por EntityId fica pra futuro).
2026-06-03 21:56:49 -03:00
8d73cc9df8 feat(gas): SM6 client EntityId u64 + M8 cue assets + UI/data tweaks (sessao 1+2) 2026-06-03 18:18:02 -03:00
46 changed files with 85 additions and 0 deletions

View File

@@ -71,6 +71,13 @@ ScreenSetAsset=/Game/ZMMO/UI/InGame/DA_InGameScreenSet.DA_InGameScreenSet
; (UWorldSubsystem) subscribe nos delegates do UZeusNetworkSubsystem. ; (UWorldSubsystem) subscribe nos delegates do UZeusNetworkSubsystem.
+ComponentClasses=/Script/ZeusGAS.ZeusGASComponent +ComponentClasses=/Script/ZeusGAS.ZeusGASComponent
; === GAS Cue paths (Batch 2.5 — S_ABILITY_CUE multicast cosmetico) ===
; UGameplayCueManager scaneia esses paths no boot pra mapear FGameplayTag
; -> AGameplayCueNotify_Actor BP. UZeusGASComponent::DispatchAbilityCue chama
; ASC->ExecuteGameplayCueLocal(CueTag, params) -> manager resolve pelo path.
[/Script/GameplayAbilities.AbilitySystemGlobals]
+GameplayCueNotifyPaths="/Game/ZMMO/GAS/Cues"
[/Script/Engine.AssetManagerSettings] [/Script/Engine.AssetManagerSettings]
-PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) -PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown))
-PrimaryAssetTypesToScan=(PrimaryAssetType="PrimaryAssetLabel",AssetBaseClass=/Script/Engine.PrimaryAssetLabel,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) -PrimaryAssetTypesToScan=(PrimaryAssetType="PrimaryAssetLabel",AssetBaseClass=/Script/Engine.PrimaryAssetLabel,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown))

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -432,6 +432,17 @@ void AZeusCharacter::HandleZeusCharInfo(const int64 InEntityId, const FString& C
TEXT("AZeusCharacter: S_CHAR_INFO recebido EntityId=%lld name=%s guild=%s"), TEXT("AZeusCharacter: S_CHAR_INFO recebido EntityId=%lld name=%s guild=%s"),
InEntityId, *CharName, *GuildName); InEntityId, *CharName, *GuildName);
// 2026-06-03 fix: server envia S_CHAR_INFO de TODOS os players (proprio +
// catch-up de proxies pre-existentes). Sem este filtro, o nome do ultimo
// proxy recebido sobrescrevia o do pawn local (ex: player Mateuus loga e
// ve "Olatudook" em si mesmo porque o catch-up do Olatudook chegou depois
// do S_CHAR_INFO proprio). Proxies remotos sao roteados pelo registry no
// UZeusWorldSubsystem (futuro nameplate por EntityId).
if (ZeusEntityId != 0 && InEntityId != ZeusEntityId)
{
return;
}
APlayerState* PS = GetPlayerState(); APlayerState* PS = GetPlayerState();
if (!PS) if (!PS)
{ {

View File

@@ -2,10 +2,13 @@
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Engine/World.h" #include "Engine/World.h"
#include "GameFramework/GameStateBase.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "ZeusEntity.h" #include "ZeusEntity.h"
#include "ZeusEntityInterface.h" #include "ZeusEntityInterface.h"
#include "ZeusGASComponent.h"
#include "ZeusPlayerProxy.h" #include "ZeusPlayerProxy.h"
#include "ZeusPlayerState.h"
#include "ZeusNetworkSubsystem.h" #include "ZeusNetworkSubsystem.h"
void UZeusWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection) void UZeusWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection)
@@ -160,6 +163,54 @@ void UZeusWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
AsEntity->SetEntityRelevant(true); AsEntity->SetEntityRelevant(true);
} }
// === PlayerState pra proxies (Batch 2.5+) ===
//
// Sem PlayerState, o proxy fica fora do GameState->PlayerArray. Daqui pra
// cima, qualquer sistema que itera PlayerArray (UZeusGASNetworkHandler::
// FindGASComponentForEntity, HUD, chat, friend list) NAO consegue achar o
// proxy -> fallback ao local player -> efeito apareceria no char errado
// (bug do cue do Dash). Criar PS replicado-fake permite que o pipeline GAS
// trate proxies igual a local players.
//
// PlayerState tem o UZeusGASComponent via DefaultGame.ini Component Registry,
// entao GASComp e' auto-instanciado. So' precisamos seed o EntityId.
if (APawn* ProxyPawn = Cast<APawn>(SpawnedActor))
{
FActorSpawnParameters PSParams;
PSParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
PSParams.Owner = ProxyPawn;
AZeusPlayerState* ProxyPS = World->SpawnActor<AZeusPlayerState>(
AZeusPlayerState::StaticClass(), FVector::ZeroVector, FRotator::ZeroRotator, PSParams);
if (ProxyPS)
{
ProxyPawn->SetPlayerState(ProxyPS); // tambem chama ProxyPS->SetPawn(ProxyPawn)
// Add ao PlayerArray do GameState (replicacao UE faria isso automatico,
// mas no nosso pipeline custom o PS local-fake precisa ser inserido).
if (AGameStateBase* GS = World->GetGameState())
{
GS->AddPlayerState(ProxyPS);
}
// Seed EntityId no GASComp do PS (criado via Component Registry).
// FindGASComponentForEntity vai resolver via PS->FindComponentByClass.
if (UZeusGASComponent* GASComp = ProxyPS->FindComponentByClass<UZeusGASComponent>())
{
GASComp->SeedEntityId(EntityId);
}
UE_LOG(LogZMMO, Log,
TEXT("ZeusWorldSubsystem: PlayerState criado p/ proxy EntityId=%lld PS=%s"),
EntityId, *ProxyPS->GetName());
}
else
{
UE_LOG(LogZMMO, Warning,
TEXT("ZeusWorldSubsystem: SpawnActor<AZeusPlayerState> falhou pra proxy EntityId=%lld"),
EntityId);
}
}
RemoteEntities.Add(EntityId, TWeakObjectPtr<AActor>(SpawnedActor)); RemoteEntities.Add(EntityId, TWeakObjectPtr<AActor>(SpawnedActor));
UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem: spawned remote EntityId=%d at (%s) yaw=%.1f t=%lld"), UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem: spawned remote EntityId=%d at (%s) yaw=%.1f t=%lld"),
EntityId, *PosCm.ToString(), YawDeg, ServerTimeMs); EntityId, *PosCm.ToString(), YawDeg, ServerTimeMs);
@@ -185,6 +236,22 @@ void UZeusWorldSubsystem::HandlePlayerDespawned(const int64 EntityId)
{ {
AsEntity->SetEntityRelevant(false); AsEntity->SetEntityRelevant(false);
} }
// Destrui PS proxy linkado (Batch 2.5+). Sem isso o GameState->PlayerArray
// fica com PS orfa apos o proxy ser destruido.
if (APawn* Pawn = Cast<APawn>(Actor))
{
if (APlayerState* PS = Pawn->GetPlayerState())
{
if (UWorld* World = GetWorld())
{
if (AGameStateBase* GS = World->GetGameState())
{
GS->RemovePlayerState(PS);
}
}
PS->Destroy();
}
}
Actor->Destroy(); Actor->Destroy();
} }
RemoteEntities.Remove(EntityId); RemoteEntities.Remove(EntityId);