set position in session.

This commit is contained in:
Miroslav Šedivý
2021-10-23 20:25:18 +02:00
parent 60f459392a
commit 318b833b30
4 changed files with 44 additions and 8 deletions

View File

@ -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
// ---