feat(network): migra entityId int32→int64 nos delegates do ZeusNetwork
V3 Server Meshing (server-side) precisa entityId 64-bit (high32 = FNV-1a do worldId, low32 = counter local) pra evitar collision cross-ZS. Os delegates do plugin (OnPlayerSpawned, OnPlayerDespawned, OnCharInfoReceived, OnPlayerStateUpdate, OnHpSpUpdate, OnLevelUp) e os métodos TryGetLast* migram pra int64; handlers em ZMMOPlayerCharacter, ZMMOWorldSubsystem, UIFrontEndFlowSubsystem e ZMMOAttributeNetworkHandler acompanham. FCachedSpawn::EntityId, FZMMOAttributesSnapshot::EntityId e SeedEntityId também viram int64. Wire S_SPAWN_PLAYER ainda carrega uint32 (server faz XOR high32^low32 pra manter unicidade estatística entre ZSs); ampliação do opcode pra uint64 fica pra PR futuro. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -63,7 +63,7 @@ namespace
|
||||
//
|
||||
// Cada UZMMOAttributeComponent carrega seu proprio EntityId (seed em
|
||||
// AZMMOPlayerCharacter::HandleLocalSpawnReady ou no primeiro snapshot).
|
||||
UZMMOAttributeComponent* FindComponentForEntity(UWorld* World, int32 EntityId)
|
||||
UZMMOAttributeComponent* FindComponentForEntity(UWorld* World, int64 EntityId) // PR-HANDOFF-007 int64
|
||||
{
|
||||
if (!World || EntityId == 0) { return nullptr; }
|
||||
const AGameStateBase* GS = World->GetGameState();
|
||||
@@ -176,7 +176,7 @@ void UZMMOAttributeNetworkHandler::HandleAttributeSnapshotFull(const FZeusAttrib
|
||||
}
|
||||
}
|
||||
|
||||
void UZMMOAttributeNetworkHandler::HandleHpSpUpdate(int32 EntityId, int32 Hp, int32 Sp)
|
||||
void UZMMOAttributeNetworkHandler::HandleHpSpUpdate(int64 EntityId, int32 Hp, int32 Sp)
|
||||
{
|
||||
UWorld* World = GetWorld();
|
||||
if (!World) { return; }
|
||||
@@ -187,7 +187,7 @@ void UZMMOAttributeNetworkHandler::HandleHpSpUpdate(int32 EntityId, int32 Hp, in
|
||||
}
|
||||
}
|
||||
|
||||
void UZMMOAttributeNetworkHandler::HandleLevelUp(int32 EntityId, int32 NewBaseLevel, int32 StatusPointDelta)
|
||||
void UZMMOAttributeNetworkHandler::HandleLevelUp(int64 EntityId, int32 NewBaseLevel, int32 StatusPointDelta)
|
||||
{
|
||||
UWorld* World = GetWorld();
|
||||
if (!World) { return; }
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
/// chegar, garantindo que o NetworkHandler consiga rotear via lookup
|
||||
/// por EntityId desde o inicio.
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|Attributes")
|
||||
void SeedEntityId(int32 InEntityId) { Current.EntityId = InEntityId; }
|
||||
void SeedEntityId(int64 InEntityId) { Current.EntityId = InEntityId; }
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Zeus|Attributes")
|
||||
const FZMMOAttributesSnapshot& GetSnapshot() const { return Current; }
|
||||
|
||||
@@ -34,8 +34,8 @@ public:
|
||||
|
||||
private:
|
||||
void HandleAttributeSnapshotFull(const FZeusAttributesPayload& Payload);
|
||||
void HandleHpSpUpdate(int32 EntityId, int32 Hp, int32 Sp);
|
||||
void HandleLevelUp(int32 EntityId, int32 NewBaseLevel, int32 StatusPointDelta);
|
||||
void HandleHpSpUpdate(int64 EntityId, int32 Hp, int32 Sp);
|
||||
void HandleLevelUp(int64 EntityId, int32 NewBaseLevel, int32 StatusPointDelta);
|
||||
void HandleStatAllocReply(bool bAccepted, int32 Reason);
|
||||
|
||||
UZeusNetworkSubsystem* GetZeusNetSubsystem() const;
|
||||
|
||||
@@ -20,7 +20,7 @@ struct ZMMOATTRIBUTES_API FZMMOAttributesSnapshot
|
||||
GENERATED_BODY()
|
||||
|
||||
// === Identidade + classe ===
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 EntityId = 0;
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int64 EntityId = 0;
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Attributes") int32 ClassId = 0;
|
||||
|
||||
// === Progressao ===
|
||||
|
||||
Reference in New Issue
Block a user