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

Method RecvCommand

src/lua/LuaHandleCallIns.cpp:135–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134
135bool LuaHandle::RecvCommand(const std::string& cmd) {
136 LUA_CALL_IN_CHECK(L, 1)
137
138 // NOTE: we don't use PushCallIn() here because RecvCommand() is not managed
139 // by EventHandler, so no warning should be given if it is not found
140 lua_rawgeti(L, LUA_CALLINSINDEX, LUA_CI_RecvCommand);
141 if (!lua_isfunction(L, -1)) {
142 lua_pop(L, 1);
143 return false;
144 }
145
146 lua_pushlstring(L, cmd.data(), cmd.size());
147
148 if (!RunCallIn(LUA_CI_RecvCommand, 1, 1)) {
149 return false;
150 }
151
152 return PopBool(L, false);
153}
154
155
156void LuaHandle::RecvLuaData(int srcPlayerID, int srcScriptID,

Callers 4

LuaUserCommandMethod · 0.45
LuaBzOrgCommandMethod · 0.45
LuaWorldCommandMethod · 0.45
LuaRulesCommandMethod · 0.45

Calls 5

PopBoolFunction · 0.85
lua_rawgetiFunction · 0.50
lua_pushlstringFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected