From 4916370e6130bfee7eb9ae486f03391d2214ecf4 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Thu, 2 Apr 2009 21:25:25 -0600 Subject: Make eAthena's CharHandler Also add ping to MapHandler and fill in eAthena's MapHandler's connect method. --- src/gui/char_select.cpp | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'src/gui/char_select.cpp') diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index bf885de9..595d6043 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -43,6 +43,9 @@ #include "net/ea/charserverhandler.h" #endif +#include "net/charhandler.h" +#include "net/net.h" + #include "gui/widgets/layout.h" #include "game.h" @@ -342,25 +345,22 @@ void CharSelectDialog::updatePlayerInfo() void CharSelectDialog::attemptCharDelete() { + // Net::getCharHandler()->deleteCharacter(mCharInfo->getPos(), mCharInfo->getEntry()); #ifdef TMWSERV_SUPPORT Net::AccountServer::Account::deleteCharacter(mCharInfo->getPos()); #else - // Request character deletion - MessageOut outMsg(0x0068); - outMsg.writeInt32(mCharInfo->getEntry()->mCharId); - outMsg.writeString("a@a.com", 40); + charHandler->deleteCharacter(mCharInfo->getPos(), mCharInfo->getEntry()); #endif mCharInfo->lock(); } void CharSelectDialog::attemptCharSelect() { + // Net::getCharHandler()->chooseCharacter(mCharInfo->getPos(), mCharInfo->getEntry()); #ifdef TMWSERV_SUPPORT Net::AccountServer::Account::selectCharacter(mCharInfo->getPos()); #else - // Request character selection - MessageOut outMsg(0x0066); - outMsg.writeInt8(mCharInfo->getPos()); + charHandler->chooseCharacter(mCharInfo->getPos(), mCharInfo->getEntry()); #endif mCharInfo->lock(); } @@ -582,7 +582,8 @@ void CharCreateDialog::action(const gcn::ActionEvent &event) (int) mAttributeSlider[5]->getValue() // WILL ); #else - attemptCharCreate(); + charHandler->newCharacter(getName(), mSlot, false, + mPlayer->getHairStyle(), mPlayer->getHairColor()); #endif } else @@ -681,21 +682,3 @@ int CharCreateDialog::getDistributedPoints() return points; } #endif - -#ifndef TMWSERV_SUPPORT -void CharCreateDialog::attemptCharCreate() -{ - // Send character infos - MessageOut outMsg(0x0067); - outMsg.writeString(getName(), 24); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(5); - outMsg.writeInt8(mSlot); - outMsg.writeInt16(mPlayer->getHairColor()); - outMsg.writeInt16(mPlayer->getHairStyle()); -} -#endif -- cgit v1.2.3-70-g09d2