mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-24 06:27:09 +02:00
Implicit control gain (#108)
* add client side implicit hosting. * add server side implicit hosting. * update changelog. * allow clipboard & keybaord access.
This commit is contained in:
parent
f08ed0fc28
commit
7d1fa28d88
21 changed files with 125 additions and 38 deletions
|
@ -105,6 +105,7 @@ func (ws *WebSocketHandler) Start() {
|
|||
sess, ok := ws.handler.locked["control"]
|
||||
if ok && ws.conf.ControlProtection && sess == CONTROL_PROTECTION_SESSION && len(ws.sessions.Admins()) > 0 {
|
||||
delete(ws.handler.locked, "control")
|
||||
ws.sessions.SetControlLocked(false) // TODO: Handle locks in sessions as flags.
|
||||
ws.logger.Info().Msgf("control unlocked on behalf of control protection")
|
||||
|
||||
if err := ws.sessions.Broadcast(
|
||||
|
@ -140,6 +141,7 @@ func (ws *WebSocketHandler) Start() {
|
|||
_, ok := ws.handler.locked["control"]
|
||||
if !ok && ws.conf.ControlProtection && adminCount == 0 {
|
||||
ws.handler.locked["control"] = CONTROL_PROTECTION_SESSION
|
||||
ws.sessions.SetControlLocked(true) // TODO: Handle locks in sessions as flags.
|
||||
ws.logger.Info().Msgf("control locked and released on behalf of control protection")
|
||||
ws.handler.adminRelease(id, session)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue