summaryrefslogtreecommitdiff
path: root/src/account-server
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-03-06 16:12:14 +0000
committerDavid Athay <ko2fan@gmail.com>2009-03-06 16:12:14 +0000
commit3aabbb7ae82c818f584d95460181f70e05d41f32 (patch)
treeb4be67c52cac4e4633e719226eff3ba451e4e001 /src/account-server
parent6f60667b2671104365c7fcfa7866064e04d50156 (diff)
downloadmanaserv-3aabbb7ae82c818f584d95460181f70e05d41f32.tar.gz
manaserv-3aabbb7ae82c818f584d95460181f70e05d41f32.tar.bz2
manaserv-3aabbb7ae82c818f584d95460181f70e05d41f32.tar.xz
manaserv-3aabbb7ae82c818f584d95460181f70e05d41f32.zip
Added transactional history to game server.
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/accounthandler.cpp2
-rw-r--r--src/account-server/dalstorage.hpp4
-rw-r--r--src/account-server/serverhandler.cpp15
-rw-r--r--src/account-server/transaction.hpp48
4 files changed, 18 insertions, 51 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index a1280e35..425a42ac 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -28,9 +28,9 @@
#include "account-server/character.hpp"
#include "account-server/dalstorage.hpp"
#include "account-server/serverhandler.hpp"
-#include "account-server/transaction.hpp"
#include "chat-server/chathandler.hpp"
#include "common/configuration.hpp"
+#include "common/transaction.hpp"
#include "net/connectionhandler.hpp"
#include "net/messagein.hpp"
#include "net/messageout.hpp"
diff --git a/src/account-server/dalstorage.hpp b/src/account-server/dalstorage.hpp
index 131cf819..8ff796af 100644
--- a/src/account-server/dalstorage.hpp
+++ b/src/account-server/dalstorage.hpp
@@ -25,9 +25,9 @@
#include <map>
#include <vector>
-#include "dal/dataprovider.h"
+#include "../dal/dataprovider.h"
-#include "transaction.hpp"
+#include "../common/transaction.hpp"
class Account;
class Character;
diff --git a/src/account-server/serverhandler.cpp b/src/account-server/serverhandler.cpp
index 23f2cd32..f5409b6a 100644
--- a/src/account-server/serverhandler.cpp
+++ b/src/account-server/serverhandler.cpp
@@ -30,6 +30,7 @@
#include "account-server/character.hpp"
#include "account-server/dalstorage.hpp"
#include "chat-server/post.hpp"
+#include "common/transaction.hpp"
#include "net/connectionhandler.hpp"
#include "net/messageout.hpp"
#include "net/netcomputer.hpp"
@@ -465,6 +466,20 @@ void ServerHandler::processMessage(NetComputer *comp, MessageIn &msg)
result.writeByte(ERRMSG_OK);
} break;
+ case GAMSG_TRANSACTION:
+ {
+ LOG_DEBUG("TRANSACTION");
+ int id = msg.readLong();
+ int action = msg.readLong();
+ std::string message = msg.readString();
+
+ Transaction trans;
+ trans.mCharacterId = id;
+ trans.mAction = action;
+ trans.mMessage = message;
+ storage->addTransaction(trans);
+ } break;
+
default:
LOG_WARN("ServerHandler::processMessage, Invalid message type: "
<< msg.getId());
diff --git a/src/account-server/transaction.hpp b/src/account-server/transaction.hpp
deleted file mode 100644
index fa007dfb..00000000
--- a/src/account-server/transaction.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * The Mana World Server
- * Copyright 2009 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * The Mana World is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or any later version.
- *
- * The Mana World 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 General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with The Mana World; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _TMWSERV_TRANSACTION_H_
-#define _TMWSERV_TRANSACTION_H_
-
-struct Transaction
-{
- unsigned int mAction;
- unsigned int mCharacterId;
- std::string mMessage;
-};
-
-enum
-{
- TRANS_CHAR_CREATE = 1,
- TRANS_CHAR_SELECTED,
- TRANS_CHAR_DELETED,
- TRANS_MSG_PUBLIC,
- TRANS_MSG_ANNOUNCE,
- TRANS_MSG_PRIVATE,
- TRANS_CHANNEL_JOIN,
- TRANS_CHANNEL_KICK,
- TRANS_CHANNEL_MODE,
- TRANS_CHANNEL_QUIT,
- TRANS_CHANNEL_LIST,
- TRANS_CHANNEL_USERLIST,
- TRANS_CHANNEL_TOPIC,
-};
-
-#endif