mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
set position in session.
This commit is contained in:
@ -16,6 +16,10 @@ type SessionCtx struct {
|
||||
profile types.MemberProfile
|
||||
state types.SessionState
|
||||
|
||||
positionX int
|
||||
positionY int
|
||||
positionMu sync.Mutex
|
||||
|
||||
websocketPeer types.WebSocketPeer
|
||||
websocketMu sync.Mutex
|
||||
|
||||
@ -53,6 +57,18 @@ func (session *SessionCtx) IsHost() bool {
|
||||
return session.manager.GetHost() == session
|
||||
}
|
||||
|
||||
// ---
|
||||
// cursor position
|
||||
// ---
|
||||
|
||||
func (session *SessionCtx) SetPosition(x, y int) {
|
||||
session.positionMu.Lock()
|
||||
defer session.positionMu.Unlock()
|
||||
|
||||
session.positionX = x
|
||||
session.positionY = y
|
||||
}
|
||||
|
||||
// ---
|
||||
// websocket
|
||||
// ---
|
||||
|
Reference in New Issue
Block a user