From 3553f1e11f7f4478c4c64192f6455d528c7dffda Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Tue, 28 Dec 2010 00:48:05 +0100 Subject: Made the client handle the characters slots properly for Manaserv. Reviewed-by: Crush. --- src/net/manaserv/charhandler.cpp | 6 +++++- src/net/manaserv/protocol.h | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/net') diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index 6f2b4377..14bf51ed 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -167,6 +167,9 @@ void CharHandler::handleCharacterCreateResponse(Net::MessageIn &msg) Attributes::getAttributeMinimum(), Attributes::getAttributeMaximum()); break; + case CREATE_INVALID_SLOT: + errorMessage = _("Invalid slot number."); + break; default: errorMessage = _("Unknown error."); break; @@ -296,7 +299,7 @@ void CharHandler::chooseCharacter(Net::Character *character) } void CharHandler::newCharacter(const std::string &name, - int /* slot */, + int slot, bool gender, int hairstyle, int hairColor, @@ -308,6 +311,7 @@ void CharHandler::newCharacter(const std::string &name, msg.writeInt8(hairstyle); msg.writeInt8(hairColor); msg.writeInt8(gender); + msg.writeInt8(slot); std::vector::const_iterator it, it_end; for (it = stats.begin(), it_end = stats.end(); it != it_end; it++) diff --git a/src/net/manaserv/protocol.h b/src/net/manaserv/protocol.h index a49b2dd8..2b5efd69 100644 --- a/src/net/manaserv/protocol.h +++ b/src/net/manaserv/protocol.h @@ -53,15 +53,15 @@ enum { APMSG_LOGIN_RESPONSE = 0x0012, // B error, S updatehost, S Client data URL, B Character slots PAMSG_LOGOUT = 0x0013, // - APMSG_LOGOUT_RESPONSE = 0x0014, // B error - PAMSG_CHAR_CREATE = 0x0020, // S name, B hair style, B hair color, B gender, W*6 stats + PAMSG_CHAR_CREATE = 0x0020, // S name, B hair style, B hair color, B gender, B slot, W*6 stats APMSG_CHAR_CREATE_RESPONSE = 0x0021, // B error - PAMSG_CHAR_DELETE = 0x0022, // B index + PAMSG_CHAR_DELETE = 0x0022, // B slot APMSG_CHAR_DELETE_RESPONSE = 0x0023, // B error - // B index, S name, B gender, B hair style, B hair color, W level, + // B slot, S name, B gender, B hair style, B hair color, W level, // W character points, W correction points, // {D attr id, D base value (in 1/256ths) D mod value (in 256ths) }* APMSG_CHAR_INFO = 0x0024, // ^ - PAMSG_CHAR_SELECT = 0x0026, // B index + PAMSG_CHAR_SELECT = 0x0026, // B slot APMSG_CHAR_SELECT_RESPONSE = 0x0027, // B error, B*32 token, S game address, W game port, S chat address, W chat port PAMSG_EMAIL_CHANGE = 0x0030, // S email APMSG_EMAIL_CHANGE_RESPONSE = 0x0031, // B error @@ -307,7 +307,8 @@ enum { CREATE_ATTRIBUTES_TOO_LOW, CREATE_ATTRIBUTES_OUT_OF_RANGE, CREATE_EXISTS_NAME, - CREATE_TOO_MUCH_CHARACTERS + CREATE_TOO_MUCH_CHARACTERS, + CREATE_INVALID_SLOT }; // Character attribute modification specific return value -- cgit v1.2.3-70-g09d2