diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/accounthandler.cpp | 19 | ||||
-rw-r--r-- | src/client.cpp | 9 | ||||
-rw-r--r-- | tmwserv.cbp | 414 |
4 files changed, 436 insertions, 12 deletions
@@ -1,3 +1,9 @@ +2006-07-26 Eugenio Favalli <elvenprogrammer@gmail.com> + + * src/accounthandler.cpp, src/client.cpp, tmwserv.cbp: Send some + character's infos after a successful login, removed a useless byte, + added Code::Blocks project file. + 2006-07-13 Eugenio Favalli <elvenprogrammer@gmail.com> * tmwserv.dev: Updated Dev-C++ project file. diff --git a/src/accounthandler.cpp b/src/accounthandler.cpp index 7d49c3df..885fd7ff 100644 --- a/src/accounthandler.cpp +++ b/src/accounthandler.cpp @@ -224,15 +224,15 @@ void AccountHandler::processMessage(NetComputer *comp, MessageIn &message) result.writeByte(chars.size()); LOG_INFO(username << "'s account has " << chars.size() << " character(s).", 1); - std::string charNames = ""; for (unsigned int i = 0; i < chars.size(); i++) { result.writeString(chars[i]->getName()); - if (i >0) charNames += ", "; - charNames += chars[i]->getName(); + result.writeByte(unsigned(short(chars[i]->getGender()))); + result.writeByte(chars[i]->getHairStyle()); + result.writeByte(chars[i]->getHairColor()); + result.writeByte(chars[i]->getLevel()); + result.writeShort(chars[i]->getMoney()); } - charNames += "."; - LOG_INFO(charNames.c_str(), 1); } break; @@ -445,7 +445,7 @@ void AccountHandler::processMessage(NetComputer *comp, MessageIn &message) newPassword.length() > MAX_PASSWORD_LENGTH ) { result.writeByte(ERRMSG_INVALID_ARGUMENT); - LOG_INFO(computer.getAccount()->getName() << + LOG_INFO(computer.getAccount()->getName() << ": New password too long or too short.", 1); } else if (stringFilter->findDoubleQuotes(newPassword)) @@ -456,14 +456,14 @@ void AccountHandler::processMessage(NetComputer *comp, MessageIn &message) else if ( oldPassword != computer.getAccount()->getPassword() ) { result.writeByte(ERRMSG_FAILURE); - LOG_INFO(computer.getAccount()->getName() << + LOG_INFO(computer.getAccount()->getName() << ": Old password is wrong.", 1); } else { computer.getAccount()->setPassword(newPassword); result.writeByte(ERRMSG_OK); - LOG_INFO(computer.getAccount()->getName() << + LOG_INFO(computer.getAccount()->getName() << ": The password was changed.", 1); } } @@ -627,7 +627,7 @@ void AccountHandler::processMessage(NetComputer *comp, MessageIn &message) (int)config.getValue("startY", 0)); computer.getAccount()->addCharacter(newCharacter); - LOG_INFO("Character " << name << " was created for " + LOG_INFO("Character " << name << " was created for " << computer.getAccount()->getName() << "'s account.", 1); store.flush(); // flush changes @@ -738,7 +738,6 @@ void AccountHandler::processMessage(NetComputer *comp, MessageIn &message) std::string mapName; for (unsigned int i = 0; i < chars.size(); i++) { - result.writeByte(i); result.writeString(chars[i]->getName()); if (i > 0) charStats += ", "; charStats += chars[i]->getName(); diff --git a/src/client.cpp b/src/client.cpp index 4ee33385..34a050ab 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -446,7 +446,13 @@ void parsePacket(char *data, int recvLength) { std::cout << "Account has " << int(charNumber) << " characters." << std::endl; for (unsigned int i = 0; i < charNumber; i++) { if (i >0) std::cout << ", "; + // Write name, ignore other values std::cout << msg.readString(); + msg.readByte(); + msg.readByte(); + msg.readByte(); + msg.readByte(); + msg.readShort(); } std::cout << "." << std::endl; break; @@ -636,8 +642,7 @@ void parsePacket(char *data, int recvLength) { << std::endl; char charID; for (unsigned int i = 0; i < charNumber; i++) { - charID = msg.readByte(); - std::cout << int(charID) << ". " + std::cout << int(i) << ". " << msg.readString() << ":" << std::endl; std::cout << "Gender: " << int(msg.readByte()) << ", "; std::cout << "Hair Style: " << int(msg.readByte()) << ", "; diff --git a/tmwserv.cbp b/tmwserv.cbp new file mode 100644 index 00000000..22cba008 --- /dev/null +++ b/tmwserv.cbp @@ -0,0 +1,414 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="4" /> + <Project> + <Option title="tmwserv" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="default"> + <Option output="tmwserv.exe" /> + <Option object_output="src\obj" /> + <Option type="1" /> + <Option compiler="gcc" /> + </Target> + </Build> + <Compiler> + <Add option="-DSQLITE_SUPPORT" /> + </Compiler> + <Linker> + <Add option="-mconsole" /> + <Add option="-mwindows" /> + <Add library="mingw32" /> + <Add library="enet" /> + <Add library="ws2_32" /> + <Add library="sqlite3" /> + <Add library="xml2" /> + <Add library="physfs" /> + <Add library="pthreadGC2" /> + <Add library="z" /> + <Add library="winmm" /> + </Linker> + <Unit filename="src\account.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\account.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\accounthandler.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\accounthandler.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\being.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\being.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\chatchannel.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\chatchannel.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\chatchannelmanager.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\chatchannelmanager.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\chathandler.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\chathandler.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\configuration.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\configuration.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\connectionhandler.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\connectionhandler.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\dalexcept.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\dataprovider.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\dataprovider.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\dataproviderfactory.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\dataproviderfactory.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\recordset.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\recordset.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\sqlitedataprovider.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dal\sqlitedataprovider.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dalstorage.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dalstorage.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\dalstoragesql.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\debug.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\debug.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\defines.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\gamehandler.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\gamehandler.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\items.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\items.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\main.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\map.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\map.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\mapmanager.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\mapmanager.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\mapreader.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\mapreader.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\messagein.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\messagein.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\messageout.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\messageout.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\netcomputer.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\netcomputer.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\object.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\object.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\packet.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\packet.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\resourcemanager.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\resourcemanager.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\script.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\script.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\skill.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\skill.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\state.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\state.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\storage.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\storage.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\base64.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\base64.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\countedptr.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\functors.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\logger.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\logger.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\singleton.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\stringfilter.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\stringfilter.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\timer.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\timer.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\wingettimeofday.cpp"> + <Option compilerVar="CPP" /> + <Option target="default" /> + </Unit> + <Unit filename="src\utils\wingettimeofday.h"> + <Option compilerVar="CPP" /> + <Option compile="0" /> + <Option link="0" /> + <Option target="default" /> + </Unit> + <Extensions /> + </Project> +</CodeBlocks_project_file>
\ No newline at end of file |