-----------ChatLoop
| 457 | |
| 458 | //-----------ChatLoop |
| 459 | ChatLoop::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 | |
| 495 | ChatLoop::~ChatLoop() { |
| 496 | removeNewPageCallback(this); |
nothing calls this directly
no test coverage detected