aboutsummaryrefslogtreecommitdiff
path: root/src/network/connection.h
Commit message (Expand)AuthorAge
* Fix Travis/unittest broken since b662a45SmallJoker2017-04-29
* Fix various performance issues reported by cppcheck (#5628)Loïc Blot2017-04-21
* Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)Loïc Blot2017-04-20
* Tolerate packet reordering in the early init processest312016-05-22
* Clean up threadingShadowNinja2015-08-23
* Remove unused function from connection.{cpp,h}nerzhul2015-08-15
* Fix BufferedPacket race condition (fixes #2983)kwolekr2015-08-06
* src/network/connection.h: Fix race conditionBřetislav Štec2015-08-01
* connection.cpp: remove unused constructorLoic Blot2015-07-14
* Fix uninitialized variabled in ConnectionEventLoic Blot2015-04-05
* Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.Loic Blot2015-03-31
* queued_commands must be a std::deque. RunCommandQueues needs to push packet o...Loic Blot2015-03-29
* Remove unused ConnectionCommand::sendToAll function. NetworkPacket::oldForgeP...Loic Blot2015-03-22
* For usages of assert() that are meant to persist in Release builds (when NDEB...Craig Robbins2015-03-07
* Remove Queue class which uses std::list and use native std::queueLoic Blot2015-03-05
* [Patch 2/4] Network rework: packet writing, sending and cleanupsLoic Blot2015-02-16
(L); lua_pushstring(L, "errormessage"); lua_pushstring(L, errormessage.c_str()); lua_settable(L, gamedata_idx); lua_pop(L, 1); } void ScriptApiMainMenu::handleMainMenuEvent(std::string text) { SCRIPTAPI_PRECHECKHEADER // Get handler function lua_getglobal(L, "core"); lua_getfield(L, -1, "event_handler"); lua_remove(L, -2); // Remove core if (lua_isnil(L, -1)) { lua_pop(L, 1); // Pop event_handler return; } luaL_checktype(L, -1, LUA_TFUNCTION); // Call it lua_pushstring(L, text.c_str()); if (lua_pcall(L, 1, 0, m_errorhandler)) scriptError(); } void ScriptApiMainMenu::handleMainMenuButtons(const StringMap &fields) { SCRIPTAPI_PRECHECKHEADER // Get handler function lua_getglobal(L, "core"); lua_getfield(L, -1, "button_handler"); lua_remove(L, -2); // Remove core if (lua_isnil(L, -1)) { lua_pop(L, 1); // Pop button handler return; } luaL_checktype(L, -1, LUA_TFUNCTION); // Convert fields to a Lua table lua_newtable(L); StringMap::const_iterator it; for (it = fields.begin(); it != fields.end(); ++it) { const std::string &name = it->first; const std::string &value = it->second; lua_pushstring(L, name.c_str()); lua_pushlstring(L, value.c_str(), value.size()); lua_settable(L, -3); } // Call it if (lua_pcall(L, 1, 0, m_errorhandler)) scriptError(); }