peer input protocol fix, resetting info and p2p expire times on new peer select

This commit is contained in:
mrfry 2023-05-06 19:32:56 +02:00
parent 28a2ffdaca
commit 0e6ccc4595

View file

@ -46,7 +46,7 @@
// : Script header {{{ // : Script header {{{
// ==UserScript== // ==UserScript==
// @name Moodle/Elearning/KMOOC test help // @name Moodle/Elearning/KMOOC test help
// @version 2.1.5.0 // @version 2.1.5.1
// @description Online Moodle/Elearning/KMOOC test help // @description Online Moodle/Elearning/KMOOC test help
// @author MrFry // @author MrFry
// @match https://elearning.uni-obuda.hu/* // @match https://elearning.uni-obuda.hu/*
@ -1904,7 +1904,7 @@
return return
} }
let port = hostUrl.includes('https') ? 433 : 80 let port = hostUrl.includes('http:') ? 80 : 432
if (hostUrl.split(':').length > 1) { if (hostUrl.split(':').length > 1) {
port = hostUrl.split(':')[1] port = hostUrl.split(':')[1]
port = port.replace(/\//g, '') port = port.replace(/\//g, '')
@ -1926,6 +1926,8 @@
elem.innerText = texts.connecting + getShortServerURL(serverAdress) elem.innerText = texts.connecting + getShortServerURL(serverAdress)
}) })
debugLog({ serverAdress: serverAdress, apiAdress: apiAdress }) debugLog({ serverAdress: serverAdress, apiAdress: apiAdress })
infoExpireTime = 0
p2pInfoExpireTime = 0
ConnectToServer() ConnectToServer()
} }