MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / ChatLoop

Method ChatLoop

plugins/webadmin/loops.cpp:459–493  ·  view source on GitHub ↗

-----------ChatLoop

Source from the content-addressed store, hash-verified

457
458//-----------ChatLoop
459ChatLoop::ChatLoop(Templateiser& ts) : LoopHandler() {
460 chatLimit = 20;
461 addNewPageCallback(this);
462 bz_registerEvent(bz_eRawChatMessageEvent, this);
463 ts.addLoop("chatlines", this);
464 ts.addKey("chatlinetime", this);
465 ts.addKey("chatlineuser", this);
466 ts.addKey("chatlineteam", this);
467 ts.addKey("chatlineto", this);
468 ts.addKey("chatlinetext", this);
469
470 ts.addKey("chattotal", this);
471 ts.addKey("chatitemnumber", this);
472
473 ts.addIF("chatlineisforteam", this);
474 ts.addIF("chatlimit", this);
475
476 // debug
477#ifdef _DEBUG
478 ChatMessage message;
479
480 bz_Time now;
481
482 bz_getUTCtime(&now);
483 message.time = printTime(&now);
484
485 message.from = "DEBUG";
486 message.to = "All";
487 message.fromTeam = "";
488 message.teamType = eNoTeam;
489 message.message = "Chat Log Startup";
490
491 messages.push_back(message);
492#endif
493}
494
495ChatLoop::~ChatLoop() {
496 removeNewPageCallback(this);

Callers

nothing calls this directly

Calls 8

addNewPageCallbackFunction · 0.85
bz_registerEventFunction · 0.85
bz_getUTCtimeFunction · 0.85
printTimeFunction · 0.85
addLoopMethod · 0.80
addKeyMethod · 0.80
addIFMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected