aboutsummaryrefslogtreecommitdiff
path: root/src/network
ModeNameSize
-rw-r--r--CMakeLists.txt535logplain
-rw-r--r--address.cpp5971logplain
-rw-r--r--address.h2238logplain
-rw-r--r--clientopcodes.cpp12265logplain
-rw-r--r--clientopcodes.h1453logplain
-rw-r--r--clientpackethandler.cpp45182logplain
-rw-r--r--connection.cpp40618logplain
-rw-r--r--connection.h19843logplain
-rw-r--r--connectionthreads.cpp41630logplain
-rw-r--r--connectionthreads.h4860logplain
-rw-r--r--networkexceptions.h2355logplain
-rw-r--r--networkpacket.cpp10700logplain
-rw-r--r--networkpacket.h3838logplain
-rw-r--r--networkprotocol.h24187logplain
-rw-r--r--peerhandler.h1638logplain
-rw-r--r--serveropcodes.cpp10715logplain
-rw-r--r--serveropcodes.h1473logplain
-rw-r--r--serverpackethandler.cpp54292logplain
-rw-r--r--socket.cpp9043logplain
-rw-r--r--socket.h1572logplain
span> // are converted by lua_toboolean to true or false, respectively. }; class ScriptApiBase { public: /* object */ void addObjectReference(ServerActiveObject *cobj); void removeObjectReference(ServerActiveObject *cobj); ScriptApiBase(); protected: friend class LuaABM; friend class InvRef; friend class ObjectRef; friend class NodeMetaRef; friend class ModApiBase; friend class ModApiEnvMod; inline lua_State* getStack() { return m_luastack; } bool setStack(lua_State* stack) { if (m_luastack == 0) { m_luastack = stack; return true; } return false; } void realityCheck(); void scriptError(const char *fmt, ...); void stackDump(std::ostream &o); void runCallbacks(int nargs,RunCallbacksMode mode); inline Server* getServer() { return m_server; } void setServer(Server* server) { m_server = server; } Environment* getEnv() { return m_environment; } void setEnv(Environment* env) { m_environment = env; } void objectrefGetOrCreate(ServerActiveObject *cobj); void objectrefGet(u16 id); JMutex m_luastackmutex; #ifdef LOCK_DEBUG bool m_locked; #endif private: lua_State* m_luastack; Server* m_server; Environment* m_environment; }; #ifdef LOCK_DEBUG class LockChecker { public: LockChecker(bool* variable) { assert(*variable == false); m_variable = variable; *m_variable = true; } ~LockChecker() { *m_variable = false; } private: bool* m_variable; }; #define LOCK_CHECK LockChecker(&(this->m_locked)) #else #define LOCK_CHECK while(0) #endif #define LUA_STACK_AUTOLOCK JMutexAutoLock(this->m_luastackmutex) #define SCRIPTAPI_PRECHECKHEADER \ LUA_STACK_AUTOLOCK; \ LOCK_CHECK; \ realityCheck(); \ lua_State *L = getStack(); \ assert(lua_checkstack(L, 20)); \ StackUnroller stack_unroller(L); #define PLAYER_TO_SA(p) p->getEnv()->getScriptIface() #define ENV_TO_SA(env) env->getScriptIface() #define SERVER_TO_SA(srv) srv->getScriptIface() #endif /* S_BASE_H_ */