summaryrefslogtreecommitdiff
path: root/src/dal
AgeCommit message (Collapse)AuthorFilesLines
2013-04-27Use nullptr instead of NULL everywhereErik Schilling2-3/+3
2013-01-09Replaced 'unsigned int' with 'unsigned'Thorbjørn Lindeijer5-25/+25
Same thing, but shorter.
2012-03-26Some general cleanups and merged Being::perform() into update()Thorbjørn Lindeijer2-15/+13
The main change here is to remove the separate calling of 'perform' on all beings, and rather rely on the beings to do whatever they were doing in that function when the virtual 'update' function is called. Reviewed-by: Yohann Ferreira
2012-03-13SQLite: Fixed SqLiteDataProvider::processSql handling of multiple rowsThorbjørn Lindeijer1-5/+7
When a prepared SQL statement would have returned multiple rows, this function would try to set the column header names multiple times which throws the AlreadySetException. Currently it doesn't seem that any prepared statements are meant to return multiple rows. Reviewed-by: Yohann Ferreira
2012-03-04SQLite: Added a timeout for trying to acquire a database lockThorbjørn Lindeijer1-0/+4
Without a timeout, trying to write to a locked database fails immediately. Now it will only fail when it can't retrieve a write lock within a second. Still, we need to go through all the SQLite code some time, since there is a lot of error handling missing. We also need to make sure that errors are handled correctly on the higher level. Reviewed-by: Yohann Ferreira
2011-03-17Micro-optimizations related to std::stringThorbjørn Lindeijer4-7/+7
* Rely on the fact that a std::string is empty by default * Use std::string::empty() rather than comparing to "" * Construct with std::string() rather than from "" Reviewed-by: Bertram
2011-03-12Removed a bunch of silly documentationThorbjørn Lindeijer12-117/+5
A C++ developer should be able to recognize a constructor and a destructor by just looking at it, so let's stop writing down the obvious. :)
2010-11-14Fix a potential memleak related to binds when disconnecting with MySQL.Yohann Ferreira2-5/+16
Trivial fix.
2010-11-14Simplified the use of binding when using MySQL.Yohann Ferreira2-47/+82
This permits to avoid a memleak with the former vector form and to use the 'place' variable when binding. The badly prepared statements are also a bit better handled now. With this patch, IMHO, the MySQL support is in shape. Reviewed-by: Jaxad0127.
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira2-2/+2
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.
2010-11-10Fix code indentation in the sql related files.Yohann Ferreira4-71/+70
Trivial fix.
2010-11-02Trivial code convention fix, promised to thorbjorn ;)Yohann Ferreira1-2/+4
2010-10-30Have the PerformTransaction class automatically handle nestingThorbjørn Lindeijer5-14/+74
No need to fiddle around with "startTransaction" booleans now that the helper class is a little more intelligent. When the database is already performing a transaction, no new one will be started.
2010-10-30Introduced a helper class for performing transactionsThorbjørn Lindeijer2-0/+42
Avoids having to remember to call rollbackTransaction and makes transactions exception-safe (since the destructor of PerformTransaction will be called when an exception is thrown).
2010-02-07Update Copyright date for Manaserv.Bertram13-13/+13
2010-01-10Fixing the mysql backend and the mysql createTables scriptBlue2-1/+167
Implementing the prepared statements in mysql backend
2009-12-06Moved DALStorage documentation into source fileThorbjørn Lindeijer2-21/+6
Some methods were documented twice. Stuff moved to source file since this keeps the header more readable, and makes it easier to keep the documentation up to date with the implementation. Also, my IDE jumps to the definition when navigating. Removed two methods that were without an implementation.
2009-12-06Removed obsolete commented out code from DALStorageThorbjørn Lindeijer1-17/+0
2009-12-06Fixed name of the project in copyright headersThorbjørn Lindeijer13-171/+170
Also updated the headers to refer to the GPL by URL instead of suggesting to contact the FSF by snail mail, as per the latest GPL usage instructions.
2009-12-06Removed "TMW" and "TMWSERV" from header guardsThorbjørn Lindeijer7-21/+21
2009-12-06A host of code style changesThorbjørn Lindeijer13-275/+130
Removed pointless void in method parameter lists, fixed methods and variables that started with upper case, removed pointless 'const' for stuff passed by value, made some getters const, etc.
2009-10-24Rebranding tmwserv to manaservThorbjørn Lindeijer2-4/+4
Includes a database update. Use update_6_to_7.sql to update existing sqlite databases.
2009-09-15Fixed crash when column value is a real NULL value instead of empty string.Andreas Habel1-1/+3
2009-07-10Changed BindInteger and BindString to BindValueDavid Athay3-29/+10
2009-07-10Changed database to using prepared statements, to stop SQL injection attacksDavid Athay4-7/+128
2009-05-24Fixed a few code style issuesBjørn Lindeijer1-2/+2
Also renamed Guild::totalMembers to Guild::memberCount
2009-05-01Mysql backend, lua and NPC handlerBlue1-8/+8
Fix for mysql backend (again) Lua modification for integer and string ask with NPC, and closing fix.
2009-04-19Mysql Backend Update mysql database to version 3 Fixed compile error with ↵Blue1121-0/+1
mysql backend
2008-11-18Fixed spellingDavid Athay1-1/+1
2008-11-16Got rid of CVS/Subversion $Id$ markersBjørn Lindeijer13-33/+0
2008-11-05* Account server now loads item database on startup and synchronizes ↵Andreas Habel3-1/+25
tmw_items table in the database. * Added method to DataProvider to escape quotes in strings so that they can be used in SQL statements.
2008-10-24Fixed a bug when trying to change password or mailaddress via client, caused ↵Andreas Habel1-0/+2
by nested transactions. Fixed deletion of characters which left over garbage in sqlite.
2008-10-21Add limits.h where needed.Dennis Friis1-0/+1
2008-09-17* Added installation scripts to set up database schemas for mysql, sqlite ↵Andreas Habel5-41/+518
and postgresql. The create table statements have been completely removed out from the c++ source into separate, provider specific sql files. Accountserver will no longer create a sqlite file if none present. * Added database specific config parameters to configure each provider independent. * Simplified the connect routine of DALStorage class since every dataprovider is now responsible to retrieve its own parameters. * Extended abstract dataprovider to support transactions, functionally implemented for SQLite and mySQL. * Added methods to retrieve last inserted auto-increment value and the number of modified rows by the last statement. * Rewrite of DALStorage class to be a little more transactional. * Fixed a bug when deleting a character. Old function left data in quests table and guilds table. * Doxygen now also includes non-documented functions and provides a dictionary for all classes
2008-01-28Added weapon skill system and leveling system.Philipp Sehmisch1-0/+4
2007-10-27Made it compile with GCC 4.3Guillaume Melquiond1-3/+4
2007-08-13Deleted obsolete files. Cleaned configuration. Removed obsolete SQL tables.Guillaume Melquiond3-8/+4
2007-02-27Implementation of chat channels by Trapdoor.Philipp Sehmisch3-1/+10
2006-08-04Strengthened checks for already existing character name or email address.Guillaume Melquiond1-10/+0
2006-07-27First step toward a restructured class hierarchy for world actors: addGuillaume Melquiond13-58/+0
MovingObject and Player classes.
2006-03-06Cleaned up unnecessary header dependencies and fixed some indentations.Björn Steinbrink9-25/+11
2005-10-23Grammar Corrections, and a little bit of work on getting the name of the Db.Yohann Ferreira5-0/+30
2005-06-30Fixed memory leak, implemented delAccount() + unit tests and now using ↵Huynh Tran1-1/+4
reference-counted smart pointers to facilitate the memory management.
2005-06-29Fixed wrong memory deallocation.Huynh Tran1-2/+2
2005-06-28Fixed bugs and added new unit tests.Huynh Tran1-4/+1
2005-06-28Recommitted changes for new PostgreSQL defines.Aaron Marks1-2/+2
2005-06-21Reorganized unit tests and initial release of the unit tests for the Storage ↵Huynh Tran5-832/+4
class (to be completed).
2005-06-21Fixed memory leak.Huynh Tran1-1/+7
2005-06-21Made sure that pointers are initalized and reset to null after deallocation ↵Huynh Tran6-104/+129
and some reformatting.
2005-06-19Correcting indent and removing obsoleted files.Bjørn Lindeijer3-52/+52