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

Method logChatMessage

plugins/webadmin/logs.cpp:386–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386void LogLoop::logChatMessage(bz_ChatEventData_V1* data, LogMessage& message) {
387 std::string from;
388 std::string to;
389
390 if (data->from != BZ_SERVER) {
391 from = bz_getPlayerCallsign(data->from);
392 }
393 else {
394 from = "server";
395 }
396
397 if (data->to == BZ_NULLUSER) {
398 to = bzu_GetTeamName(data->team);
399 }
400 else if (data->to == BZ_ALLUSERS) {
401 to = "all";
402 }
403 else {
404 to = bz_getPlayerCallsign(data->to);
405 }
406
407 message.message = format("Chat from %s to %s : %s", from.c_str(), to.c_str(), data->message.c_str());
408}
409
410void LogLoop::logJoinPartMessage(bz_PlayerJoinPartEventData_V1* data, LogMessage& message, bool join) {
411 message.message = format("Player %s(%d)", data->record->callsign.c_str(), data->playerID);

Callers

nothing calls this directly

Calls 4

bz_getPlayerCallsignFunction · 0.85
bzu_GetTeamNameFunction · 0.85
c_strMethod · 0.80
formatFunction · 0.50

Tested by

no test coverage detected