| 133 | |
| 134 | |
| 135 | bool 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 | |
| 156 | void LuaHandle::RecvLuaData(int srcPlayerID, int srcScriptID, |
no test coverage detected