Commit Graph

325 Commits

Author SHA1 Message Date
Houmgaor
0f1684564d test: expand channelserver coverage from 7.5% to 12%
Add comprehensive tests for channelserver package:
- handlers_character_test.go: CharacterSaveData, pointer constants
- handlers_data_test.go: grpToGR function with boundary tests
- handlers_quest_test.go: findSubSliceIndices, equal functions
- handlers_simple_test.go: simple handlers, ack responses
- handlers_util_test.go: stub handlers, ack helpers
- sys_channel_server_test.go: Server, Raviente, stages, semaphores
- sys_object_test.go: Object, Stage, stageBinaryKey structs

All tests pass with race detection enabled.
2026-02-02 11:25:08 +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
db3e0bccc7 test: improve test coverage for mhfpacket, channelserver, and server packages
Add comprehensive tests for:
- Pure time functions in channelserver (sys_time_test.go)
- Stage-related packet parsing (msg_sys_stage_test.go)
- Acquire packet family parsing (msg_mhf_acquire_test.go)
- Extended mhfpacket tests for login, logout, and stage packets
- Entrance server makeHeader structure and checksum tests
- SignV2 server request/response JSON structure tests
2026-02-01 23:28:19 +01:00
Houmgaor
021705c006 fix(quest): add S6 compatibility for quest data backporting
Cherry-picked from 8d1c6a7 with conflict resolution.
2026-01-30 01:14:13 +01:00
Houmgaor
c4036daebc fix(guild): conditionally write GR field in InfoGuild for G10+ only
Cherry-picked from main (8c219be) with conflict resolution.
Pre-G10 clients don't have the GR field in the applicant list,
so only write it when RealClientMode >= G10.

Also optimizes two consecutive uint16(0) writes to single uint32(0).
2026-01-30 01:09:48 +01:00
Houmgaor
94175e6e85 fix(guild): fix nil pointer condition in GetGuildManageRight
Cherry-picked from main (5028355) with conflict resolution.
Changes condition from && to || to properly handle the case where
a player has a guild but also has a prevGuildID set.
2026-01-30 01:03:20 +01:00
Houmgaor
a66b15d6c8 fix(stage): add timeout to WaitStageBinary handler
Cherry-picked from main (c539905).
Prevents infinite loop when stage binary data never arrives by
limiting to 10 iterations (10 seconds) before returning empty response.
2026-01-30 01:02:43 +01:00
Houmgaor
355c2c01cc fix(guild): fix poogie outfit unlock calculation
Cherry-picked from main (7459ded) with conflict resolution.
The original fix changed the poogie outfit unlock from incorrect
math.Pow calculation to direct value assignment.

Also removes unused math import (531b3d2).
2026-01-30 01:02:18 +01:00
Houmgaor
982393daf4 test: add unit tests for cherry-pick impacted handlers
Add comprehensive tests documenting current behavior before applying
fixes from main branch. Tests cover:

- Cafe item PointCost parsing (uint32 vs uint16 for different client modes)
- Guild poogie outfit unlock calculation bug (math.Pow issue)
- Guild manage right nil pointer condition (&& vs || logic)
- InfoGuild applicant GR field size for <G10 clients
- Stage binary wait infinite loop risk (no timeout)
- Entrance server hardcoded clan member limit
2026-01-30 01:01:21 +01:00
Houmgaor
3a1b410ee3 fix(guild): rename GuildMealDuration to ClanMealDuration to match upstream 9.3
- Renamed config key from GuildMealDuration to ClanMealDuration
- Changed unit from minutes to seconds (matching upstream convention)
- Updated handler to use seconds-based calculation
- Updated documentation and examples

This fixes the bug where clan meals were not being shared between
guild members when using a config.json with the upstream naming.
2026-01-30 00:32:00 +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
69cc84aa2f refactor(distribution): use distribution_items table instead of data blob
Distributions now read items from the distribution_items table instead of
requiring a pre-built binary data blob. This enables creating distributions
via simple SQL inserts rather than generating binary data manually.

Changes:
- Add getDistributionItems() to fetch items from distribution_items table
- Update handleMsgMhfApplyDistItem to build response from table data
- Move server-side rewards (points, RP) to handleMsgMhfAcquireDistItem
- Support G8+ item format (13 bytes per item)
2026-01-29 23:59:19 +01:00
Houmgaor
64cc285fd8 doc: inline code documentation. 2025-11-24 18:41:37 +01:00
Houmgaor
a992c5a603 refactor(format): automated formatting with go fmt. 2025-11-24 17:59:41 +01:00
Houmgaor
bfdfed0c71 fix(presets): players with more than 40 presets would crash on logging in. 2025-11-24 11:20:00 +01:00
Houmgaor
67dad15204 fix(server): race condition that created server panic. 2025-11-24 00:51:45 +01:00
Houmgaor
c8c0dae8fe test: imports basic tests, all passing. 2025-11-09 12:36:56 +01:00
wish
006f44f3a6 fix feature weapon RNG 2023-03-31 00:53:50 +11:00
wish
7d884da938 replace deprecated code 2023-03-31 00:04:51 +11:00
wish
a042cef5b1 fix possible infinite loop in gacha rolls 2023-03-30 23:32:10 +11:00
wish
8749674a63 replace deprecated rand call 2023-03-30 21:59:51 +11:00
wish
61d15ddd43 remove mail item workaround 2023-03-30 21:48:23 +11:00
wish
107eddfea5 stub interception map packets 2023-03-27 21:29:23 +11:00
wish
f85be55a6d fix login boost creating hanging connections 2023-03-14 02:16:09 +11:00
wish
c344fdd4c9 fix scout enumeration data 2023-03-12 23:43:30 +11:00
wish
a2a4989cda replace outdated code 2023-03-12 23:36:26 +11: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
cce558db9c amend comment 2023-03-12 22:28:27 +11:00
wish
40d5c67902 merge shop enumeration fixes from feature/diva 2023-03-12 22:05:42 +11:00
wish
9a42042686 improve course command responses 2023-03-12 01:59:21 +11:00
wish
baf53ea212 flip error check in course command and remove unused code 2023-03-11 23:40:49 +11:00
wish
c95d02ec82 fix edge case on 0 rights int 2023-03-11 23:34:43 +11:00
wish
bcb71536ec initial rights v4 concept 2023-03-11 23:17:14 +11:00
wish
29cf7add11 rework netcafe course activation 2023-03-11 16:26:16 +11:00
wish
c110082ab5 test session timeout 2023-03-11 01:08:21 +11:00
wish
ab4669acc9 unhide EnumerateQuest packet logs 2023-03-11 00:57:14 +11:00
wish
8df5697dd3 make raviente multiplier more accurate 2023-03-09 22:56:21 +11:00
wish
0caf610d33 rework logging code 2023-03-09 22:11:55 +11:00
wish
dcab41a6c7 rework logging code 2023-03-09 22:05:32 +11:00
wish
b6fcc1ca14 add option to change daily quest allowance 2023-03-09 20:31:39 +11:00
wish
29988f2bdd fix disable boost time 2023-03-09 19:33:50 +11:00
wish
986a0034c8 add various gameplay options 2023-03-09 19:23:31 +11:00
wish
a3b1b2841f move active features to gameplay options 2023-03-09 18:54:53 +11:00
wish
1f349a342e add some gameplay options 2023-03-09 18:51:36 +11:00
wish
ee4d2ab705 prevent rp logs being nil 2023-03-09 17:34:42 +11:00
wish
cd53f5f9db prevent applicants from receiving message board notifications 2023-03-09 17:34:05 +11:00
wish
d5dc15fc93 implement guild semaphore locking 2023-03-09 17:31:43 +11:00
wish
9a8edf0b64 fix feature weapons not generating correctly 2023-03-07 21:03:42 +11:00
wish
78f7f29247 Merge branch 'main' into fix/stage-concurrent-map 2023-03-05 22:31:03 +11:00