diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/camera.cpp | 4 | ||||
-rw-r--r-- | src/client.cpp | 20 | ||||
-rw-r--r-- | src/clientiface.cpp | 2 | ||||
-rw-r--r-- | src/clientmap.cpp | 4 | ||||
-rw-r--r-- | src/content_cao.cpp | 2 | ||||
-rw-r--r-- | src/content_nodemeta.cpp | 6 | ||||
-rw-r--r-- | src/content_sao.cpp | 2 | ||||
-rw-r--r-- | src/debug.h | 14 | ||||
-rw-r--r-- | src/emerge.cpp | 2 | ||||
-rw-r--r-- | src/environment.cpp | 8 | ||||
-rw-r--r-- | src/httpfetch.cpp | 2 | ||||
-rw-r--r-- | src/inventory.cpp | 4 | ||||
-rw-r--r-- | src/inventorymanager.cpp | 2 | ||||
-rw-r--r-- | src/map.cpp | 36 | ||||
-rw-r--r-- | src/mapblock.cpp | 12 | ||||
-rw-r--r-- | src/nodemetadata.cpp | 2 | ||||
-rw-r--r-- | src/script/lua_api/l_server.cpp | 8 | ||||
-rw-r--r-- | src/server.cpp | 88 | ||||
-rw-r--r-- | src/unittest/test.cpp | 2 | ||||
-rw-r--r-- | src/util/thread.h | 2 |
20 files changed, 109 insertions, 113 deletions
diff --git a/src/camera.cpp b/src/camera.cpp index 0c6d03e4e..5370396a9 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -79,7 +79,7 @@ Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control, m_camera_mode(CAMERA_MODE_FIRST) { - //dstream<<__FUNCTION_NAME<<std::endl; + //dstream<<FUNCTION_NAME<<std::endl; // note: making the camera node a child of the player node // would lead to unexpected behaviour, so we don't do that. @@ -494,7 +494,7 @@ void Camera::updateViewingRange(f32 frametime_in, f32 busytime_in) return; m_frametime_counter = 0.2; // Same as ClientMap::updateDrawList interval - /*dstream<<__FUNCTION_NAME + /*dstream<<FUNCTION_NAME <<": Collected "<<m_added_frames<<" frames, total of " <<m_added_busytime<<"s."<<std::endl; diff --git a/src/client.cpp b/src/client.cpp index b2e21743c..5c04632d1 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -98,7 +98,7 @@ MeshUpdateQueue::~MeshUpdateQueue() */ void MeshUpdateQueue::addBlock(v3s16 p, MeshMakeData *data, bool ack_block_to_server, bool urgent) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); assert(data); // pre-condition @@ -323,7 +323,7 @@ void Client::connect(Address address, const std::string &address_name, bool is_local_server) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); initLocalMapSaving(address, address_name, is_local_server); @@ -333,7 +333,7 @@ void Client::connect(Address address, void Client::step(float dtime) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Limit a bit if(dtime > 2.0) @@ -824,7 +824,7 @@ void Client::initLocalMapSaving(const Address &address, void Client::ReceiveAll() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); u32 start_ms = porting::getTimeMs(); for(;;) { @@ -850,7 +850,7 @@ void Client::ReceiveAll() void Client::Receive() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt; m_con.Receive(&pkt); ProcessData(&pkt); @@ -867,7 +867,7 @@ inline void Client::handleCommand(NetworkPacket* pkt) */ void Client::ProcessData(NetworkPacket *pkt) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); ToClientCommand command = (ToClientCommand) pkt->getCommand(); u32 sender_peer_id = pkt->getPeerId(); @@ -1213,7 +1213,7 @@ void Client::sendChangePassword(const std::string &oldpassword, void Client::sendDamage(u8 damage) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOSERVER_DAMAGE, sizeof(u8)); pkt << damage; @@ -1222,7 +1222,7 @@ void Client::sendDamage(u8 damage) void Client::sendBreath(u16 breath) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOSERVER_BREATH, sizeof(u16)); pkt << breath; @@ -1231,7 +1231,7 @@ void Client::sendBreath(u16 breath) void Client::sendRespawn() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOSERVER_RESPAWN, 0); Send(&pkt); @@ -1239,7 +1239,7 @@ void Client::sendRespawn() void Client::sendReady() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOSERVER_CLIENT_READY, 1 + 1 + 1 + 1 + 2 + sizeof(char) * strlen(g_version_hash)); diff --git a/src/clientiface.cpp b/src/clientiface.cpp index a6ab1ef41..e7f127b84 100644 --- a/src/clientiface.cpp +++ b/src/clientiface.cpp @@ -67,7 +67,7 @@ void RemoteClient::GetNextBlocks ( float dtime, std::vector<PrioritySortedBlockTransfer> &dest) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Increment timers diff --git a/src/clientmap.cpp b/src/clientmap.cpp index 00a5b1021..b865c2780 100644 --- a/src/clientmap.cpp +++ b/src/clientmap.cpp @@ -81,7 +81,7 @@ ClientMap::~ClientMap() MapSector * ClientMap::emergeSector(v2s16 p2d) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Check that it doesn't exist already try{ return getSectorNoGenerate(p2d); @@ -400,7 +400,7 @@ struct MeshBufListList void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); bool is_transparent_pass = pass == scene::ESNRP_TRANSPARENT; diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 270483764..b3f90aa9c 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -465,7 +465,7 @@ void ItemCAO::updateTexture() } catch(SerializationError &e) { - warningstream<<__FUNCTION_NAME + warningstream<<FUNCTION_NAME <<": error deSerializing itemstring \"" <<m_itemstring<<std::endl; } diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index 072800d6c..7f4264d8e 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -154,9 +154,9 @@ void content_nodemeta_deserialize_legacy(std::istream &is, if(version > 1) { - infostream<<__FUNCTION_NAME<<": version "<<version<<" not supported" + infostream<<FUNCTION_NAME<<": version "<<version<<" not supported" <<std::endl; - throw SerializationError(__FUNCTION_NAME); + throw SerializationError(FUNCTION_NAME); } u16 count = readU16(is); @@ -174,7 +174,7 @@ void content_nodemeta_deserialize_legacy(std::istream &is, if(meta->get(p) != NULL) { - warningstream<<__FUNCTION_NAME<<": " + warningstream<<FUNCTION_NAME<<": " <<"already set data at position" <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring." <<std::endl; diff --git a/src/content_sao.cpp b/src/content_sao.cpp index fe46f3acb..0fa806c1a 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -393,7 +393,7 @@ std::string LuaEntitySAO::getClientInitializationData(u16 protocol_version) std::string LuaEntitySAO::getStaticData() { - verbosestream<<__FUNCTION_NAME<<std::endl; + verbosestream<<FUNCTION_NAME<<std::endl; std::ostringstream os(std::ios::binary); // version writeU8(os, 1); diff --git a/src/debug.h b/src/debug.h index e8d35ba70..2098942db 100644 --- a/src/debug.h +++ b/src/debug.h @@ -35,13 +35,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifdef _MSC_VER #include <eh.h> #endif - #define __NORETURN __declspec(noreturn) - #define __FUNCTION_NAME __FUNCTION__ #define NORETURN __declspec(noreturn) #define FUNCTION_NAME __FUNCTION__ #else - #define __NORETURN __attribute__ ((__noreturn__)) - #define __FUNCTION_NAME __PRETTY_FUNCTION__ #define NORETURN __attribute__ ((__noreturn__)) #define FUNCTION_NAME __PRETTY_FUNCTION__ #endif @@ -57,16 +53,16 @@ with this program; if not, write to the Free Software Foundation, Inc., /* Abort program execution immediately */ -__NORETURN extern void fatal_error_fn( +NORETURN extern void fatal_error_fn( const char *msg, const char *file, unsigned int line, const char *function); #define FATAL_ERROR(msg) \ - fatal_error_fn((msg), __FILE__, __LINE__, __FUNCTION_NAME) + fatal_error_fn((msg), __FILE__, __LINE__, FUNCTION_NAME) #define FATAL_ERROR_IF(expr, msg) \ ((expr) \ - ? fatal_error_fn((msg), __FILE__, __LINE__, __FUNCTION_NAME) \ + ? fatal_error_fn((msg), __FILE__, __LINE__, FUNCTION_NAME) \ : (void)(0)) /* @@ -75,14 +71,14 @@ __NORETURN extern void fatal_error_fn( defined) */ -__NORETURN extern void sanity_check_fn( +NORETURN extern void sanity_check_fn( const char *assertion, const char *file, unsigned int line, const char *function); #define SANITY_CHECK(expr) \ ((expr) \ ? (void)(0) \ - : sanity_check_fn(#expr, __FILE__, __LINE__, __FUNCTION_NAME)) + : sanity_check_fn(#expr, __FILE__, __LINE__, FUNCTION_NAME)) #define sanity_check(expr) SANITY_CHECK(expr) diff --git a/src/emerge.cpp b/src/emerge.cpp index 1e40b915a..21f17cb0e 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -627,7 +627,7 @@ MapBlock *EmergeThread::finishGen(v3s16 pos, BlockMakeData *bmdata, void *EmergeThread::run() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); BEGIN_DEBUG_EXCEPTION_HANDLER v3s16 pos; diff --git a/src/environment.cpp b/src/environment.cpp index 59159868e..88f25536f 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -70,7 +70,7 @@ Environment::~Environment() void Environment::addPlayer(Player *player) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); /* Check that peer_ids are unique. Also check that names are unique. @@ -982,7 +982,7 @@ void ServerEnvironment::clearAllObjects() void ServerEnvironment::step(float dtime) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); //TimeTaker timer("ServerEnv step"); @@ -2028,7 +2028,7 @@ ClientMap & ClientEnvironment::getClientMap() void ClientEnvironment::addPlayer(Player *player) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); /* It is a failure if player is local and there already is a local player @@ -2052,7 +2052,7 @@ LocalPlayer * ClientEnvironment::getLocalPlayer() void ClientEnvironment::step(float dtime) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); /* Step time of day */ stepTimeOfDay(dtime); diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 979f11160..f10351a01 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -616,7 +616,7 @@ protected: void *run() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); CurlHandlePool pool; diff --git a/src/inventory.cpp b/src/inventory.cpp index 67f979b13..e89993e63 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -126,7 +126,7 @@ ItemStack::ItemStack(std::string name_, u16 count_, void ItemStack::serialize(std::ostream &os) const { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); if(empty()) return; @@ -151,7 +151,7 @@ void ItemStack::serialize(std::ostream &os) const void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); clear(); diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp index d4e8d2f25..5b29b6f17 100644 --- a/src/inventorymanager.cpp +++ b/src/inventorymanager.cpp @@ -886,7 +886,7 @@ bool getCraftingResult(Inventory *inv, ItemStack& result, std::vector<ItemStack> &output_replacements, bool decrementInput, IGameDef *gamedef) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); result.clear(); diff --git a/src/map.cpp b/src/map.cpp index a2dbffe66..ceebd40a3 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1619,7 +1619,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks) INodeDefManager *nodemgr = m_gamedef->ndef(); - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); //TimeTaker timer("transformLiquids()"); u32 loopcount = 0; @@ -2118,7 +2118,7 @@ ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emer m_emerge(emerge), m_map_metadata_changed(true) { - verbosestream<<__FUNCTION_NAME<<std::endl; + verbosestream<<FUNCTION_NAME<<std::endl; /* Try to load map; if not found, create a new one. @@ -2205,7 +2205,7 @@ ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emer ServerMap::~ServerMap() { - verbosestream<<__FUNCTION_NAME<<std::endl; + verbosestream<<FUNCTION_NAME<<std::endl; try { @@ -2421,7 +2421,7 @@ void ServerMap::finishBlockMake(BlockMakeData *data, ServerMapSector *ServerMap::createSector(v2s16 p2d) { DSTACKF("%s: p2d=(%d,%d)", - __FUNCTION_NAME, + FUNCTION_NAME, p2d.X, p2d.Y); /* @@ -2488,7 +2488,7 @@ MapBlock * ServerMap::generateBlock( std::map<v3s16, MapBlock*> &modified_blocks ) { - DSTACKF("%s: p=(%d,%d,%d)", __FUNCTION_NAME, p.X, p.Y, p.Z); + DSTACKF("%s: p=(%d,%d,%d)", FUNCTION_NAME, p.X, p.Y, p.Z); /*infostream<<"generateBlock(): " <<"("<<p.X<<","<<p.Y<<","<<p.Z<<")" @@ -2508,7 +2508,7 @@ MapBlock * ServerMap::generateBlock( */ if(blockpos_over_limit(p)) { - infostream<<__FUNCTION_NAME<<": Block position over limit"<<std::endl; + infostream<<FUNCTION_NAME<<": Block position over limit"<<std::endl; throw InvalidPositionException("generateBlock(): pos. over limit"); } @@ -2598,7 +2598,7 @@ MapBlock * ServerMap::generateBlock( MapBlock * ServerMap::createBlock(v3s16 p) { DSTACKF("%s: p=(%d,%d,%d)", - __FUNCTION_NAME, p.X, p.Y, p.Z); + FUNCTION_NAME, p.X, p.Y, p.Z); /* Do not create over-limit @@ -2657,7 +2657,7 @@ MapBlock * ServerMap::createBlock(v3s16 p) MapBlock * ServerMap::emergeBlock(v3s16 p, bool create_blank) { DSTACKF("%s: p=(%d,%d,%d), create_blank=%d", - __FUNCTION_NAME, + FUNCTION_NAME, p.X, p.Y, p.Z, create_blank); { @@ -2880,7 +2880,7 @@ std::string ServerMap::getBlockFilename(v3s16 p) void ServerMap::save(ModifiedState save_level) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); if(m_map_saving_enabled == false) { warningstream<<"Not saving map, saving disabled."<<std::endl; return; @@ -2992,7 +2992,7 @@ void ServerMap::listAllLoadedBlocks(std::vector<v3s16> &dst) void ServerMap::saveMapMeta() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); createDirs(m_savedir); @@ -3016,7 +3016,7 @@ void ServerMap::saveMapMeta() void ServerMap::loadMapMeta() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); Settings conf; std::string fullpath = m_savedir + DIR_DELIM + "map_meta.txt"; @@ -3041,7 +3041,7 @@ void ServerMap::loadMapMeta() void ServerMap::saveSectorMeta(ServerMapSector *sector) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Format used for writing u8 version = SER_FMT_VER_HIGHEST_WRITE; // Get destination @@ -3062,7 +3062,7 @@ void ServerMap::saveSectorMeta(ServerMapSector *sector) MapSector* ServerMap::loadSectorMeta(std::string sectordir, bool save_after_load) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Get destination v2s16 p2d = getSectorPos(sectordir); @@ -3103,7 +3103,7 @@ MapSector* ServerMap::loadSectorMeta(std::string sectordir, bool save_after_load bool ServerMap::loadSectorMeta(v2s16 p2d) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // The directory layout we're going to load from. // 1 - original sectors/xxxxzzzz/ @@ -3145,7 +3145,7 @@ bool ServerMap::loadSectorMeta(v2s16 p2d) #if 0 bool ServerMap::loadSectorFull(v2s16 p2d) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); MapSector *sector = NULL; @@ -3284,7 +3284,7 @@ bool ServerMap::saveBlock(MapBlock *block, Database *db) void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSector *sector, bool save_after_load) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); std::string fullpath = sectordir + DIR_DELIM + blockfile; try { @@ -3360,7 +3360,7 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); try { std::istringstream is(*blob, std::ios_base::binary); @@ -3428,7 +3428,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool MapBlock* ServerMap::loadBlock(v3s16 blockpos) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); v2s16 p2d(blockpos.X, blockpos.Z); diff --git a/src/mapblock.cpp b/src/mapblock.cpp index be16c3bb7..f8747f52b 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -796,12 +796,12 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk) char tmp; is.read(&tmp, 1); if (is.gcount() != 1) - throw SerializationError(std::string(__FUNCTION_NAME) + throw SerializationError(std::string(FUNCTION_NAME) + ": not enough input data"); is_underground = tmp; is.read((char *)*databuf_nodelist, nodecount * ser_length); if ((u32)is.gcount() != nodecount * ser_length) - throw SerializationError(std::string(__FUNCTION_NAME) + throw SerializationError(std::string(FUNCTION_NAME) + ": not enough input data"); } else if (version <= 10) { u8 t8; @@ -814,7 +814,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk) decompress(is, os, version); std::string s = os.str(); if (s.size() != nodecount) - throw SerializationError(std::string(__FUNCTION_NAME) + throw SerializationError(std::string(FUNCTION_NAME) + ": not enough input data"); for (u32 i = 0; i < s.size(); i++) { databuf_nodelist[i*ser_length] = s[i]; @@ -826,7 +826,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk) decompress(is, os, version); std::string s = os.str(); if (s.size() != nodecount) - throw SerializationError(std::string(__FUNCTION_NAME) + throw SerializationError(std::string(FUNCTION_NAME) + ": not enough input data"); for (u32 i = 0; i < s.size(); i++) { databuf_nodelist[i*ser_length + 1] = s[i]; @@ -839,7 +839,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk) decompress(is, os, version); std::string s = os.str(); if (s.size() != nodecount) - throw SerializationError(std::string(__FUNCTION_NAME) + throw SerializationError(std::string(FUNCTION_NAME) + ": not enough input data"); for (u32 i = 0; i < s.size(); i++) { databuf_nodelist[i*ser_length + 2] = s[i]; @@ -859,7 +859,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk) decompress(is, os, version); std::string s = os.str(); if (s.size() != nodecount * 3) - throw SerializationError(std::string(__FUNCTION_NAME) + throw SerializationError(std::string(FUNCTION_NAME) + ": decompress resulted in size other than nodecount*3"); // deserialize nodes from buffer diff --git a/src/nodemetadata.cpp b/src/nodemetadata.cpp index 9c74dcd28..126889ecf 100644 --- a/src/nodemetadata.cpp +++ b/src/nodemetadata.cpp @@ -120,7 +120,7 @@ void NodeMetadataList::deSerialize(std::istream &is, IItemDefManager *item_def_m } if (version != 1) { - std::string err_str = std::string(__FUNCTION_NAME) + std::string err_str = std::string(FUNCTION_NAME) + ": version " + itos(version) + " not supported"; infostream << err_str << std::endl; throw SerializationError(err_str); diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index a6dac487b..6a8183088 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -110,7 +110,7 @@ int ModApiServer::l_get_player_ip(lua_State *L) } catch(con::PeerNotFoundException) // unlikely { - dstream << __FUNCTION_NAME << ": peer was not found" << std::endl; + dstream << FUNCTION_NAME << ": peer was not found" << std::endl; lua_pushnil(L); // error return 1; } @@ -136,7 +136,7 @@ int ModApiServer::l_get_player_information(lua_State *L) } catch(con::PeerNotFoundException) // unlikely { - dstream << __FUNCTION_NAME << ": peer was not found" << std::endl; + dstream << FUNCTION_NAME << ": peer was not found" << std::endl; lua_pushnil(L); // error return 1; } @@ -150,7 +150,7 @@ int ModApiServer::l_get_player_information(lua_State *L) #define ERET(code) \ if (!(code)) { \ - dstream << __FUNCTION_NAME << ": peer was not found" << std::endl; \ + dstream << FUNCTION_NAME << ": peer was not found" << std::endl; \ lua_pushnil(L); /* error */ \ return 1; \ } @@ -281,7 +281,7 @@ int ModApiServer::l_ban_player(lua_State *L) } catch(con::PeerNotFoundException) // unlikely { - dstream << __FUNCTION_NAME << ": peer was not found" << std::endl; + dstream << FUNCTION_NAME << ": peer was not found" << std::endl; lua_pushboolean(L, false); // error return 1; } diff --git a/src/server.cpp b/src/server.cpp index d6207538f..3aff2fb97 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -88,7 +88,7 @@ private: void *ServerThread::run() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); BEGIN_DEBUG_EXCEPTION_HANDLER m_server->AsyncRunStep(true); @@ -433,7 +433,7 @@ Server::~Server() void Server::start(Address bind_addr) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); m_bind_addr = bind_addr; @@ -466,7 +466,7 @@ void Server::start(Address bind_addr) void Server::stop() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); infostream<<"Server: Stopping and waiting threads"<<std::endl; @@ -481,7 +481,7 @@ void Server::stop() void Server::step(float dtime) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Limit a bit if(dtime > 2.0) dtime = 2.0; @@ -509,7 +509,7 @@ void Server::step(float dtime) void Server::AsyncRunStep(bool initial_step) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); g_profiler->add("Server::AsyncRunStep (num)", 1); @@ -693,7 +693,7 @@ void Server::AsyncRunStep(bool initial_step) Player *player = m_env->getPlayer(client->peer_id); if(player == NULL) { // This can happen if the client timeouts somehow - /*warningstream<<__FUNCTION_NAME<<": Client " + /*warningstream<<FUNCTION_NAME<<": Client " <<client->peer_id <<" has no associated player"<<std::endl;*/ continue; @@ -746,7 +746,7 @@ void Server::AsyncRunStep(bool initial_step) // Get object type u8 type = ACTIVEOBJECT_TYPE_INVALID; if(obj == NULL) - warningstream<<__FUNCTION_NAME + warningstream<<FUNCTION_NAME <<": NULL object"<<std::endl; else type = obj->getSendType(); @@ -1021,7 +1021,7 @@ void Server::AsyncRunStep(bool initial_step) void Server::Receive() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); SharedBuffer<u8> data; u16 peer_id; try { @@ -1158,7 +1158,7 @@ inline void Server::handleCommand(NetworkPacket* pkt) void Server::ProcessData(NetworkPacket *pkt) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Environment is locked first. MutexAutoLock envlock(m_env_mutex); @@ -1354,7 +1354,7 @@ void Server::SetBlocksNotSent(std::map<v3s16, MapBlock *>& block) void Server::peerAdded(con::Peer *peer) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); verbosestream<<"Server::peerAdded(): peer->id=" <<peer->id<<std::endl; @@ -1367,7 +1367,7 @@ void Server::peerAdded(con::Peer *peer) void Server::deletingPeer(con::Peer *peer, bool timeout) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); verbosestream<<"Server::deletingPeer(): peer->id=" <<peer->id<<", timeout="<<timeout<<std::endl; @@ -1459,7 +1459,7 @@ void Server::Send(NetworkPacket* pkt) void Server::SendMovement(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); NetworkPacket pkt(TOCLIENT_MOVEMENT, 12 * sizeof(float), peer_id); @@ -1496,7 +1496,7 @@ void Server::SendPlayerHPOrDie(PlayerSAO *playersao) void Server::SendHP(u16 peer_id, u8 hp) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_HP, 1, peer_id); pkt << hp; @@ -1505,7 +1505,7 @@ void Server::SendHP(u16 peer_id, u8 hp) void Server::SendBreath(u16 peer_id, u16 breath) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_BREATH, 2, peer_id); pkt << (u16) breath; @@ -1529,7 +1529,7 @@ void Server::SendAccessDenied(u16 peer_id, AccessDeniedCode reason, void Server::SendAccessDenied_Legacy(u16 peer_id,const std::wstring &reason) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_ACCESS_DENIED_LEGACY, 0, peer_id); pkt << reason; @@ -1539,7 +1539,7 @@ void Server::SendAccessDenied_Legacy(u16 peer_id,const std::wstring &reason) void Server::SendDeathscreen(u16 peer_id,bool set_camera_point_target, v3f camera_point_target) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_DEATHSCREEN, 1 + sizeof(v3f), peer_id); pkt << set_camera_point_target << camera_point_target; @@ -1549,7 +1549,7 @@ void Server::SendDeathscreen(u16 peer_id,bool set_camera_point_target, void Server::SendItemDef(u16 peer_id, IItemDefManager *itemdef, u16 protocol_version) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_ITEMDEF, 0, peer_id); @@ -1574,7 +1574,7 @@ void Server::SendItemDef(u16 peer_id, void Server::SendNodeDef(u16 peer_id, INodeDefManager *nodedef, u16 protocol_version) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_NODEDEF, 0, peer_id); @@ -1603,7 +1603,7 @@ void Server::SendNodeDef(u16 peer_id, void Server::SendInventory(PlayerSAO* playerSAO) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); UpdateCrafting(playerSAO->getPlayer()); @@ -1624,7 +1624,7 @@ void Server::SendInventory(PlayerSAO* playerSAO) void Server::SendChatMessage(u16 peer_id, const std::wstring &message) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_CHAT_MESSAGE, 0, peer_id); pkt << message; @@ -1640,7 +1640,7 @@ void Server::SendChatMessage(u16 peer_id, const std::wstring &message) void Server::SendShowFormspecMessage(u16 peer_id, const std::string &formspec, const std::string &formname) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_SHOW_FORMSPEC, 0 , peer_id); @@ -1655,7 +1655,7 @@ void Server::SendSpawnParticle(u16 peer_id, v3f pos, v3f velocity, v3f accelerat float expirationtime, float size, bool collisiondetection, bool vertical, std::string texture) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_SPAWN_PARTICLE, 0, peer_id); @@ -1677,7 +1677,7 @@ void Server::SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime, v3 v3f minvel, v3f maxvel, v3f minacc, v3f maxacc, float minexptime, float maxexptime, float minsize, float maxsize, bool collisiondetection, bool vertical, std::string texture, u32 id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_ADD_PARTICLESPAWNER, 0, peer_id); @@ -1699,7 +1699,7 @@ void Server::SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime, v3 void Server::SendDeleteParticleSpawner(u16 peer_id, u32 id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_DELETE_PARTICLESPAWNER_LEGACY, 2, peer_id); @@ -1809,7 +1809,7 @@ void Server::SendOverrideDayNightRatio(u16 peer_id, bool do_override, void Server::SendTimeOfDay(u16 peer_id, u16 time, f32 time_speed) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_TIME_OF_DAY, 0, peer_id); pkt << time << time_speed; @@ -1824,7 +1824,7 @@ void Server::SendTimeOfDay(u16 peer_id, u16 time, f32 time_speed) void Server::SendPlayerHP(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); PlayerSAO *playersao = getPlayerSAO(peer_id); // In some rare case, if the player is disconnected // while Lua call l_punch, for example, this can be NULL @@ -1842,7 +1842,7 @@ void Server::SendPlayerHP(u16 peer_id) void Server::SendPlayerBreath(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); @@ -1852,7 +1852,7 @@ void Server::SendPlayerBreath(u16 peer_id) void Server::SendMovePlayer(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); Player *player = m_env->getPlayer(peer_id); assert(player); @@ -2120,7 +2120,7 @@ void Server::setBlockNotSent(v3s16 p) void Server::SendBlockNoLock(u16 peer_id, MapBlock *block, u8 ver, u16 net_proto_version) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); v3s16 p = block->getPos(); @@ -2142,7 +2142,7 @@ void Server::SendBlockNoLock(u16 peer_id, MapBlock *block, u8 ver, u16 net_proto void Server::SendBlocks(float dtime) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); MutexAutoLock envlock(m_env_mutex); //TODO check if one big lock could be faster then multiple small ones @@ -2212,7 +2212,7 @@ void Server::SendBlocks(float dtime) void Server::fillMediaCache() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); infostream<<"Server: Calculating media file checksums"<<std::endl; @@ -2308,7 +2308,7 @@ void Server::fillMediaCache() void Server::sendMediaAnnouncement(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); verbosestream << "Server: Announcing files to id(" << peer_id << ")" << std::endl; @@ -2345,7 +2345,7 @@ struct SendableMedia void Server::sendRequestedMedia(u16 peer_id, const std::vector<std::string> &tosend) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); verbosestream<<"Server::sendRequestedMedia(): " <<"Sending files to client"<<std::endl; @@ -2452,7 +2452,7 @@ void Server::sendRequestedMedia(u16 peer_id, void Server::sendDetachedInventory(const std::string &name, u16 peer_id) { if(m_detached_inventories.count(name) == 0) { - errorstream<<__FUNCTION_NAME<<": \""<<name<<"\" not found"<<std::endl; + errorstream<<FUNCTION_NAME<<": \""<<name<<"\" not found"<<std::endl; return; } Inventory *inv = m_detached_inventories[name]; @@ -2477,7 +2477,7 @@ void Server::sendDetachedInventory(const std::string &name, u16 peer_id) void Server::sendDetachedInventories(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); for(std::map<std::string, Inventory*>::iterator i = m_detached_inventories.begin(); @@ -2494,7 +2494,7 @@ void Server::sendDetachedInventories(u16 peer_id) void Server::DiePlayer(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); @@ -2514,7 +2514,7 @@ void Server::DiePlayer(u16 peer_id) void Server::RespawnPlayer(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); @@ -2540,7 +2540,7 @@ void Server::RespawnPlayer(u16 peer_id) void Server::DenySudoAccess(u16 peer_id) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); NetworkPacket pkt(TOCLIENT_DENY_SUDO_MODE, 0, peer_id); Send(&pkt); @@ -2566,7 +2566,7 @@ void Server::DenyAccessVerCompliant(u16 peer_id, u16 proto_ver, AccessDeniedCode void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); SendAccessDenied(peer_id, reason, custom_reason); m_clients.event(peer_id, CSE_SetDenied); @@ -2577,7 +2577,7 @@ void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string // the minimum version for MT users, maybe in 1 year void Server::DenyAccess_Legacy(u16 peer_id, const std::wstring &reason) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); SendAccessDenied_Legacy(peer_id, reason); m_clients.event(peer_id, CSE_SetDenied); @@ -2586,7 +2586,7 @@ void Server::DenyAccess_Legacy(u16 peer_id, const std::wstring &reason) void Server::acceptAuth(u16 peer_id, bool forSudoMode) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); if (!forSudoMode) { RemoteClient* client = getClient(peer_id, CS_Invalid); @@ -2617,7 +2617,7 @@ void Server::acceptAuth(u16 peer_id, bool forSudoMode) void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); std::wstring message; { /* @@ -2700,7 +2700,7 @@ void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason) void Server::UpdateCrafting(Player* player) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); // Get a preview for crafting ItemStack preview; @@ -3388,7 +3388,7 @@ PlayerSAO* Server::emergePlayer(const char *name, u16 peer_id, u16 proto_version void dedicated_server_loop(Server &server, bool &kill) { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); verbosestream<<"dedicated_server_loop()"<<std::endl; diff --git a/src/unittest/test.cpp b/src/unittest/test.cpp index de4711802..1f3b31017 100644 --- a/src/unittest/test.cpp +++ b/src/unittest/test.cpp @@ -217,7 +217,7 @@ void TestGameDef::defineSomeNodes() void run_tests() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); u32 t1 = porting::getTime(PRECISION_MILLI); TestGameDef gamedef; diff --git a/src/util/thread.h b/src/util/thread.h index 8d8b6fe7f..5ed63544c 100644 --- a/src/util/thread.h +++ b/src/util/thread.h @@ -210,7 +210,7 @@ public: void *run() { - DSTACK(__FUNCTION_NAME); + DSTACK(FUNCTION_NAME); BEGIN_DEBUG_EXCEPTION_HANDLER while (!stopRequested()) { |