mirror of
https://github.com/minetest/minetest.git
synced 2025-07-04 17:00:23 +02:00
Rename macros with two leading underscores
These names are reserved for the compiler/library implementations.
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user