Commit graph

2636 commits

Author SHA1 Message Date
Kelsi
66f78bb192 Add /logout chat command 2026-02-05 15:59:06 -08:00
Kelsi
117bbad9ff Add GPU occlusion query culling for WMO groups
Renders bounding boxes in depth-only pre-pass and queries GPU for
visibility. Groups fully occluded in previous frame are skipped.
Significantly improves performance in dense areas like Stormwind.
2026-02-05 15:51:08 -08:00
Kelsi
400e8652d4 Use absolute tavern music path fallback 2026-02-05 15:49:53 -08:00
Kelsi
071c8ead3b Retry login music playback when not playing 2026-02-05 15:47:21 -08:00
Kelsi
205db7d3b6 Play tavern music file on login screen 2026-02-05 15:44:42 -08:00
Kelsi
8c3aa6542e Play looping MP4 behind auth screen 2026-02-05 15:34:29 -08:00
Kelsi
77a21609a8 Add WMO portal culling infrastructure and fix single-player character flow
Portal-based visibility culling for WMO rendering (disabled by default,
needs debugging for complex WMOs like Stormwind). Skip character creation
screen when characters already exist in single-player mode.
2026-02-05 15:31:00 -08:00
Kelsi
669d89c108 Store password hash instead of plaintext for login persistence
Save SHA1(UPPER(user):UPPER(pass)) hash to login.cfg instead of the
plaintext password. On subsequent logins, use the stored hash directly
with a new authenticateWithHash() method that bypasses password hashing.
The password field shows a placeholder when using a stored hash.
2026-02-05 15:09:16 -08:00
Kelsi
de8c195eaf Fix CharSections.dbc lookup for skin color variations
For Section 0 (body skin) and Section 4 (underwear), the skin color is
stored in colorIndex with variation=0, not the other way around. This
fixes the preview showing no texture for skin colors other than 0.
2026-02-05 15:07:31 -08:00
Kelsi
140a2e2c22 Fix single-player spawn coords and show action bar spell names 2026-02-05 15:07:13 -08:00
Kelsi
6d22f4249f Add 3D character model preview to character creation screen
Render an animated M2 character model in the creation screen using a
dedicated CharacterRenderer with an offscreen FBO. Preview updates on
race/gender/appearance changes, supports mouse-drag rotation, and
composites skin, face, hair scalp, and underwear textures from
CharSections.dbc. Extracts getPlayerModelPath() to a shared free
function in game/character.
2026-02-05 14:58:45 -08:00
Kelsi
0ff34364b6 Add sqlite single-player persistence with autosave 2026-02-05 14:55:42 -08:00
Kelsi
7d2edc288d Apply start actions and remove-items rules 2026-02-05 14:38:58 -08:00
Kelsi
c89fccdfeb Use created character data and DB start items/spells 2026-02-05 14:35:12 -08:00
Kelsi
2db690a866 Fix crash in character creation by deferring callback to next update
The charCreateCallback was firing synchronously during ImGui render,
causing a state transition before the create screen's ImGui::End() was
called. Defer the callback to GameHandler::update() and ensure update()
runs during CHARACTER_CREATION and CHARACTER_SELECTION states.
2026-02-05 14:18:41 -08:00
Kelsi
26cd0bc57d Remove hardcoded NPC spawns CSV and fallback, require DB for spawns 2026-02-05 14:14:13 -08:00
Kelsi
0605d1522d Add character creation screen with race/class/appearance customization
Implements a full character creation UI integrated into the existing flow.
In single-player mode, auth screen now goes to character creation before
entering the world. In online mode, a "Create Character" button on the
character selection screen sends CMSG_CHAR_CREATE to the server. Includes
WoW 3.3.5a race/class combo validation and appearance range limits.
2026-02-05 14:13:48 -08:00
Kelsi
129bbac9b3 Add single-player MOTD default 2026-02-05 14:09:03 -08:00
Kelsi
e6e3093467 Emulate server loot/xp and combat feedback in single-player 2026-02-05 14:01:26 -08:00
Kelsi
1383e6c159 Fix realm list by updating auth handler during REALM_SELECTION state 2026-02-05 13:59:33 -08:00
Kelsi
eda70e9c6f Fix FourCC encoding and protocol version in LOGON_CHALLENGE
Game name uses big-endian (not reversed), platform/os/locale use
little-endian with chars reversed and null at end (not beginning).
Protocol version is 8 for WoW 3.3.5a, not 3.
2026-02-05 13:47:54 -08:00
Kelsi
61147a08af Fix LOGON_CHALLENGE security flags buffer corruption and improve auth diagnostics
Account for PIN/matrix/authenticator extra data in packet size
calculation to prevent receive buffer corruption. Add hex dump
of raw auth packets and show actual server error codes.
2026-02-05 13:26:24 -08:00
Kelsi
738dafb65b Add system chat for key game events 2026-02-05 13:22:15 -08:00
Kelsi
933b50eab5 Use natural BigNum sizes for SRP hash computations
TrinityCore/AzerothCore's UpdateBigNumbers uses BN_num_bytes (natural
size without padding) when hashing values for u and M1. Our code was
using fixed 32-byte padding which produces different hashes when any
value (salt, A, B, N) has leading zeros in big-endian representation.
2026-02-05 12:59:48 -08:00
Kelsi
45fc9996e2 Handle variable LOGON_PROOF failure response sizes
Some servers send 2 bytes for failure, others send 4. Consume up to 4
if available, otherwise accept the 2-byte minimum.
2026-02-05 12:50:05 -08:00
Kelsi
430a213063 Fix SRP authentication producing wrong proofs
Two bugs that caused the server to always reject our login proof:
- N was hashed as 256 bytes (2048 bits) instead of 32 bytes (256 bits),
  producing completely wrong H(N)^H(g) and therefore wrong M1
- Session key computation B-k*g^x could go negative; OpenSSL's
  BN_mod_exp doesn't handle negative bases. Add k*N before subtracting
  (standard TrinityCore approach) to keep the value positive
2026-02-05 12:46:53 -08:00
Kelsi
5ef11fdc7d Fix auth protocol to match real WoW 3.3.5a client format
Three critical bugs fixed:
- LOGON_CHALLENGE request: set protocol byte to 0x03 (was 0x00) and
  reverse FourCC strings (game/platform/os/locale) to match real client
- Response parsers: remove double-read of opcode byte that shifted all
  field reads by one, preventing successful auth with real servers
- LOGON_PROOF response sizes: success=32 bytes, failure=4 bytes to match
  TrinityCore/AzerothCore format

Also adds missing auth result codes (0x13-0x20, 0xFF) including
IGR_WITHOUT_BNET (0x17) which Warmane was returning.
2026-02-05 12:39:34 -08:00
Kelsi
1b414d24d8 Show hex error code for unrecognized auth server responses 2026-02-05 12:28:43 -08:00
Kelsi
bc9c7f09b1 Fix non-blocking TCP connect for remote servers and persist login info between sessions 2026-02-05 12:25:00 -08:00
Kelsi
a52e28191e Improve auth error feedback with specific failure reasons, version mismatch details, and connection timeout 2026-02-05 12:17:09 -08:00
Kelsi
78442f8aea Add XP tracking with level-up, kill XP formula, and server-compatible SMSG_LOG_XPGAIN support 2026-02-05 12:07:58 -08:00
Kelsi
ed5d10ec01 Add single-player local combat system with auto-attack, NPC aggro, and death 2026-02-05 12:01:03 -08:00
Kelsi
b16578e2b9 Fix single-player NPC loading outside Goldshire 2026-02-04 23:37:30 -08:00
Kelsi
28a8e806e1 Fix WMO spawn presets to avoid terrain snapping 2026-02-04 23:30:03 -08:00
Kelsi
ae37e5592e Load single-player NPC spawns from local AzerothCore SQL assets 2026-02-04 23:18:50 -08:00
Kelsi
5f519e77e3 Disable local test NPC spawning 2026-02-04 22:29:47 -08:00
Kelsi
affcfcfce1 Add interactive world map with continent/zone navigation 2026-02-04 22:27:45 -08:00
Kelsi
47945451be Rewrite minimap to use pre-baked BLP tile textures from MPQ archives
Replace the 3D top-down rendered minimap with WoW's native pre-rendered
BLP tile textures loaded via md5translate.trs. Tiles are composited into
a 3x3 grid FBO with proper axis transposition matching the ADT terrain
convention. The screen shader provides camera-rotation, circular mask,
directional player arrow, and 20% transparency. Minimap is now on by
default with the N toggle key removed.
2026-02-04 20:06:27 -08:00
Kelsi
d8e2becbaa Add teleporter panel and server-compatible coordinate conversions
Teleporter panel (T key) lets the player teleport between Goldshire,
Stormwind Gate, Ironforge, and Westfall in single-player mode. Adds
serverToCanonical/canonicalToServer conversion at the network packet
boundary so positions are compatible with TrinityCore/MaNGOS/AzerothCore
emulator servers.
2026-02-04 18:27:52 -08:00
Kelsi
6690910712 Unify coordinate systems with canonical WoW world coordinates
Centralizes all coordinate conversions in core/coordinates.hpp with
proper canonical WoW coords (+X=North, +Y=West, +Z=Up). Fixes critical
tile calculation bug that was loading wrong surrounding tiles during
terrain streaming, and fixes position sync sending ADT-raw format
instead of canonical coordinates to the server.
2026-02-04 17:37:28 -08:00
Kelsi
ee9efa3478 Stabilize player shadows and improve foot contact 2026-02-04 16:41:40 -08:00
Kelsi
54eac50c4d Add player character shadow casting in shadow pass 2026-02-04 16:36:03 -08:00
Kelsi
3d63c32b7f Reduce foliage and bush pop-in distance artifacts 2026-02-04 16:32:48 -08:00
Kelsi
ab4cb878ea Improve shadow stability and reduce foliage pop-in 2026-02-04 16:30:24 -08:00
Kelsi
979c0b5592 Stabilize shadows and soften foliage shadow casting 2026-02-04 16:22:18 -08:00
Kelsi
f17b15395d Implement shadow mapping pipeline for terrain and models 2026-02-04 16:08:35 -08:00
Kelsi
dede5a99d4 Fix shutdown order for terrain streaming threads 2026-02-04 16:07:28 -08:00
Kelsi
1c718dce22 Remove terrain specular and fix washed-out tonemap
Drop specular lighting from terrain shader — ground materials (dirt, grass,
stone) are purely diffuse and specular highlights made them look plastic.
Replace Reinhard tonemapper with a shoulder-only compressor that is identity
below 0.9 and softly rolls off HDR values above, preserving scene contrast.
2026-02-04 15:33:00 -08:00
Kelsi
09e1ee0ae2 Enable HDR lighting with Reinhard tonemapping across all world shaders
Replace hardcoded specular multipliers with uLightColor * uSpecularIntensity
uniforms in all 4 world shaders (terrain, WMO, M2, character), set HDR sun
color (1.5, 1.4, 1.3) and specular intensity 0.5 so highlights can exceed
1.0, and switch the post-process pass from passthrough to exposure-compensated
Reinhard (exposure=1.8) for soft highlight roll-off without clipping.
2026-02-04 15:28:47 -08:00
Kelsi
1f672e1d73 Add HDR post-process FBO pipeline with 4x MSAA
Render the world into an off-screen MSAA RGBA16F framebuffer, resolve
to a regular texture, then blit to screen via a fullscreen quad shader.
This sets up the infrastructure for future HDR tonemapping and SSAO
(depth texture preserved for sampling). Currently a passthrough until
HDR light sources are added. Login screen bypasses the FBO and renders
directly to the default framebuffer.
2026-02-04 15:21:04 -08:00