| 2523 | |
| 2524 | |
| 2525 | int 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 | //============================================================================// |
nothing calls this directly
no test coverage detected