feat: add documentation, code comments, and update Docker config

Rewrite README with usage guide, deployment instructions, and protocol
docs. Update CLAUDE.md to reflect gomoku-only architecture. Add English
doc comments to all key server Go files, replacing Chinese comments.

Create docs/system-architecture.md (state machine, protocol, database
schema) and docs/deployment-guide.md (local dev, Docker, production
nginx, resource requirements).

Update Dockerfile to Go 1.22 with repo-root build context to include
web client. Update docker-compose to match.
This commit is contained in:
tiennm99 committed 2026-04-09 23:35:46 +07:00
1 parent cdcc3e0623
commit 5ccd4e7ce2
15 files changed
+652 -164

No files matched your search

+4 -2
View File
@@ -17,8 +17,9 @@ type Network interface {
Serve() error
}
// handle processes a new connection: wraps it, authenticates within 3 seconds,
// creates a Player, starts the state machine goroutine, and blocks on Listening.
func handle(rwc protocol.ReadWriteCloser) error {
// 给新进入的用户分配资源
c := network.Wrapper(rwc)
defer func() {
err := c.Close()
@@ -39,7 +40,8 @@ func handle(rwc protocol.ReadWriteCloser) error {
return player.Listening()
}
// 登陆验签
// loginAuth reads an AuthInfo JSON packet from the connection within 3 seconds.
// If the client doesn't authenticate in time, it returns ErrorsAuthFail.
func loginAuth(c *network.Conn) (*model.AuthInfo, error) {
authChan := make(chan *model.AuthInfo)
defer close(authChan)