mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-19 03:57:06 +02:00
Inactive cursors - multiple positions.
This commit is contained in:
parent
8dbe0d1d2d
commit
097e8d2a87
4 changed files with 26 additions and 22 deletions
|
@ -21,7 +21,7 @@ import (
|
|||
const pingPeriod = 10 * time.Second
|
||||
|
||||
// period for sending inactive cursor messages
|
||||
const inactiveCursorsPeriod = 500 * time.Millisecond
|
||||
const inactiveCursorsPeriod = 750 * time.Millisecond
|
||||
|
||||
func New(
|
||||
sessions types.SessionManager,
|
||||
|
@ -326,19 +326,18 @@ func (manager *WebSocketManagerCtx) inactiveCursors() {
|
|||
}
|
||||
lastEmpty = currentEmpty
|
||||
|
||||
cursors := []message.SessionCursor{}
|
||||
for session, cursor := range cursorsMap {
|
||||
cursors = append(
|
||||
cursors,
|
||||
message.SessionCursor{
|
||||
ID: session.ID(),
|
||||
X: uint16(cursor.X),
|
||||
Y: uint16(cursor.Y),
|
||||
sessionCursors := []message.SessionCursors{}
|
||||
for session, cursors := range cursorsMap {
|
||||
sessionCursors = append(
|
||||
sessionCursors,
|
||||
message.SessionCursors{
|
||||
ID: session.ID(),
|
||||
Cursors: cursors,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
manager.sessions.InactiveCursorsBroadcast(event.SESSION_CURSORS, cursors, nil)
|
||||
manager.sessions.InactiveCursorsBroadcast(event.SESSION_CURSORS, sessionCursors, nil)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue