diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-11-03 12:06:48 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-11-03 12:06:48 -0700 |
commit | e07e2a6db902f2ce0095b65708a98fa4dbf40aa0 (patch) | |
tree | b91b3e3d3f06199dcc34e32834941964a263e0be /src/net/manaserv/charhandler.cpp | |
parent | e2897e4a7cb7eb0c4a7e46d72a9a19b909368c26 (diff) | |
download | mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.gz mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.bz2 mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.tar.xz mana-e07e2a6db902f2ce0095b65708a98fa4dbf40aa0.zip |
Simplify ManaServ netcode some more
Diffstat (limited to 'src/net/manaserv/charhandler.cpp')
-rw-r--r-- | src/net/manaserv/charhandler.cpp | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index a08799f9..bc7ffaaa 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -22,14 +22,12 @@ #include "net/manaserv/charhandler.h" #include "net/manaserv/connection.h" +#include "net/manaserv/messagein.h" +#include "net/manaserv/messageout.h" #include "net/manaserv/protocol.h" -#include "net/manaserv/accountserver/accountserver.h" -#include "net/manaserv/accountserver/account.h" - #include "net/logindata.h" #include "net/loginhandler.h" -#include "net/messagein.h" #include "net/net.h" #include "game.h" @@ -359,26 +357,39 @@ void CharHandler::getCharacters() void CharHandler::chooseCharacter(int slot, LocalPlayer* character) { - AccountServer::Account::selectCharacter(slot); + MessageOut msg(PAMSG_CHAR_SELECT); + + msg.writeInt8(slot); + + accountServerConnection->send(msg); } void CharHandler::newCharacter(const std::string &name, int slot, bool gender, int hairstyle, int hairColor, std::vector<int> stats) { - AccountServer::Account::createCharacter(name, hairstyle, hairColor, - gender, - stats[0], // STR - stats[1], // AGI - stats[2], // DEX - stats[3], // VIT - stats[4], // INT - stats[5] // WILL - ); + MessageOut msg(PAMSG_CHAR_CREATE); + + msg.writeString(name); + msg.writeInt8(hairstyle); + msg.writeInt8(hairColor); + msg.writeInt8(gender); + msg.writeInt16(stats[0]); + msg.writeInt16(stats[1]); + msg.writeInt16(stats[2]); + msg.writeInt16(stats[3]); + msg.writeInt16(stats[4]); + msg.writeInt16(stats[5]); + + accountServerConnection->send(msg); } void CharHandler::deleteCharacter(int slot, LocalPlayer* character) { - AccountServer::Account::deleteCharacter(slot); + MessageOut msg(PAMSG_CHAR_DELETE); + + msg.writeInt8(slot); + + accountServerConnection->send(msg); } void CharHandler::switchCharacter() |