MCPcopy Create free account
hub / github.com/Atarity/Lightpack / UnLock

Method UnLock

Software/src/LightpackPluginInterface.cpp:232–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232bool LightpackPluginInterface::UnLock(QString sessionKey)
233{
234 if (lockSessionKeys.isEmpty()) return false;
235 if (lockSessionKeys[0]==sessionKey)
236 {
237 lockSessionKeys.removeFirst();
238 if (lockSessionKeys.count()==0)
239 {
240 emit updateDeviceLockStatus(DeviceLocked::Unlocked, lockSessionKeys);
241 emit ChangeLockStatus(false);
242 }
243 else
244 {
245 if (lockSessionKeys[0].indexOf("API", 0) != -1)
246 emit updateDeviceLockStatus(DeviceLocked::Api,lockSessionKeys);
247 else
248 emit updateDeviceLockStatus(DeviceLocked::Plugin, lockSessionKeys);
249 }
250 return true;
251 }
252 else
253 if (lockSessionKeys.indexOf(sessionKey)!= -1)
254 {
255 lockSessionKeys.removeOne(sessionKey);
256 if (lockSessionKeys[0].indexOf("API", 0) != -1)
257 emit updateDeviceLockStatus(DeviceLocked::Api,lockSessionKeys);
258 else
259 emit updateDeviceLockStatus(DeviceLocked::Plugin, lockSessionKeys);
260 return true;
261 }
262 return false;
263
264}
265
266
267void LightpackPluginInterface::SetLockAlive(QString sessionKey)

Callers 3

clientDisconnectedMethod · 0.45
clientProcessCommandsMethod · 0.45
stopListeningMethod · 0.45

Calls 1

countMethod · 0.80

Tested by

no test coverage detected