sshpong/internal/netwrk/game.go

36 lines
577 B
Go
Raw Normal View History

2024-08-14 17:26:51 -06:00
package netwrk
import (
"log"
"net"
)
func handleGameConnection(conn net.Conn) {
defer conn.Close()
messageBytes := make([]byte, 126)
n, err := conn.Read(messageBytes)
if err != nil {
log.Printf("Error reading game ID on connection", err)
}
2024-08-23 11:59:19 -06:00
_ = string(messageBytes[:n])
2024-08-14 17:26:51 -06:00
if err != nil {
log.Printf("Game id was not a string?", err)
}
2024-08-23 11:59:19 -06:00
_ = make(chan GameMessage)
2024-08-14 17:26:51 -06:00
n, err = conn.Read(messageBytes)
if err != nil {
log.Printf("Error reading message %v", err)
return
}
}
func handleGameMessage(conn net.Conn, message *GameMessage) error {
return nil
}