Commit Graph
4 Commits
Author SHA1 Message Date
adminandClaude Opus 4.8 d27ee16004 Bind online session browser to canvas, drop IMGUI
- OnlineSessionManager: remove OnGUI/IMGUI state; now a logic-only layer
  exposing Host/Refresh/Join/Disconnect plus Status/IsBusy/IsConnected/
  InSession/Sessions and Changed/SessionsChanged events
- OnlineSessionBrowserUI (new): drives the Servers canvas — 4 buttons,
  session list from Entry Template clones (name + players), row selection,
  state-driven interactability, status footer
- Main scene: attach binder, add status footer line, wire 8 refs; dev
  bootstrap panel disabled
- Online Session Manager.prefab (new)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 11:03:26 +02:00
adminandClaude Opus 4.8 f8b11be290 Add UGS Sessions online hosting with no port-forwarding
Players can now host and join over the internet without port-forwarding
via Unity Gaming Services Relay + Lobby, exposed through the unified
Multiplayer Services SDK (Sessions API).

- OnlineSessionManager: anonymous auth, CreateSessionAsync (public,
  relay-backed), QuerySessionsAsync server browser, JoinSessionByIdAsync,
  and session leave wired into the existing net-stop teardown.
- Per-install auth profile derived from the project path
  (mirror_<sha1(dataPath)>) so junction-mirror clones get distinct UGS
  player ids, avoiding the same-machine 409 LobbyConflict on join.
- Install com.unity.services.multiplayer 2.2.4 (pulls Relay/Lobby/
  Authentication/Core) and attach OnlineSessionManager to the
  NetworkManager in Main.

Loopback dev flow (NetworkBootstrap H/C/J/K) is left untouched; the
online path is additive. MatchManager and gameplay are unchanged since
Sessions starts the host/client through NGO as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 10:17:28 +02:00
adminandClaude Opus 4.8 91ce8ff329 Replace stripped-player spectator with a minimal dedicated prefab
Mid-match joiners now spawn a dedicated empty Spectator prefab (NetworkObject
+ SpectatorSetup only) instead of a fully stripped Player prefab. The FreeCam
rig is a standalone scene object in Main, so the spectator needs no avatar body,
renderer, collider, or CharacterController -- eliminating the leftover-body
artifact and the fragile per-peer strip path entirely.

- SpectatorSetup.cs (new): owner binds GameModeManager.BindSpectator (FreeCam-only)
- Spectator.prefab (new): empty avatar (Transform + NetworkObject + SpectatorSetup),
  registered in DefaultNetworkPrefabs, wired on MatchManager in Main
- GameModeManager: add BindSpectator/BuildSpectatorModes; drop the spectator
  branch from BindLocalPlayer; ReleaseToNoPlayer frees the cursor on teardown
- MatchManager: independent entropy-seeded RNG for fair hunter pick (was sharing
  the global engine RNG and always landing on the same client); spawn the
  spectator prefab for mid-match joiners; cursor-safe return-to-Main teardown
- FreeCamController: guard IgnorePlayerCollision against a disabled capsule

Also bundled (unrelated user asset/UI edits): PaintHudPanel layout tuning,
font atlas (arialroundedmtprocyr_bold SDF), forestpack_foliage material.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 00:31:49 +02:00
adminandClaude Opus 4.8 bd70f3b8b9 Add lobby/match-start matchmaking flow with additive scene management
Replace the connection-approval role selection with a server-authoritative
match flow built on NGO additive scene management:

- Scenes: Main is the persistent foundation (NetworkManager, GameModeManager,
  cameras, HUD); Lobby and Test Map load/unload additively. Add Lobby + Test Map
  to the build settings; remove the obsolete SampleScene.
- MatchManager (plain MonoBehaviour singleton): loads Lobby on server start,
  StartMatchTrigger lets the host start the match, rolls one random Hunter (rest
  Hider), swaps Lobby -> Test Map (strictly serialized per NGO), respawns each
  player as its role variant. Forces additive client sync mode so clients keep
  Main instead of single-loading it (fixes "Destination scene is not valid").
- Server-driven spawning: null out NetworkConfig.PlayerPrefab at runtime to
  disable auto-spawn, then spawn players after the lobby floor exists (fixes
  falling through the floor) with double-spawn and transition guards.
- StartMatchTrigger: server-gated OnTriggerEnter, only the host's own player
  starts the match.
- NetworkBootstrap: drop role selection / connection approval; everyone spawns
  as the neutral Player prefab. Host/Client/Server/Shutdown buttons stay.
- NetworkPlayerSetup.ScopedModes flag (baked on Hunter/Hider prefabs): lobby
  avatar gets the full mode set, match variants get the role-scoped set.
- GameModeManager.BindLocalPlayer reads ScopedModes and rebinds the painter
  unconditionally (fixes stale painter binding on respawn -> brush painting in
  every mode).
- MeshPainter.PaintingEnabled defaults to false (unbound/pre-spawn/remote never
  paints); PaintHud visibility now also gates on a bound painter (fixes the HUD
  showing at startup before any avatar exists).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 22:44:18 +02:00