From 7b06428d3a428828d15a758a4abaee14bfad58a9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Apr 2011 00:11:05 +0300 Subject: Add race in char creation dialog. Change client protocol version to 4. --- src/net/charhandler.h | 1 + src/net/manaserv/charhandler.cpp | 2 +- src/net/manaserv/charhandler.h | 1 + src/net/tmwa/charserverhandler.cpp | 4 +++- src/net/tmwa/charserverhandler.h | 1 + src/net/tmwa/network.h | 2 +- 6 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/net') diff --git a/src/net/charhandler.h b/src/net/charhandler.h index cef98dfa1..0cddc62d0 100644 --- a/src/net/charhandler.h +++ b/src/net/charhandler.h @@ -76,6 +76,7 @@ class CharHandler virtual void newCharacter(const std::string &name, int slot, bool gender, int hairstyle, int hairColor, + unsigned char race, const std::vector &stats) = 0; virtual void deleteCharacter(Net::Character *character) = 0; diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index 163aad988..0988fc9a6 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -310,7 +310,7 @@ void CharHandler::newCharacter(const std::string &name, int slot, bool gender, int hairstyle, - int hairColor, + int hairColor, unsigned char race, const std::vector &stats) { MessageOut msg(PAMSG_CHAR_CREATE); diff --git a/src/net/manaserv/charhandler.h b/src/net/manaserv/charhandler.h index 8de582753..ea44ae23e 100644 --- a/src/net/manaserv/charhandler.h +++ b/src/net/manaserv/charhandler.h @@ -63,6 +63,7 @@ class CharHandler : public MessageHandler, public Net::CharHandler void newCharacter(const std::string &name, int slot, bool gender, int hairstyle, int hairColor, + unsigned char race, const std::vector &stats); void deleteCharacter(Net::Character *character); diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 545c36611..7f091bc67 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -408,7 +408,7 @@ void CharServerHandler::chooseCharacter(Net::Character *character) void CharServerHandler::newCharacter(const std::string &name, int slot, bool gender _UNUSED_, int hairstyle, - int hairColor, + int hairColor, unsigned char race, const std::vector &stats) { MessageOut outMsg(CMSG_CHAR_CREATE); @@ -419,6 +419,8 @@ void CharServerHandler::newCharacter(const std::string &name, int slot, outMsg.writeInt8(static_cast(slot)); outMsg.writeInt16(static_cast(hairColor)); outMsg.writeInt16(static_cast(hairstyle)); + if (serverVersion >= 2) + outMsg.writeInt8(race); } void CharServerHandler::deleteCharacter(Net::Character *character) diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h index 9d65639b9..7e843ffec 100644 --- a/src/net/tmwa/charserverhandler.h +++ b/src/net/tmwa/charserverhandler.h @@ -65,6 +65,7 @@ class CharServerHandler : public MessageHandler, public Net::CharHandler void newCharacter(const std::string &name, int slot, bool gender, int hairstyle, int hairColor, + unsigned char race, const std::vector &stats); void deleteCharacter(Net::Character *character); diff --git a/src/net/tmwa/network.h b/src/net/tmwa/network.h index 4a554f9eb..757358c25 100644 --- a/src/net/tmwa/network.h +++ b/src/net/tmwa/network.h @@ -39,7 +39,7 @@ * Protocol version, reported to the eAthena char and mapserver who can adjust * the protocol accordingly. */ -#define CLIENT_PROTOCOL_VERSION 3 +#define CLIENT_PROTOCOL_VERSION 4 #define CLIENT_TMW_PROTOCOL_VERSION 1 namespace TmwAthena -- cgit v1.2.3-70-g09d2