]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/clientiface.cpp
Document zoom_fov in settingtypes.txt and minetest.conf.example
[dragonfireclient.git] / src / clientiface.cpp
index d4efe60ef50451bbbf4438bc1564bea47d783893..a3a17d435f3d77a3067e8a83967fccd06f790c36 100644 (file)
@@ -38,10 +38,12 @@ const char *ClientInterface::statenames[] = {
        "Disconnecting",
        "Denied",
        "Created",
-       "InitSent",
+       "AwaitingInit2",
+       "HelloSent",
        "InitDone",
        "DefinitionsSent",
-       "Active"
+       "Active",
+       "SudoMode",
 };
 
 
@@ -65,7 +67,7 @@ void RemoteClient::GetNextBlocks (
                float dtime,
                std::vector<PrioritySortedBlockTransfer> &dest)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
 
        // Increment timers
@@ -368,17 +370,21 @@ void RemoteClient::GetNextBlocks (
 
 void RemoteClient::GotBlock(v3s16 p)
 {
-       if(m_blocks_sending.find(p) != m_blocks_sending.end())
-               m_blocks_sending.erase(p);
-       else
-       {
-               m_excess_gotblocks++;
+       if (m_blocks_modified.find(p) == m_blocks_modified.end()) {
+               if (m_blocks_sending.find(p) != m_blocks_sending.end())
+                       m_blocks_sending.erase(p);
+               else
+                       m_excess_gotblocks++;
+
+               m_blocks_sent.insert(p);
        }
-       m_blocks_sent.insert(p);
 }
 
 void RemoteClient::SentBlock(v3s16 p)
 {
+       if (m_blocks_modified.find(p) != m_blocks_modified.end())
+               m_blocks_modified.erase(p);
+
        if(m_blocks_sending.find(p) == m_blocks_sending.end())
                m_blocks_sending[p] = 0.0;
        else
@@ -389,22 +395,26 @@ void RemoteClient::SentBlock(v3s16 p)
 void RemoteClient::SetBlockNotSent(v3s16 p)
 {
        m_nearest_unsent_d = 0;
+       m_nothing_to_send_pause_timer = 0;
 
        if(m_blocks_sending.find(p) != m_blocks_sending.end())
                m_blocks_sending.erase(p);
        if(m_blocks_sent.find(p) != m_blocks_sent.end())
                m_blocks_sent.erase(p);
+       m_blocks_modified.insert(p);
 }
 
 void RemoteClient::SetBlocksNotSent(std::map<v3s16, MapBlock*> &blocks)
 {
        m_nearest_unsent_d = 0;
+       m_nothing_to_send_pause_timer = 0;
 
        for(std::map<v3s16, MapBlock*>::iterator
                        i = blocks.begin();
                        i != blocks.end(); ++i)
        {
                v3s16 p = i->first;
+               m_blocks_modified.insert(p);
 
                if(m_blocks_sending.find(p) != m_blocks_sending.end())
                        m_blocks_sending.erase(p);