MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / exec

Method exec

source/src/scriptinterpreter.cpp:438–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436{
437 QiFunc_time_ntp_s() : QiFunc(0, 1) {}
438 QiVar exec(const std::vector<QiVar>& args, QiScriptInterpreter*) const override
439 {
440 NtpClient ntp;
441 if (args.empty())
442 {
443 for (auto& s : ntp_servers)
444 {
445 auto t = ntp.unix(s, 123, 500);
446 if (t) return *t;
447 }
448 }
449 else
450 {
451 auto t = ntp.unix(args[0].toString(), 123, 500);
452 if (t) return *t;
453 }
454 return {};
455 }
456};
457/*
458str server: ntp server

Callers

nothing calls this directly

Calls 2

unixMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected