Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
504836d165 | ||
|
|
e9962f1b74 |
@@ -9,6 +9,7 @@ import (
|
||||
service2 "github.com/ayflying/utility_go/service"
|
||||
"github.com/ayflying/utility_go/tools"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
@@ -63,8 +64,11 @@ func (s *sGameAct) Info(uid int64, actId int) (data *g.Var, err error) {
|
||||
Uid: uid,
|
||||
ActId: actId,
|
||||
}).Fields("action").OrderDesc("updated_at").Value()
|
||||
getDb.Scan(&data)
|
||||
|
||||
//getDb.Scan(&data)
|
||||
if getDb == nil || getDb.IsEmpty() {
|
||||
return
|
||||
}
|
||||
data = gvar.New(getDb)
|
||||
if data == nil || data.IsEmpty() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ type WebsocketData struct {
|
||||
Ws *websocket.Conn `json:"ws" dc:"websocket连接池"`
|
||||
Uuid string `json:"uuid" dc:"用户唯一标识"`
|
||||
Uid int64 `json:"uid" dc:"用户编号"`
|
||||
Guid string `json:"guid" dc:"用户凭证"`
|
||||
Groups []string `json:"groups" dc:"群组"`
|
||||
Ctx context.Context `json:"ctx" dc:""`
|
||||
RoomId string `json:"roomId" dc:"房间编号"`
|
||||
@@ -169,7 +170,7 @@ func (s *SocketV1) OnMessage(conn *WebsocketData, req []byte, msgType int) {
|
||||
}
|
||||
|
||||
//绑定用户编号
|
||||
func (s *SocketV1) BindUid(conn *WebsocketData, uid int64) {
|
||||
func (s *SocketV1) BindUid(conn *WebsocketData, uid int64, guid string) {
|
||||
lock.Lock()
|
||||
defer lock.Unlock()
|
||||
|
||||
@@ -179,6 +180,7 @@ func (s *SocketV1) BindUid(conn *WebsocketData, uid int64) {
|
||||
if conn.Uid == 0 {
|
||||
conn.Uid = uid
|
||||
}
|
||||
conn.Guid = guid
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user