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

Method playerSpawned

plugins/serverSideBotSample/serverSideBotSample.cpp:191–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191void SimpleBotHandler::playerSpawned(int player, float pos[3], float rot) {
192 bz_ServerSidePlayerHandler::playerSpawned(player, pos, rot);
193
194 bz_debugMessage(3, "SimpleBotHandler::process bz_ePlayerSpawnEvent");
195
196 if (player == playerID) {
197 return;
198 }
199
200 bz_BasePlayerRecord* playerInfo = bz_getPlayerByIndex(player);
201 std::string message;
202 message = bz_format("well, look who dropped in...%s", playerInfo->callsign.c_str());
203 bz_sendTextMessage(playerID, BZ_ALLUSERS, message.c_str());
204
205 // add the point as a waypoint
206 waypoints.push_back(Waypoint(*this, pos));
207
208 bz_freePlayerRecord(playerInfo);
209}
210
211void EventHandler::process(bz_EventData* eventData) {
212 if (eventData->eventType == bz_eTickEvent) {

Callers

nothing calls this directly

Calls 7

bz_debugMessageFunction · 0.85
bz_formatFunction · 0.85
bz_sendTextMessageFunction · 0.85
WaypointClass · 0.85
bz_freePlayerRecordFunction · 0.85
c_strMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected