summaryrefslogtreecommitdiff
path: root/src/accounthandler.cpp
diff options
context:
space:
mode:
authorAaron Marks <nymacro@gmail.com>2005-07-16 10:00:53 +0000
committerAaron Marks <nymacro@gmail.com>2005-07-16 10:00:53 +0000
commitce87adec648c69af2313e6077dad467d9ca8af3f (patch)
treef74727012cd5f1f646e4b75c7a8c47c80424af4c /src/accounthandler.cpp
parent34e887895276242efaf2e0b5f1700c1ab1d6b3db (diff)
downloadmanaserv-ce87adec648c69af2313e6077dad467d9ca8af3f.tar.gz
manaserv-ce87adec648c69af2313e6077dad467d9ca8af3f.tar.bz2
manaserv-ce87adec648c69af2313e6077dad467d9ca8af3f.tar.xz
manaserv-ce87adec648c69af2313e6077dad467d9ca8af3f.zip
Added chat message handler placeholder (still not fully functional).
Updated PostgreSQL SQL support - although there is still problem with primary key being initialized to null. Updated message enumeration.
Diffstat (limited to 'src/accounthandler.cpp')
-rw-r--r--src/accounthandler.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/accounthandler.cpp b/src/accounthandler.cpp
index 266dfddf..84f1c553 100644
--- a/src/accounthandler.cpp
+++ b/src/accounthandler.cpp
@@ -40,17 +40,13 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
{
int result = 0;
- // strip message type byte
- message.readByte();
-
Storage &store = Storage::instance("tmw");
- // get message type
char type = message.readByte();
switch(type)
{
- case MSG_ACCOUNT_LOGIN:
+ case CMSG_LOGIN:
{
std::string username = message.readString();
std::string password = message.readString();
@@ -73,7 +69,7 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
std::cout << "Login OK by " << username << std::endl;
} break;
- case MSG_ACCOUNT_REGISTER:
+ case CMSG_REGISTER:
{
std::string username = message.readString();
std::string password = message.readString();
@@ -86,12 +82,18 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
store.flush(); // flush changes
} break;
+ case CMSG_CHAR_CREATE:
+ {
+ std::string name = message.readString();
+ // TODO: Finish this message type (should a player customize stats
+ // slightly?)
+ } break;
+
default:
std::cout << "Invalid message type" << std::endl;
break;
}
-
debugCatch(result);
}