refactor: extract gametime package, replace fmt.Printf with zap logging

Move time utilities (TimeAdjusted, TimeMidnight, TimeWeekStart, TimeWeekNext,
TimeGameAbsolute) from channelserver into common/gametime to break the
inappropriate dependency where signserver, entranceserver, and api imported
the 38K-line channelserver package just for time functions.

Replace all fmt.Printf debug logging in sys_session.go and handlers_object.go
with structured zap logging for consistent observability.
This commit is contained in:
Houmgaor
2026-02-17 17:54:51 +01:00
parent fb3e86f429
commit d2b5bb72f8
14 changed files with 258 additions and 264 deletions

View File

@@ -2,8 +2,8 @@ package deltacomp
import (
"bytes"
"fmt"
"io"
"log"
)
func checkReadUint8(r *bytes.Reader) (uint8, error) {
@@ -77,7 +77,7 @@ func ApplyDataDiff(diff []byte, baseData []byte) []byte {
// Grow slice if it's required
if len(baseCopy) < dataOffset {
fmt.Printf("Slice smaller than data offset, growing slice...")
log.Printf("Slice smaller than data offset, growing slice...")
baseCopy = append(baseCopy, make([]byte, (dataOffset+differentCount)-len(baseData))...)
} else {
length := len(baseCopy[dataOffset:])