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

View File

@@ -0,0 +1,4 @@
// Package pascalstring writes length-prefixed, null-terminated strings into a
// ByteFrame. The prefix width is selectable (uint8, uint16, or uint32) and
// strings are optionally encoded to Shift-JIS before writing.
package pascalstring

View File

@@ -6,6 +6,8 @@ import (
"golang.org/x/text/transform"
)
// Uint8 writes x as a null-terminated string with a uint8 length prefix. If t
// is true the string is first encoded to Shift-JIS.
func Uint8(bf *byteframe.ByteFrame, x string, t bool) {
if t {
e := japanese.ShiftJIS.NewEncoder()
@@ -20,6 +22,8 @@ func Uint8(bf *byteframe.ByteFrame, x string, t bool) {
bf.WriteNullTerminatedBytes([]byte(x))
}
// Uint16 writes x as a null-terminated string with a uint16 length prefix. If
// t is true the string is first encoded to Shift-JIS.
func Uint16(bf *byteframe.ByteFrame, x string, t bool) {
if t {
e := japanese.ShiftJIS.NewEncoder()
@@ -34,6 +38,8 @@ func Uint16(bf *byteframe.ByteFrame, x string, t bool) {
bf.WriteNullTerminatedBytes([]byte(x))
}
// Uint32 writes x as a null-terminated string with a uint32 length prefix. If
// t is true the string is first encoded to Shift-JIS.
func Uint32(bf *byteframe.ByteFrame, x string, t bool) {
if t {
e := japanese.ShiftJIS.NewEncoder()