]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/server.cpp
commit before some more radical changes
[dragonfireclient.git] / src / server.cpp
index 79600a44c1977e0541f26157443be2b3257062e2..b3ce9c13aeeef720b876219bf11227d0516b75dd 100644 (file)
@@ -544,10 +544,16 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
                                        block_is_invalid = true;
                                }
                                
-                               if(block->isFullyGenerated() == false)
+                               /*if(block->isFullyGenerated() == false)
                                {
                                        block_is_invalid = true;
-                               }
+                               }*/
+                               
+                               v2s16 p2d(p.X, p.Z);
+                               ServerMap *map = (ServerMap*)(&server->m_env.getMap());
+                               v2s16 chunkpos = map->sector_to_chunk(p2d);
+                               if(map->chunkNonVolatile(chunkpos) == false)
+                                       block_is_invalid = true;
                        }
 
                        /*
@@ -1711,7 +1717,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                writeU16(&reply[0], TOCLIENT_INIT);
                writeU8(&reply[2], deployed);
                writeV3S16(&reply[2+1], floatToInt(player->getPosition()+v3f(0,BS/2,0), BS));
-               writeU64(&reply[2+1+6], m_env.getServerMap().getSeed());
+               //writeU64(&reply[2+1+6], m_env.getServerMap().getSeed());
+               
                // Send as reliable
                m_con.Send(peer_id, 0, reply, true);
 
@@ -3320,6 +3327,36 @@ void setCreativeInventory(Player *player)
        /*
                Give materials
        */
+       
+       // CONTENT_IGNORE-terminated list
+       u8 material_items[] = {
+               CONTENT_TORCH,
+               CONTENT_MUD,
+               CONTENT_STONE,
+               CONTENT_SAND,
+               CONTENT_TREE,
+               CONTENT_LEAVES,
+               CONTENT_MESE,
+               CONTENT_WATERSOURCE,
+               CONTENT_CLOUD,
+               CONTENT_FURNACE,
+               CONTENT_SIGN_WALL,
+               CONTENT_IGNORE
+       };
+       
+       u8 *mip = material_items;
+       for(u16 i=0; i<PLAYER_INVENTORY_SIZE; i++)
+       {
+               if(*mip == CONTENT_IGNORE)
+                       break;
+
+               InventoryItem *item = new MaterialItem(*mip, 1);
+               player->inventory.addItem("main", item);
+
+               mip++;
+       }
+
+#if 0
        assert(USEFUL_CONTENT_COUNT <= PLAYER_INVENTORY_SIZE);
        
        // add torch first
@@ -3337,6 +3374,8 @@ void setCreativeInventory(Player *player)
                InventoryItem *item = new MaterialItem(i, 1);
                player->inventory.addItem("main", item);
        }
+#endif
+
        // Sign
        {
                InventoryItem *item = new MapBlockObjectItem("Sign Example text");
@@ -3476,7 +3515,7 @@ Player *Server::emergePlayer(const char *name, const char *password,
 
                player->setPosition(intToFloat(v3s16(
                                nodepos.X,
-                               groundheight + 1,
+                               groundheight + 5, // Accomodate mud
                                nodepos.Y
                ), BS));
 #endif