parent
4ab14c7d74
commit
49898eed46
|
@ -44,11 +44,18 @@ end
|
|||
Config = loadConf()
|
||||
|
||||
-- disable dangerous functions
|
||||
os.remove = nil
|
||||
os.execute = nil
|
||||
os.exit = nil
|
||||
os.rename = nil
|
||||
local _os = {
|
||||
time = os.time,
|
||||
date = os.date,
|
||||
clock = os.clock,
|
||||
difftime = os.difftime,
|
||||
getms = os.getms,
|
||||
}
|
||||
os = _os
|
||||
io = nil
|
||||
package = nil
|
||||
load = nil
|
||||
loadfile = nil
|
||||
|
||||
-- load packages
|
||||
dofile "lua/fk_ex.lua"
|
||||
|
|
|
@ -27,10 +27,7 @@ callbacks["NetworkDelayTest"] = function(jsonData) {
|
|||
cipherText = Backend.pubEncrypt(jsonData, config.password);
|
||||
}
|
||||
config.cipherText = cipherText;
|
||||
let md5sum = Backend.calcFileMD5();
|
||||
ClientInstance.notifyServer("Setup", JSON.stringify([
|
||||
config.screenName, cipherText, md5sum
|
||||
]));
|
||||
Backend.replyDelayTest(config.screenName, cipherText);
|
||||
}
|
||||
|
||||
callbacks["ErrorMsg"] = function(jsonData) {
|
||||
|
|
|
@ -219,8 +219,12 @@ void QmlBackend::saveConf(const QString &conf) {
|
|||
c.write(conf.toUtf8());
|
||||
}
|
||||
|
||||
QString QmlBackend::calcFileMD5() {
|
||||
return ::calcFileMD5();
|
||||
void QmlBackend::replyDelayTest(const QString &screenName, const QString &cipher) {
|
||||
auto md5 = calcFileMD5();
|
||||
|
||||
QJsonArray arr;
|
||||
arr << screenName << cipher << md5;
|
||||
ClientInstance->notifyServer("Setup", JsonArray2Bytes(arr));
|
||||
}
|
||||
|
||||
void QmlBackend::playSound(const QString &name, int index) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
Q_INVOKABLE QString loadConf();
|
||||
Q_INVOKABLE void saveConf(const QString &conf);
|
||||
|
||||
Q_INVOKABLE QString calcFileMD5();
|
||||
Q_INVOKABLE void replyDelayTest(const QString &screenName, const QString &cipher);
|
||||
Q_INVOKABLE void playSound(const QString &name, int index = 0);
|
||||
|
||||
Q_INVOKABLE void copyToClipboard(const QString &s);
|
||||
|
|
Loading…
Reference in New Issue