feat(char-spawn): Fase 4 client + UI WBPs paralelo #2

Merged
Mateuus merged 8 commits from feat/frontend-mainmenu-skeleton into main 2026-05-23 02:16:28 -03:00
Owner

Summary

Fase 4 (foco):

  • FZMMOMapDef + DT_Maps + L_TestWorld em /Game/ZMMO/Maps/World/
  • UIFrontEndFlowSubsystem: MapsTableAsset, FindMapDef, TravelToMapById, PendingSpawnPose
  • UIUserLobbyScreen parseia uint16 mapId + dispara TravelToMapById + SetPendingSpawnPose
  • AZMMOPlayerCharacter::BeginPlay reposiciona pawn na pos do DB (substitui PlayerStart)
  • DefaultGame.ini: MapsTableAsset apontando pra DT_Maps

Working tree paralelo:

  • AutoCreated/MMOWidget/Widgets (WBP_Boot/Login/CharSelect/etc.)
  • Refatora��o de fontes (FF_* deletadas, F_* + Font_*)
  • L_Test_UI ext actors
  • UI_CheckBox_Master, FontMap, ExternalContent gitkeeps, Menu.umap

Test plan

  • PIE multi-instance: 2 chars logam, pos carregada do DB no spawn
  • Writeback no logout salvou pos no MySQL (Navicat confirmou)
  • Writeback peri�dico TICK rolou 7+ ciclos
## Summary **Fase 4 (foco):** - FZMMOMapDef + DT_Maps + L_TestWorld em /Game/ZMMO/Maps/World/ - UIFrontEndFlowSubsystem: MapsTableAsset, FindMapDef, TravelToMapById, PendingSpawnPose - UIUserLobbyScreen parseia uint16 mapId + dispara TravelToMapById + SetPendingSpawnPose - AZMMOPlayerCharacter::BeginPlay reposiciona pawn na pos do DB (substitui PlayerStart) - DefaultGame.ini: MapsTableAsset apontando pra DT_Maps **Working tree paralelo:** - AutoCreated/MMOWidget/Widgets (WBP_Boot/Login/CharSelect/etc.) - Refatora��o de fontes (FF_* deletadas, F_* + Font_*) - L_Test_UI ext actors - UI_CheckBox_Master, FontMap, ExternalContent gitkeeps, Menu.umap ## Test plan - [x] PIE multi-instance: 2 chars logam, pos carregada do DB no spawn - [x] Writeback no logout salvou pos no MySQL (Navicat confirmou) - [x] Writeback peri�dico TICK rolou 7+ ciclos
Mateuus added 8 commits 2026-05-23 02:16:13 -03:00
Primeira tela concreta do front-end, cópia fiel do WBP_BootScreen gerado
pelo Zeus UMG Forge, adaptada aos componentes do projeto:

- UUIBootScreen_Base : UUIActivatableScreen_Base — observa o
  UZeusCharServerSubsystem; libera "Iniciar" no OnConnected; clique →
  UUIFrontEndFlowSubsystem::RequestEnterLogin → estado Login.
- UUISpinner_Base (componente compartilhado temável) + FUIStyleSpinner.
- FUIStyle.ScreenBackground (brush data-driven); fundo via DT_UI_Styles
  (T_Boot_Background em UI/Themes/Default/Boot), sem hard-ref no WBP (§5).
- ThemeKeys: Boot_Background/Logo/Music.
- Correção do Flow: pré-login agora conecta no UZeusCharServerSubsystem
  (WebSocket 7100), não mais no UDP do world server (que fica só p/
  EnteringWorld/InWorld); RequestEnterLogin() adicionado.
- WBP_Boot duplicado fiel + reparent UUIBootScreen_Base; swap manual no
  Designer (Btn_Start/Spinner_Connect/Text_Status); slots de layout
  (Container_Root/Stage/Content) ajustados p/ preencher/centralizar.
- WBP_PrimaryGameLayout: Stack_Modal corrigido p/ Fill/Fill.
- DA_FrontEndScreenSet: StateScreens[Boot] = WBP_Boot.
- ARQUITETURA.md (§2.1/§2.2/§4.8 + nota CharServer).

Validado em PIE: tela centralizada, fundo, conexão ao ZeusCharServer e
liberação do botão. Crash do plugin tratado em commit separado do server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
UUIBootScreen_Base::SetReady: Btn_Start agora alterna visibilidade —
Collapsed (sem ocupar layout) enquanto conecta ao ZeusCharServer; ao
conectar fica Visible + interagível. Antes ficava só desabilitado.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- UI_Input_Master refatorado: SizeBox -> Overlay -> Background/Stroke (UImage)
  + EditableTextBox. Cor magenta default eliminada — UImages atrás
  pintam o visual via DT_UI_Styles.
- UI_Label_Master novo: wrapper "label + input" com 2 slots de UI_Input_Master
  (Stacked/Inline). Reaproveita o input puro como composição reutilizável.
- UILabel_Base/UIInput_Base (C++): hierarquia limpa, propagação de Variant/
  HintText/FontSize/PreferredWidth/Height/bIsPassword pai->filho com
  passthrough em 0/vazio (override só quando setado).
- FUIStyleInput*: campos avulsos (BackgroundColor/Texture/DrawAs/Margin)
  trocados por FSlateBrush completo — DT expõe agora Image, ImageSize,
  Matiz, Desenhar como, Ladrilhos, Margin, UV no Designer.
- 11 texturas Hyper copiadas (T_Bar_Gradient_Background_Long + 10 borders)
  e referenciadas em DT_UI_Styles row Default (Backgrounds + Strokes das 4
  variantes Box/Outline/Underline/Search).
- ZMMOThemeSubsystem.Initialize: força chamada de ResolveActiveUIStyle
  mesmo quando ActiveTheme não muda — evita ActiveUIStyle ficar vazio
  quando DefaultThemeAsset é nullptr (sintoma: Brushes não renderizavam
  em PIE/runtime).
- "Lembrar Acesso": UZMMOLoginSaveGame nova (USaveGame com SavedUsername
  + bRememberAccess), load assíncrono em NativeOnActivated, save/delete
  em HandleLoginClicked. Slot "LoginCache" em Saved/SaveGames/. Padrão
  alinhado com jogos comerciais — nunca persiste senha (CWE-256);
  refresh token + DPAPI virão quando auth real entrar.
- WBP_Login: Input_User/Password agora são UI_Label_Master_C; checkbox
  Lembrar bindada por nome (RememberAccess -> UUICheckBox_Base*).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
UILoginScreen_Base agora envia uint8(PASSWORD) + string(user) +
string(pass) no C_CHAR_AUTH_REQUEST (em vez de string(token dev:N)).
Servidor valida via AccountService.login (Argon2id + lockout) — contas
são criadas com 'npm run account' no ZeusCharServer.

CharServerOpcodes.h espelha do servidor:
- ZMMOCharAuthMethod::{TOKEN=0, PASSWORD=1}
- ZMMOCharRejectReason::{InvalidToken, AccountBanned, AlreadyOnline,
  InvalidCredentials=4, AccountLocked=5, AccountSuspended=6,
  CredentialsAuthDisabled=7}

S_CHAR_AUTH_REJECT mapeia por switch:
- 4 → InvalidCredentialsText  (Usuário ou senha inválidos.)
- 5 → AccountLockedText       (Conta bloqueada por excesso de tentativas.)
- 6 → AccountSuspendedText    (Conta suspensa.)
- 7 → CredentialsDisabledText (Auth indisponível no servidor.)
- outros → RejectedText + código

MakeDevToken removido (StubTokenValidator continua aceitando dev:N
no servidor para testes diretos via outro cliente).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ServerSelect (Fase 1):
- UIServerSelectScreen_Base: subscribe OnRawMessage + C_WORLD_LIST_REQUEST
- WBP_ServerCard instanciado dinamicamente em GridPanel CardContainer (2 cols)
- UIServerCard_Base: SetFromEntry + OnCardPressed delegate + UI_Button_Master
- Push real-time S_WORLD_STATUS_UPDATE (opcode 2062) atualiza card in-place
- FZMMOWorldEntry struct, EZMMOWorldState enum no wire (offline/online/maint)
- Sem hardcap de slots — cards usam toda largura via ColumnFill weights

Lobby/CharSelect (Fase 1.5):
- UIUserLobbyScreen_Base + WBP_UserLobby (WidgetSwitcher: lista + create)
- C_CHAR_LIST_REQUEST filtrado por SelectedWorldId do FlowSubsystem
- UICharCard_Base + WBP_CharCard com Select/Delete + Accept/Cancel quando
  delete agendado; Text_DeleteCountdown atualiza em tempo real (timer 1s)
- UICharacterCreatePage_Base + WBP_CharacterCreate (Name + ComboBox class)
- Handlers S_CHAR_SELECT_OK (handoff parse), CHAR_CREATE_OK/REJECT,
  CHAR_DELETE_ACK/ACCEPT_ACK/CANCEL_ACK (refresh lista)

Auxiliares + fixes:
- ARQUITETURA_SERVER_SELECT.md + ARQUITETURA_CHARACTER_MODEL.md
- UIFrontEndFlowSubsystem: SelectedWorldId state + transicao Lobby
- DA_FrontEndScreenSet: Lobby -> WBP_UserLobby_C
- UICheckBox_Base + UICommonText_Base (componentes auxiliares)
- BSB_Button_Transparent.Disabled DrawAs=IMAGE -> NoDraw (fix bg branco)
- WBP_ServerCard layout: HBox para chips Region/Ping/Status, SizeBox 10x10
  no Dot verde (anti-overflow); SelfHitTestInvisible em containers (hover)
Lobby:
- HandleCharSelectOk invoca UZeusNetworkSubsystem->ConnectToZeusServerWithTicket
  (host, port, token) recebido do CharServer no S_CHAR_SELECT_OK.

Server travel:
- HandleServerTravelRequested força ZMMOGameMode via URL option
  (`?game=/Script/ZMMO.ZMMOGameMode`) no OpenLevel, independente do
  GameModeOverride do .umap. Evita herdar ZMMOFrontEndGameMode em mapas
  copiados/baseados em L_FrontEnd.

PlayerController:
- ZMMOPlayerController::BeginPlay força FInputModeGameOnly + cursor off +
  FlushPressedKeys ao tomar posse. Necessário pq UIManagerSubsystem é
  LocalPlayerSubsystem (sobrevive ao travel) e o controller anterior
  (AZMMOFrontEndPlayerController) tinha setado FInputModeUIOnly — sem este
  reset, WASD/Look não chegavam ao pawn no novo mundo.

Assets:
- TestWorld: PlayerStart adicionado, World Settings com GameModeOverride=
  ZMMOGameMode + Default Pawn=ZMMOPlayerCharacter + Controller=
  ZMMOPlayerController.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ZMMOWorldSubsystem:
- Bind dos delegates + replay do cache de proxies remotos movidos
  de Initialize pra OnWorldBeginPlay. Initialize roda muito cedo no
  pipeline de LoadMap (antes do GameMode ser instanciado e do
  WorldPartition terminar de carregar cells) — atores dinamicos
  spawnados ali eram perdidos durante o setup posterior do mundo.
- Replay agora acontece quando o World REALMENTE comeca (GameMode
  ativo, cells inicializadas) — proxies remotos persistem.

WireHelpers.h (novo):
- Helpers de leitura/escrita binarios LE/UTF-8 (ReadU8/U16/U32/U64/
  Float/StringUtf8/Uuid16 + Write*) como inline em namespace
  ZMMOWire. Substitui anonymous namespaces duplicados que existiam
  em 3 telas do FrontEnd. UBT Adaptive Build agrupava os .cpp em
  unity files diferentes; quando reorganizava as unities, dois
  arquivos caiam na mesma TU e os anonymous namespaces colidiam
  (ODR violation — "funcao ja tem corpo").
- inline em header tem semantica de "uma definicao por programa",
  resolvendo a colisao independente de como o UBT organize unities.

UIServerSelectScreen_Base, UIUserLobbyScreen_Base, UICharacterCreatePage_Base:
- Removidas as definicoes duplicadas, agora usam ZMMOWire::* via
  using-declarations.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Cliente UE (foco da frente):
- FZMMOMapDef + FZMMOMapSpawn (Source/ZMMO/Data/World/MapDef.h) — row do
  DT_Maps com MapId/DisplayName/ClientLevel/Spawns[] taggeados
- DT_Maps.uasset (Content/ZMMO/Data/World/) — 1 row "TestWorld" mapId=1
  apontando pra L_TestWorld + spawn "default" em (0,0,200)
- L_TestWorld movido: /Game/ThirdPerson/TestWorld -> /Game/ZMMO/Maps/World/L_TestWorld
  (75 ext actors WP duplicados, original deletado)
- ZMMOCharSummary.MapName (FString) -> MapId (int32)
- UIUserLobbyScreen_Base parseia uint16 mapId no S_CHAR_SELECT_OK + chama
  Flow->TravelToMapById(mapId) + Flow->SetPendingSpawnPose(pos, yaw)
- UIFrontEndFlowSubsystem: MapsTableAsset (config), FindMapDef,
  ResolveLevelPathByMapId, TravelToMapById, SetPendingSpawnPose/Consume
- AZMMOPlayerCharacter::BeginPlay: consome PendingSpawnPose do Flow e
  SetActorLocationAndRotation no pawn local (substitui PlayerStart default)
- DefaultGame.ini: MapsTableAsset=/Game/ZMMO/Data/World/DT_Maps.DT_Maps
- .gitignore: + .vscode/

Outras mudancas no working tree (paralelas a esta frente):
- Content/AutoCreated/MMOWidget/Widgets/WBP_* (boot/login/charselect/etc.)
- Content/AutoCreated/MMOWidget/Fonts/Font_* + font_*_Face
- Refatoracao de fontes ZMMO/UI/Fonts (FF_* deletadas, F_* + Face)
- Content/__ExternalActors__/ZMMO/Debug/Maps/L_Test_UI/* (75 actors)
- Content/Editor/ZeusUMGForge/FontMap.uasset
- Content/ZMMO/UI/Shared/UI_CheckBox_Master.uasset
- Content/ExternalContent/{Fab,Marketplace,Megascans}/.gitkeep
- Content/ThirdPerson/Menu.umap
Mateuus merged commit 0e96956a17 into main 2026-05-23 02:16:28 -03:00
Mateuus deleted branch feat/frontend-mainmenu-skeleton 2026-05-23 02:16:29 -03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mateuus/ZMMO#2