加入网络层

This commit is contained in:
2025-06-26 23:57:54 +08:00
parent 53106465ed
commit 0f29dccec4
57 changed files with 1859 additions and 1274 deletions

View File

@@ -0,0 +1,29 @@
package ws_gateway
import (
"common/net/socket"
"time"
)
type GatewayWsServer struct {
}
func (g *GatewayWsServer) OnOpen(_ socket.ISocketConn) ([]byte, socket.Action) {
return nil, socket.None
}
func (g *GatewayWsServer) OnHandShake(conn socket.ISocketConn) {
//query := conn.GetParam("query")
}
func (g *GatewayWsServer) OnMessage(conn socket.ISocketConn, bytes []byte) socket.Action {
return socket.None
}
func (g *GatewayWsServer) OnClose(conn socket.ISocketConn, _ error) socket.Action {
return socket.None
}
func (g *GatewayWsServer) OnTick() (time.Duration, socket.Action) {
return 5 * time.Second, socket.None
}