aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/database-dummy.cpp34
-rw-r--r--src/database-dummy.h28
-rw-r--r--src/database-leveldb.cpp36
-rw-r--r--src/database-leveldb.h33
-rw-r--r--src/database-sqlite3.cpp35
-rw-r--r--src/database-sqlite3.h28
-rw-r--r--src/database.cpp34
-rw-r--r--src/database.h30
-rw-r--r--src/map.h2
9 files changed, 178 insertions, 82 deletions
diff --git a/src/database-dummy.cpp b/src/database-dummy.cpp
index 9ca0e7328..acc19ca04 100644
--- a/src/database-dummy.cpp
+++ b/src/database-dummy.cpp
@@ -1,26 +1,36 @@
/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+/*
Dummy "database" class
*/
+#include "database-dummy.h"
+
#include "map.h"
#include "mapsector.h"
#include "mapblock.h"
+#include "serialization.h"
#include "main.h"
-#include "filesys.h"
-#include "voxel.h"
-#include "porting.h"
-#include "mapgen.h"
-#include "nodemetadata.h"
#include "settings.h"
#include "log.h"
-#include "profiler.h"
-#include "nodedef.h"
-#include "gamedef.h"
-#include "util/directiontables.h"
-#include "rollback_interface.h"
-
-#include "database-dummy.h"
Database_Dummy::Database_Dummy(ServerMap *map)
{
diff --git a/src/database-dummy.h b/src/database-dummy.h
index 5a6921370..1474a4a90 100644
--- a/src/database-dummy.h
+++ b/src/database-dummy.h
@@ -1,12 +1,30 @@
+/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
#ifndef DATABASE_DUMMY_HEADER
#define DATABASE_DUMMY_HEADER
-#include "map.h"
-#include "mapsector.h"
-#include "mapblock.h"
-#include "main.h"
-#include "filesys.h"
#include "database.h"
+#include <map>
+#include <string>
+
+class ServerMap;
class Database_Dummy : public Database
{
diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp
index cb0101a81..8f8d18290 100644
--- a/src/database-leveldb.cpp
+++ b/src/database-leveldb.cpp
@@ -1,3 +1,22 @@
+/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
#include "config.h"
#if USE_LEVELDB
@@ -6,25 +25,16 @@ LevelDB databases
*/
+#include "database-leveldb.h"
+#include "leveldb/db.h"
+
#include "map.h"
#include "mapsector.h"
#include "mapblock.h"
+#include "serialization.h"
#include "main.h"
-#include "filesys.h"
-#include "voxel.h"
-#include "porting.h"
-#include "mapgen.h"
-#include "nodemetadata.h"
#include "settings.h"
#include "log.h"
-#include "profiler.h"
-#include "nodedef.h"
-#include "gamedef.h"
-#include "util/directiontables.h"
-#include "rollback_interface.h"
-
-#include "database-leveldb.h"
-#include "leveldb/db.h"
Database_LevelDB::Database_LevelDB(ServerMap *map, std::string savedir)
{
diff --git a/src/database-leveldb.h b/src/database-leveldb.h
index 942992116..5408f4ce6 100644
--- a/src/database-leveldb.h
+++ b/src/database-leveldb.h
@@ -1,17 +1,34 @@
-#include "config.h"
+/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
-#if USE_LEVELDB
#ifndef DATABASE_LEVELDB_HEADER
#define DATABASE_LEVELDB_HEADER
-#include "map.h"
-#include "mapsector.h"
-#include "mapblock.h"
-#include "main.h"
-#include "filesys.h"
-#include "database.h"
+#include "config.h"
+
+#if USE_LEVELDB
+#include "database.h"
#include "leveldb/db.h"
+#include <string>
+
+class ServerMap;
class Database_LevelDB : public Database
{
diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp
index 1ae4d7a4b..17484d48c 100644
--- a/src/database-sqlite3.cpp
+++ b/src/database-sqlite3.cpp
@@ -1,4 +1,23 @@
/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+/*
SQLite format specification:
- Initially only replaces sectors/ and sectors2/
@@ -15,24 +34,16 @@
BLOB data
*/
+
+#include "database-sqlite3.h"
+
#include "map.h"
#include "mapsector.h"
#include "mapblock.h"
+#include "serialization.h"
#include "main.h"
-#include "filesys.h"
-#include "voxel.h"
-#include "porting.h"
-#include "mapgen.h"
-#include "nodemetadata.h"
#include "settings.h"
#include "log.h"
-#include "profiler.h"
-#include "nodedef.h"
-#include "gamedef.h"
-#include "util/directiontables.h"
-#include "rollback_interface.h"
-
-#include "database-sqlite3.h"
Database_SQLite3::Database_SQLite3(ServerMap *map, std::string savedir)
{
diff --git a/src/database-sqlite3.h b/src/database-sqlite3.h
index 80ba028a4..f426f4618 100644
--- a/src/database-sqlite3.h
+++ b/src/database-sqlite3.h
@@ -1,18 +1,34 @@
+/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
#ifndef DATABASE_SQLITE3_HEADER
#define DATABASE_SQLITE3_HEADER
-#include "config.h"
-#include "map.h"
-#include "mapsector.h"
-#include "mapblock.h"
-#include "main.h"
-#include "filesys.h"
#include "database.h"
+#include <string>
extern "C" {
#include "sqlite3.h"
}
+class ServerMap;
+
class Database_SQLite3 : public Database
{
public:
diff --git a/src/database.cpp b/src/database.cpp
index 771d9b962..b793cd2f2 100644
--- a/src/database.cpp
+++ b/src/database.cpp
@@ -1,22 +1,24 @@
-#include "map.h"
-#include "mapsector.h"
-#include "mapblock.h"
-#include "main.h"
-#include "filesys.h"
-#include "voxel.h"
-#include "porting.h"
-#include "mapgen.h"
-#include "nodemetadata.h"
-#include "settings.h"
-#include "log.h"
-#include "profiler.h"
-#include "nodedef.h"
-#include "gamedef.h"
-#include "util/directiontables.h"
-#include "rollback_interface.h"
+/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
#include "database.h"
+#include "irrlichttypes.h"
static s32 unsignedToSigned(s32 i, s32 max_positive)
{
diff --git a/src/database.h b/src/database.h
index 337f2745a..79cabe6a3 100644
--- a/src/database.h
+++ b/src/database.h
@@ -1,17 +1,29 @@
+/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
#ifndef DATABASE_HEADER
#define DATABASE_HEADER
-#include "config.h"
-#include "map.h"
-#include "mapsector.h"
-#include "mapblock.h"
-#include "main.h"
-#include "filesys.h"
-#include "serialization.h"
#include <list>
+#include "irr_v3d.h"
-class Database;
-class ServerMap;
+class MapBlock;
class Database
{
diff --git a/src/map.h b/src/map.h
index 15725f00e..34456d682 100644
--- a/src/map.h
+++ b/src/map.h
@@ -33,8 +33,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "modifiedstate.h"
#include "util/container.h"
#include "nodetimer.h"
-#include "database.h"
+class Database;
class ClientMap;
class MapSector;
class ServerMapSector;