This repository has been archived on 2026-01-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Game/Server/Gateway/handler/ws_handler/temp.go
2025-06-28 17:38:22 +08:00

22 lines
335 B
Go

package ws_handler
import "encoding/json"
type msg struct {
Type string `json:"type"`
Data string `json:"data"`
}
func parseMsg(data []byte) (*msg, error) {
m := &msg{}
if err := json.Unmarshal(data, m); err != nil {
return nil, err
}
return m, nil
}
func wapMsg(m *msg) []byte {
data, _ := json.Marshal(m)
return data
}