tinkering around
authorPerttu Ahola <celeron55@gmail.com>
Sat, 25 Dec 2010 09:27:14 +0000 (11:27 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 25 Dec 2010 09:27:14 +0000 (11:27 +0200)
src/connection.cpp
src/connection.h
src/guiPauseMenu.cpp
src/main.cpp
src/server.cpp

index 0bc8492e6d482b34616bce20ed2e0aeba31b92ab..6c37ff63bf9d5f81806025db91e67b39d719248f 100644 (file)
@@ -671,7 +671,7 @@ SharedBuffer<u8> Channel::ProcessPacket(
                        con->PrintInfo();
                        dout_con<<"DISCO: Removing peer "<<(peer_id)<<std::endl;
                        
-                       if(con->deletePeer(peer_id) == false)
+                       if(con->deletePeer(peer_id, false) == false)
                        {
                                con->PrintInfo(derr_con);
                                derr_con<<"DISCO: Peer not found"<<std::endl;
@@ -1301,15 +1301,13 @@ nextpeer:
                continue;
        }
 
-       // Remove timeouted peers
+       // Remove timed out peers
        core::list<u16>::Iterator i = timeouted_peers.begin();
        for(; i != timeouted_peers.end(); i++)
        {
                PrintInfo(derr_con);
                derr_con<<"RunTimeouts(): Removing peer "<<(*i)<<std::endl;
-               m_peerhandler->deletingPeer(m_peers[*i], true);
-               delete m_peers[*i];
-               m_peers.remove(*i);
+               deletePeer(*i, true);
        }
 }
 
@@ -1355,11 +1353,11 @@ core::list<Peer*> Connection::GetPeers()
        return list;
 }
 
-bool Connection::deletePeer(u16 peer_id)
+bool Connection::deletePeer(u16 peer_id, bool timeout)
 {
        if(m_peers.find(peer_id) == NULL)
                return false;
-       m_peerhandler->deletingPeer(m_peers[peer_id], true);
+       m_peerhandler->deletingPeer(m_peers[peer_id], timeout);
        delete m_peers[peer_id];
        m_peers.remove(peer_id);
        return true;
index ad45278ba26c72dbfad52c8825d51aac59f6eaf2..73d04371039d91d955084c29de6ea31738da0fb9 100644 (file)
@@ -477,7 +477,7 @@ public:
        
        // Calls PeerHandler::deletingPeer
        // Returns false if peer was not found
-       bool deletePeer(u16 peer_id);
+       bool deletePeer(u16 peer_id, bool timeout);
 
        void SetPeerID(u16 id){ m_peer_id = id; }
        u16 GetPeerID(){ return m_peer_id; }
index ae1f58a9d40cdb410bee922385e5ef67f70f2620..10d272b35b947221d82064a540d770120affc997 100644 (file)
@@ -95,7 +95,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
                Environment->addButton(rect, this, 257, L"Exit");\r
        }\r
        {\r
-               core::rect<s32> rect(0, 0, 180, 220);\r
+               core::rect<s32> rect(0, 0, 180, 240);\r
                rect = rect + v2s32(size.X/2 + 90, size.Y/2-rect.getHeight()/2);\r
                const wchar_t *text =\r
                L"Keys:\n"\r
index 524f124696ef9b23a8841e365e030aa3c7d98960..47840eae8d65a18798be0be58a2d534c86dae02e 100644 (file)
@@ -89,10 +89,6 @@ SUGG: Implement a "Fast check queue" (a queue with a map for checking
       if something is already in it)\r
       - Use it in active block queue in water flowing\r
 \r
-SUGG: Signs could be done in the same way as torches. For this, blocks\r
-      need an additional metadata field for the texts\r
-         - This is also needed for item container chests\r
-\r
 SUGG: Precalculate lighting translation table at runtime (at startup)\r
 \r
 SUGG: A version number to blocks, which increments when the block is\r
@@ -179,6 +175,12 @@ TODO: Check if the usage of Client::isFetchingBlocks() in
 TODO: Make an option to the server to disable building and digging near\r
       the starting position\r
 \r
+SUGG: Signs could be done in the same way as torches. For this, blocks\r
+      need an additional metadata field for the texts\r
+         - This is also needed for item container chests\r
+TODO: There has to be some better way to handle static objects than to\r
+      send them all the time. This affects signs and item objects.\r
+\r
 Doing now:\r
 ======================================================================\r
 \r
@@ -2347,7 +2349,7 @@ int main(int argc, char *argv[])
                        while(client.getChatMessage(message))\r
                        {\r
                                chat_lines.push_back(ChatLine(message));\r
-                               if(chat_lines.size() > 7)\r
+                               if(chat_lines.size() > 5)\r
                                {\r
                                        core::list<ChatLine>::Iterator\r
                                                        i = chat_lines.begin();\r
@@ -2385,6 +2387,11 @@ int main(int argc, char *argv[])
                                        screensize.Y - 10\r
                        );\r
                        chat_guitext->setRelativePosition(rect);\r
+\r
+                       if(chat_lines.size() == 0)\r
+                               chat_guitext->setVisible(false);\r
+                       else\r
+                               chat_guitext->setVisible(true);\r
                }\r
 \r
                /*\r
index e210d4d64dd87e94485f5e7058fd1bc7ca7aee08..c8f9be00e986c861916a068cf38dd7755e280ba7 100644 (file)
@@ -3133,6 +3133,8 @@ void Server::handlePeerChange(PeerChange &c)
                        message += L"*** ";
                        message += name;
                        message += L" left game";
+                       if(c.timeout)
+                               message += L" (timed out)";
                }
 
                // Delete player