summaryrefslogtreecommitdiff
path: root/src/chat-server/post.hpp
diff options
context:
space:
mode:
authorAndreas Habel <mail@exceptionfault.de>2008-11-03 09:57:00 +0000
committerAndreas Habel <mail@exceptionfault.de>2008-11-03 09:57:00 +0000
commitbf90aef80fb828f8c9253647b98a49d5dded0a3a (patch)
tree7df6051b01633a5595fd727b96c17f1dde902701 /src/chat-server/post.hpp
parentde6575cd162c41e3ced8cff7c7d3e34041da0d56 (diff)
downloadmanaserv-bf90aef80fb828f8c9253647b98a49d5dded0a3a.tar.gz
manaserv-bf90aef80fb828f8c9253647b98a49d5dded0a3a.tar.bz2
manaserv-bf90aef80fb828f8c9253647b98a49d5dded0a3a.tar.xz
manaserv-bf90aef80fb828f8c9253647b98a49d5dded0a3a.zip
Added tables and statements to store and retrieve letters. Attachments not functional as long as items not stored as individual items.
Diffstat (limited to 'src/chat-server/post.hpp')
-rw-r--r--src/chat-server/post.hpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/chat-server/post.hpp b/src/chat-server/post.hpp
index 25aefb50..f2ec6b7f 100644
--- a/src/chat-server/post.hpp
+++ b/src/chat-server/post.hpp
@@ -37,17 +37,39 @@ class Letter
{
public:
/**
- * Constructor
+ * Constructor.
+ *
+ * Before the letter is stored in the database, the unique Id of the letter
+ * is 0.
* @param type Type of Letter - unused
* @param sender Pointer to character that sent the letter
* @param receiver Pointer to character that will receive the letter
*/
- Letter(int type, Character *sender, Character *receiver);
+ Letter(unsigned int type, Character *sender, Character *receiver);
/**
* Destructor
*/
~Letter();
+
+ /**
+ * Gets the unique Id of the letter.
+ */
+ unsigned long getId() const
+ { return mId; }
+
+ /**
+ * Sets the unique Id of the letter used as primary key in the database.
+ * @param Id Unique id of the letter.
+ */
+ void setId(unsigned long Id)
+ { mId = Id; }
+
+ /**
+ * Gets the type of the letter. (unused)
+ */
+ unsigned int getType(void) const
+ { return mType; }
/**
* Set the expiry
@@ -97,6 +119,7 @@ public:
std::vector<InventoryItem> getAttachments();
private:
+ unsigned int mId;
unsigned int mType;
unsigned long mExpiry;
std::string mContents;