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

Method SetPlayerCustomData

src/lua/LuaCallOuts.cpp:2525–2540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2523
2524
2525int LuaCallOuts::SetPlayerCustomData(lua_State* L) {
2526 LocalPlayer* myTank = LocalPlayer::getMyTank();
2527 if (!myTank || !serverLink || !entered) {
2528 return luaL_pushnil(L);
2529 }
2530 const std::string key = luaL_checkstdstring(L, 1);
2531 const std::string value = luaL_checkstdstring(L, 2);
2532 if (key.empty()) {
2533 return luaL_pushnil(L);
2534 }
2535
2536 serverLink->sendCustomData(key, value);
2537
2538 lua_pushboolean(L, true);
2539 return 1;
2540}
2541
2542
2543//============================================================================//

Callers

nothing calls this directly

Calls 5

luaL_pushnilFunction · 0.85
luaL_checkstdstringFunction · 0.85
lua_pushbooleanFunction · 0.50
emptyMethod · 0.45
sendCustomDataMethod · 0.45

Tested by

no test coverage detected