Commit Graph

34 Commits

Author SHA1 Message Date
Houmgaor
fce01251e3 test(signserver): remove obsolete dsgn_resp_test.go 2026-02-06 13:02:44 +01:00
Houmgaor
9c5cc559c7 test(signserver): increase test coverage from 1.5% to 45.2%
Add comprehensive tests for signserver package using sqlmock for
database function testing:

- Server lifecycle tests (Start, Shutdown, acceptClients)
- Connection handling tests (handleConnection, multiple connections)
- Database function tests (getCharactersForUser, getLastCID,
  getUserRights, checkToken, registerToken, deleteCharacter,
  newUserChara, registerDBAccount, getReturnExpiry,
  getFriendsForCharacters, getGuildmatesForCharacters)
- Session struct and packet handling tests

All tests pass with race detection enabled.
2026-02-03 00:19:48 +01:00
Houmgaor
f138cb5f77 fix: replace panic calls with proper error handling
Remove 51 panic() calls from handler code and replace with:
- Proper error logging using zap
- Appropriate client error responses (doAckBufFail, doAckSimpleFail)
- Graceful error recovery instead of server crashes

Files updated:
- handlers_guild_scout.go (9 panics)
- handlers_guild_tresure.go (10 panics)
- handlers_guild.go (7 panics + dead code removal)
- handlers_mail.go (5 panics)
- handlers.go (9 panics)
- handlers_tower.go (2 panics)
- handlers_clients.go (3 panics)
- handlers_guild_alliance.go (1 panic)
- handlers_quest.go (1 panic)
- handlers_rengoku.go (1 panic)
- handlers_stage.go (1 panic)
- handlers_data.go (1 panic)
- handlers_cafe.go (1 panic)
- signserver/sign_server.go (1 panic)

Remaining panics (3) are in test files and compression library
where panicking on programming errors is appropriate.
2026-02-02 17:14:34 +01:00
Houmgaor
dbc3b21827 test: increase test coverage across multiple packages
Add comprehensive tests for:
- network: CryptConn encryption connection tests
- signserver: character and member struct validation
- entranceserver: encryption roundtrip, server config tests
- channelserver: stage creation, object IDs, quest membership

All tests pass with race detector enabled.
2026-02-02 16:48:57 +01:00
wish
813cf169c9 mitigate LoadDecoMyset crashing on older versions 2026-02-02 16:29:42 +01:00
Houmgaor
42018621c3 fix: array bound crashes on clans. 2026-02-02 16:27:49 +01:00
Houmgaor
dad6a23bba test: improve test coverage from 11% to 20%
Add comprehensive tests across multiple packages:

- mhfpacket: Add tests for 300+ packet opcodes, system packets,
  MHF packets, and detailed parsing tests (6.4% -> 38.8%)
- timeserver: Add tests for all time functions (0% -> 97.4%)
- deltacomp: Add edge case tests for compression functions
- entranceserver: Add server creation tests
- binpacket: Add mail notify panic test
- config: Add Mode.String() tests
- signserver: Expand server tests
2026-02-02 11:02:52 +01:00
Houmgaor
e929346bf3 test: add unit tests for core packages
Add comprehensive test coverage for:
- common/token: token generation and RNG tests
- common/stringsupport: string encoding, CSV operations
- common/byteframe: binary read/write operations
- common/mhfcourse: course/subscription logic
- network/crypt_packet: packet header parsing
- network/binpacket: binary packet round-trips
- network/mhfpacket: packet interface and opcode mapping
- config: configuration struct and loading
- server/entranceserver: response building
- server/signserver: response ID constants
- server/signv2server: HTTP endpoint validation
- server/channelserver: session, semaphore, and handler tests

All tests pass with race detector enabled.
2026-01-30 00:19:27 +01:00
Houmgaor
64cc285fd8 doc: inline code documentation. 2025-11-24 18:41:37 +01:00
wish
6aa075009e timestamp fixes 2023-03-12 23:31:39 +11:00
wish
ccfd2ac36f create RNG in token module 2023-03-12 23:29:50 +11:00
wish
bcb71536ec initial rights v4 concept 2023-03-11 23:17:14 +11:00
wish
dcab41a6c7 rework logging code 2023-03-09 22:05:32 +11:00
wish
644a76cb9a add support for multiple login notices 2023-03-09 20:12:59 +11:00
wish
4cfba97701 fix return expiry 2023-03-04 22:56:13 +11:00
wish
42ab117c7f fix mezfes data saving 2023-02-28 23:15:21 +11:00
wish
747f21c4db workaround for localhost connections 2023-02-25 16:12:51 +11:00
wish
6605c6f28a rearrange config options 2022-11-07 00:30:24 +11:00
wish
d3e9d6971f rearrange config options 2022-11-07 00:28:43 +11:00
wish
181ea56837 convert token to library 2022-11-07 00:22:16 +11:00
wish
e943b54df4 add patch server option 2022-10-27 13:11:56 +11:00
wish
55f1de11fe add account creation toggle 2022-10-24 17:48:57 +11:00
wish
5e42402a3d signserver cleanup 2022-10-18 11:42:12 +11:00
wish
6ee9234745 fix various savedata bugs 2022-10-08 13:59:48 +11:00
wish
ca9f2de457 fix return not expiring 2022-09-30 17:59:56 +10:00
wish
580bfb12fe decode dsgn 2022-09-08 15:15:23 +10:00
wish
dd1460b74b implement return course 2022-08-26 21:02:31 +10:00
wish
2c51ddc518 fix launcher character enumeration 2022-08-25 20:53:28 +10:00
wish
56841a5ab3 add config option to toggle MF MP game 2022-08-05 07:42:45 +10:00
wish
820563dc4c matchmaking support 2022-08-05 07:39:37 +10:00
wish
e9cc5cc3e2 parse host as FQDN or IP 2022-08-04 23:52:13 +10:00
wish
556198af72 softfail on paddedstring and login cleanup 2022-08-04 21:01:32 +10:00
wish
5e54a2052d add customisation for login notice 2022-08-02 19:06:00 +10:00
wish
2c0e7a5267 repository cleanup 2022-07-29 03:25:23 +10:00