Commit Graph

5 Commits

Author SHA1 Message Date
Houmgaor
f2f31cdfbb test(channelserver): add comprehensive handler-level tests for handlers_house
Cover all 14 handler functions in handlers_house.go with 25 new tests:

- 7 unit tests for guard paths (payload size limits, box index
  bounds, no-op handlers) that run without a database
- 18 integration tests against real PostgreSQL covering interior
  updates, house state/password, house enumeration by char ID and
  name, house loading with access control, mission data CRUD,
  title acquisition with dedup, warehouse operations (box names,
  usage limits, rename guards), item storage round-trips, and
  deco myset defaults

Introduces readAck() helper to parse MsgSysAck wire format from
the sendPackets channel, and setupHouseTest() for DB + session
scaffolding with user_binary row initialization.
2026-02-20 23:46:04 +01:00
Houmgaor
5f3c843082 refactor(config): eliminate ErupeConfig global variable
Replace the mutable global `_config.ErupeConfig` with dependency
injection across 79 files. Config is now threaded through existing
paths: `ClientContext.RealClientMode` for packet encoding, `s.server.
erupeConfig` for channel handlers, and explicit parameters for utility
functions. This removes hidden coupling, enables test parallelism
without global save/restore, and prevents low-level packages from
reaching up to the config layer.

Key changes:
- Enrich ClientContext with RealClientMode for packet files
- Add mode parameter to CryptConn, mhfitem, mhfcourse functions
- Convert handlers_commands init() to lazy sync.Once initialization
- Delete global var, init(), and helper functions from config.go
- Update all tests to pass config explicitly
2026-02-20 17:07:42 +01:00
Houmgaor
4908731773 fix(ci): remove linting, fix not passing test. 2025-10-19 23:39:23 +02:00
Houmgaor
c55f23442b fix(lint): fixing go static check failing. 2025-10-19 22:52:58 +02:00
Houmgaor
8a92a7957e fix(crashes): trying to investigate the causes of crash.
New unit tests to that end.
2025-10-19 19:02:29 +02:00