MCPcopy Create free account
hub / github.com/Segs/Segs / cmdHandler_SmileX

Function cmdHandler_SmileX

Projects/CoX/Servers/MapServer/SlashCommand.cpp:397–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397void cmdHandler_SmileX(const QStringList &params, MapClientSession &sess)
398{
399 QString fileName("scripts/" + params.join(" "));
400 if(!fileName.endsWith(".smlx"))
401 fileName.append(".smlx");
402 QFile file(fileName);
403 if(file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text))
404 {
405 QString contents(file.readAll());
406 sess.addCommandToSendNextUpdate(std::make_unique<StandardDialogCmd>(contents));
407 }
408 else {
409 QString errormsg = "Failed to load smilex file. \'" + file.fileName() + "\' not found.";
410 qCDebug(logSlashCommand) << errormsg;
411 sendInfoMessage(MessageChannel::ADMIN, errormsg, sess);
412 }
413}
414
415void cmdHandler_Falling(const QStringList &/*params*/, MapClientSession &sess)
416{

Callers

nothing calls this directly

Calls 3

sendInfoMessageFunction · 0.85
openMethod · 0.45

Tested by

no test coverage detected