Commit graph

31 commits

Author SHA1 Message Date
Erik Ogenvik
0fe760a003 Fixed issue with iterating over results.
Didn't work nicely with the way our SQLLite wrapper does it.
2018-06-29 12:25:42 +02:00
Erik Ogenvik
a59f01576c Better error messages. 2018-06-25 21:16:50 +02:00
Erik Ogenvik
b0cf29b18d Use SQLite 3 for persistence.
Instead of storing data in Postgres we store it by default in SQLite,
using an in-process database.
This makes setup and handling much easier.
2018-05-19 21:47:24 +02:00
Erik Ogenvik
4e788e90c7 Separate out Postgres specific parts. 2018-05-16 21:48:18 +02:00
Erik Ogenvik
66baf9c9dc Stor all rules as files only.
We should only store entities and accounts in the database.
2018-05-16 11:22:09 +02:00
Erik Ogenvik
e7fa53214b Use nullptr instead of NULL. 2018-02-06 13:45:11 +01:00
Erik Ogenvik
121130f08b Remove unnecessary assert. 2017-05-27 15:24:36 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Erik Ogenvik
311fc9cd2f Fixed issues with tying accounts to entities.
Since entries in the database tying entities to accounts only can be
created if the entity already is created in the database we need to make
sure the relation in "accounts_entities" isn't created until the entry in
"entities". This is done by letting the StorageManager handle it.
The way to interface between the Persistance and the StorageManager
classes isn't obvious, so we'll have to do it by signals.
2014-09-20 22:13:49 +02:00
Erik Ogenvik
446ff7b16a Fix memory leak with PGResult.
The postgres db result wasn't always deleted as it should. Fix this by
using shared_ptr with a custom Deleter.
2013-09-12 22:12:49 +02:00
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Erik Ogenvik
350fdab3c6 Restored creation of admin account.
But with randomized password.
It's quite useful to have the system create an admin account by default.
By using a randomized password it cannot be used straight away though;
the user needs to use the "cypasswd" command on the server machine to
alter the password to something useful.
2013-06-30 16:54:46 +02:00
Erik Ogenvik
c7f4499385 Remove hard coded admin account.
This isn't needed anymore since we can connect through a local socket
instead if we need admin rights.
2013-06-23 00:49:34 +02:00
Erik Ogenvik
873a6d7ffb Store and restore thoughts.
Currently thoughts are only stored when the server is shut down. A more
proper way would probably be to query character and store their thoughts
at regular intervals while the simulation is running.
2013-04-07 23:20:23 +02:00
Alistair Riddoch
064340b1fc Remove unneeded Entity.h include 2013-01-18 19:47:11 +00:00
Alistair Riddoch
4a9c7078f7 Refactor to use LocatedEntity as base class
All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
2013-01-17 10:17:07 +00:00
Alistair Riddoch
95b078249a Rename database variable for disambiguation 2012-08-13 20:01:27 +01:00
Alistair Riddoch
68494ba520 Use the ruleset global less often, making code more isolated 2012-01-19 19:34:20 +00:00
Alistair Riddoch
5749d72d0e Convert final Database methods 2011-09-29 12:15:43 +01:00
Alistair Riddoch
9f5fc30c5a Convert rule clearing functions 2011-09-29 10:31:41 +01:00
Alistair Riddoch
2d987ba116 Concert Database::getTable and Persistence::getRules 2011-09-29 10:12:00 +01:00
Alistair Riddoch
bc2bf1e3c4 Add a destructor for Database 2011-09-28 23:15:46 +01:00
Alistair Riddoch
7aa394b2ca Converty Database::initRule 2011-09-28 22:54:35 +01:00
Alistair Riddoch
5c4851b9c7 Switch first set of functions
All functions which return error/success should return int according
to the C library convention used in most of cyphesis
2011-09-28 22:32:39 +01:00
Alistair Riddoch
1c79a04701 Start cleaning up the Database API 2011-09-28 22:25:58 +01:00
Manohar Vanga
ba6fb4b9b7 Fixed small bug in Persistence::getAccount() 2010-08-17 11:56:10 +05:30
Alistair Riddoch
2b9eeaacca Make username and password protected, and use accessors. 2009-11-24 13:13:54 +00:00
Alistair Riddoch
9364485967 Add a method to update a rule stored in the database. 2009-11-06 16:22:16 +00:00
Alistair Riddoch
6fea5787ce Add code to storing rules to sort out the file the rules are from. 2009-11-05 22:54:59 +00:00
Alistair Riddoch
75ed7f672c Add a function to load a new single rule into the database. 2009-11-05 17:38:18 +00:00
Alistair Riddoch
ffd019a744 Correct the spelling of persistence. 2009-03-24 03:08:45 +00:00
Renamed from server/Persistance.cpp (Browse further)