mirror of
https://github.com/tiennm99/gomoku.git
synced 2026-10-03 07:13:00 +00:00
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:
1 parent
cdcc3e0623
commit
5ccd4e7ce2
15 files changed
+652
-164
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user