let admin in if room locked

This commit is contained in:
Craig 2020-04-06 20:26:16 +00:00
parent 1e77a1afde
commit 14caa1fba8

View File

@ -34,8 +34,11 @@ func (h *MessageHandler) Connected(id string, socket *WebSocket) (bool, string,
} }
if h.locked { if h.locked {
h.logger.Debug().Msg("server locked") session, ok := h.sessions.Get(id)
return false, "Server is currently locked", nil if !ok || !session.Admin() {
h.logger.Debug().Msg("server locked")
return false, "Server is currently locked", nil
}
} }
return true, "", nil return true, "", nil