MCPcopy Create free account
hub / github.com/bwapi/bwapi / onReceiveText

Method onReceiveText

bwapi/BWAPI/Source/BWAPI/GameEvents.cpp:310–325  ·  view source on GitHub ↗

---------------------------------------------- ON RECV TEXT ----------------------------------------------

Source from the content-addressed store, hash-verified

308 }
309 //---------------------------------------------- ON RECV TEXT ----------------------------------------------
310 void GameImpl::onReceiveText(int playerId, const std::string &text)
311 {
312 if ( !this->bTournamentMessageAppeared && hTournamentModule && text == getTournamentString() )
313 this->bTournamentMessageAppeared = true;
314
315 // Do onReceiveText
316 int realId = stormIdToPlayerId(playerId);
317 if ( realId != -1 &&
318 (!this->BWAPIPlayer ||
319 realId != this->BWAPIPlayer->getIndex() ) &&
320 this->isFlagEnabled(BWAPI::Flag::UserInput) )
321 {
322 events.push_back(Event::ReceiveText(this->players[realId]));
323 events.back().setText(text.c_str());
324 }
325 }
326 int fixPathString(const char *in, char *out_, size_t outLen)
327 {
328 unsigned int n = 0;

Callers 2

_SNetReceiveMessageFunction · 0.45
SendClientEventMethod · 0.45

Calls 4

isFlagEnabledMethod · 0.95
setTextMethod · 0.80
c_strMethod · 0.80
getIndexMethod · 0.45

Tested by

no test coverage detected