docs: add doc.go files and godoc comments to all packages

Add package-level documentation (doc.go) to all 22 first-party
packages and godoc comments to ~150 previously undocumented
exported symbols across common/, network/, and server/.
This commit is contained in:
Houmgaor
2026-02-18 21:39:13 +01:00
parent b9cb274ced
commit 2bd5f98f32
81 changed files with 342 additions and 0 deletions

4
network/binpacket/doc.go Normal file
View File

@@ -0,0 +1,4 @@
// Package binpacket defines higher-level binary message types that are carried
// inside MSG_SYS_CAST_BINARY / MSG_SYS_CASTED_BINARY packets. These include
// chat messages, mail notifications, and targeted player broadcasts.
package binpacket

View File

@@ -6,20 +6,24 @@ import (
"erupe-ce/network"
)
// MsgBinMailNotify is a binpacket broadcast to notify a player of new mail.
type MsgBinMailNotify struct {
SenderName string
}
// Parse parses the packet from binary.
func (m MsgBinMailNotify) Parse(bf *byteframe.ByteFrame) error {
panic("implement me")
}
// Build builds a binary packet from the current data.
func (m MsgBinMailNotify) Build(bf *byteframe.ByteFrame) error {
bf.WriteUint8(0x01) // Unk
bf.WriteBytes(stringsupport.PaddedString(m.SenderName, 21, true))
return nil
}
// Opcode returns the ID associated with this packet type.
func (m MsgBinMailNotify) Opcode() network.PacketID {
return network.MSG_SYS_CASTED_BINARY
}

3
network/clientctx/doc.go Normal file
View File

@@ -0,0 +1,3 @@
// Package clientctx provides per-connection context passed to packet
// Parse/Build methods, allowing version-dependent encoding decisions.
package clientctx

5
network/crypto/doc.go Normal file
View File

@@ -0,0 +1,5 @@
// Package crypto implements the symmetric substitution-cipher used by Monster
// Hunter Frontier to encrypt and decrypt TCP packet bodies. The algorithm uses
// a 256-byte S-box with a rolling derived key and produces three integrity
// checksums alongside the ciphertext.
package crypto

5
network/doc.go Normal file
View File

@@ -0,0 +1,5 @@
// Package network defines the encrypted TCP transport layer for MHF client
// connections. It provides Blowfish-based packet encryption/decryption via
// [CryptConn], packet header parsing, and the [PacketID] enumeration of all
// ~400 message types in the MHF protocol.
package network

4
network/mhfpacket/doc.go Normal file
View File

@@ -0,0 +1,4 @@
// Package mhfpacket defines the struct representations and binary
// serialization for every MHF network packet (~400 message types). Each
// packet implements the [MHFPacket] interface (Parse, Build, Opcode).
package mhfpacket

View File

@@ -7,6 +7,7 @@ import (
"erupe-ce/network/clientctx"
)
// EnumerateGuildType specifies the search/sort criteria for guild enumeration.
type EnumerateGuildType uint8
const (

View File

@@ -8,6 +8,7 @@ import (
"erupe-ce/network/clientctx"
)
// OperateGuildAction identifies the guild management action to perform.
type OperateGuildAction uint8
const (

View File

@@ -8,6 +8,7 @@ import (
"erupe-ce/network/clientctx"
)
// OperateGuildMemberAction identifies the guild member management action.
type OperateGuildMemberAction uint8
const (

View File

@@ -8,6 +8,7 @@ import (
"erupe-ce/network/clientctx"
)
// OperateJointAction identifies the alliance (joint) operation to perform.
type OperateJointAction uint8
const (

View File

@@ -8,6 +8,7 @@ import (
"erupe-ce/network/clientctx"
)
// OperateMailOperation identifies the mail operation to perform.
type OperateMailOperation uint8
const (

View File

@@ -8,6 +8,7 @@ import (
"erupe-ce/network/clientctx"
)
// CaAchievementHist is a single entry in the CA achievement history packet.
type CaAchievementHist struct {
Unk0 uint32
Unk1 uint8

View File

@@ -7,6 +7,7 @@ import (
"erupe-ce/network/clientctx"
)
// Goocoo represents a single Goocoo (guacot) companion entry in an update packet.
type Goocoo struct {
Index uint32
Data1 []int16

View File

@@ -8,6 +8,7 @@ import (
"erupe-ce/network/clientctx"
)
// GuildIconMsgPart represents one graphical part of a guild icon (emblem).
type GuildIconMsgPart struct {
Index uint16
ID uint16

View File

@@ -1,6 +1,8 @@
package network
//revive:disable
// PacketID identifies an MHF network message type.
type PacketID uint16
//go:generate stringer -type=PacketID