Merge branch 'websocketrefresh' of https://github.com/GulliblePsychologist/evennia into GulliblePsychologist-websocketrefresh

This commit is contained in:
Griatch 2020-01-21 20:39:13 +01:00
commit 87ba748998
3 changed files with 31 additions and 6 deletions

View file

@ -61,3 +61,10 @@ class SharedLoginMiddleware(object):
login(request, account)
except AttributeError:
logger.log_trace()
if csession.get("webclient_authenticated_uid", None):
# set a nonce to prevent the webclient from erasing the webclient_authenticated_uid value
csession["webclient_authenticated_nonce"] = csession.get("webclient_authenticated_nonce", 0) + 1
# wrap around to prevent integer overflows
if csession["webclient_authenticated_nonce"] > 32:
csession["webclient_authenticated_nonce"] = 0

View file

@ -284,7 +284,6 @@ $(document).ready(function() {
// Event when closing window (have to have Evennia initialized)
$(window).bind("beforeunload", plugin_handler.onBeforeUnload);
$(window).bind("unload", Evennia.connection.close);
// Event when any key is pressed
$(document).keydown(plugin_handler.onKeydown)