opentibia / server

An open source server for the MMORPG Tibia.
GNU General Public License v2.0
414 stars 149 forks source link

Database Connection Failed #25

Closed fervi closed 10 years ago

fervi commented 10 years ago

Hello!

I have a little problem

To generate database we need to copy sql folder into tools. use gendb.sh and copy db.s3db to folder (copy to otserv binary file). But OTServ (binary) doesn't work with them.

Error: Database Connection Failed! otserv: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:81: boost::condition_variable::~condition_variable(): Assertion `!ret' failed.

Something wrong with old database or what?

Thanks Fervi

iryont commented 10 years ago

The server is compiled with MySQL support only.

I have modified the code to compile with SQLite support as well.

fervi commented 10 years ago

Oczywiście jeśli możesz :P Używanie SQLite jest po prostu łatwiejsze (tzn. nic się nie konfiguruje itd.)

Ostatnio się kompilowało z SQLite - może coś trzeba przy kompilacji wpisać (jak to w wielu OTS) by było wsparcie SQLite?

fervi commented 10 years ago

Nie bardzo wiem, czy to "legalne", ale w pliku Cmakelist zmieniłem Mysql na SQlite

[100%] Building CXX object src/CMakeFiles/otserv.dir/item_attributes.cpp.o Linking CXX executable otserv CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In function DatabaseSQLite::DatabaseSQLite()': database_driver_sqlite.cpp:(.text+0x12e): undefined reference tosqlite3_open' database_driver_sqlite.cpp:(.text+0x166): undefined reference to sqlite3_close' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionDatabaseSQLite::~DatabaseSQLite()': database_driver_sqlite.cpp:(.text+0x20f): undefined reference to sqlite3_close' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionDatabaseSQLite::internalQuery(std::string const&)': database_driver_sqlite.cpp:(.text+0x62c): undefined reference to sqlite3_prepare_v2' database_driver_sqlite.cpp:(.text+0x641): undefined reference tosqlite3_finalize' database_driver_sqlite.cpp:(.text+0x651): undefined reference to sqlite3_errmsg' database_driver_sqlite.cpp:(.text+0x6ba): undefined reference tosqlite3_step' database_driver_sqlite.cpp:(.text+0x6df): undefined reference to sqlite3_finalize' database_driver_sqlite.cpp:(.text+0x6ef): undefined reference tosqlite3_errmsg' database_driver_sqlite.cpp:(.text+0x755): undefined reference to sqlite3_finalize' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionDatabaseSQLite::internalSelectQuery(std::string const&)': database_driver_sqlite.cpp:(.text+0x86d): undefined reference to sqlite3_prepare_v2' database_driver_sqlite.cpp:(.text+0x886): undefined reference tosqlite3_finalize' database_driver_sqlite.cpp:(.text+0x899): undefined reference to sqlite3_errmsg' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionDatabaseSQLite::getLastInsertedRowID()': database_driver_sqlite.cpp:(.text+0xa7e): undefined reference to sqlite3_last_insert_rowid' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionDatabaseSQLite::escapeString(std::string const&)': database_driver_sqlite.cpp:(.text+0xb34): undefined reference to sqlite3_snprintf' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionSQLiteResult::getDataInt(std::string const&)': database_driver_sqlite.cpp:(.text+0xd81): undefined reference to sqlite3_column_int' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionSQLiteResult::getDataUInt(std::string const&)': database_driver_sqlite.cpp:(.text+0xe45): undefined reference to sqlite3_column_int64' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionSQLiteResult::getDataLong(std::string const&)': database_driver_sqlite.cpp:(.text+0xf09): undefined reference to sqlite3_column_int64' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionSQLiteResult::getDataString(std::string const&)': database_driver_sqlite.cpp:(.text+0xfde): undefined reference to sqlite3_column_text' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionSQLiteResult::getDataStream(std::string const&, unsigned long&)': database_driver_sqlite.cpp:(.text+0x1143): undefined reference to sqlite3_column_blob' database_driver_sqlite.cpp:(.text+0x116a): undefined reference tosqlite3_column_bytes' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In function SQLiteResult::advance()': database_driver_sqlite.cpp:(.text+0x11e4): undefined reference tosqlite3_step' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In function SQLiteResult::SQLiteResult(sqlite3_stmt*)': database_driver_sqlite.cpp:(.text+0x12a2): undefined reference tosqlite3_column_count' database_driver_sqlite.cpp:(.text+0x12cf): undefined reference to sqlite3_column_name' CMakeFiles/otserv.dir/database_driver_sqlite.cpp.o: In functionSQLiteResult::~SQLiteResult()': database_driver_sqlite.cpp:(.text+0x13a7): undefined reference to `sqlite3_finalize'

iryont commented 10 years ago

Sklonuj serwer na nowo - tam już dodałem support MySQL + SQLite.

fervi commented 10 years ago

Działa, dam ci spokój na jakiś czas, byś ode mnie odpoczął, bo od paru dni nic nie robisz :D [tzn. poprawiasz kod]