summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-07-26 07:30:12 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-07-26 07:30:12 +0000
commit4b04c501e2391c9226595679c064510c6ea2e94c (patch)
treea67813e640cfe61c8c3e8ec95c40cd0c3c2b014e /src/main.cpp
parente6d8d2dd8eff63c23f0ffad25c5e2529bde93485 (diff)
downloadmana-client-4b04c501e2391c9226595679c064510c6ea2e94c.tar.gz
mana-client-4b04c501e2391c9226595679c064510c6ea2e94c.tar.bz2
mana-client-4b04c501e2391c9226595679c064510c6ea2e94c.tar.xz
mana-client-4b04c501e2391c9226595679c064510c6ea2e94c.zip
Removed char server selection dialog, and added character visualization in character selection dialog.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp41
1 files changed, 2 insertions, 39 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ca70b0dc..deca661c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -56,7 +56,6 @@
#endif
#include "sound.h"
-#include "gui/char_server.h"
#include "gui/char_select.h"
#include "gui/connection.h"
#include "gui/gui.h"
@@ -81,16 +80,12 @@
#include "utils/tostring.h"
// Account infos
-char n_server, n_character;
+char n_character;
std::vector<Spriteset *> hairset;
Spriteset *playerset[2];
Graphics *graphics;
-// TODO Anyone knows a good location for this? Or a way to make it non-global?
-class SERVER_INFO;
-SERVER_INFO **server_info;
-
unsigned char state;
std::string errorMessage;
std::string homeDir;
@@ -429,6 +424,7 @@ void accountLogin(Network *network, LoginData *loginData)
logger->log("Username is %s", loginData->username.c_str());
network->connect(loginData->hostname, loginData->port);
network->registerHandler(&loginHandler);
+ loginHandler.setCharInfo(&charInfo);
loginHandler.setLoginData(loginData);
// Send login infos
@@ -451,24 +447,6 @@ void accountLogin(Network *network, LoginData *loginData)
config.setValue("remember", loginData->remember);
}
-void charLogin(Network *network, LoginData *loginData)
-{
- logger->log("Trying to connect to char server...");
- network->connect(loginData->hostname, loginData->port);
- network->registerHandler(&charServerHandler);
- charServerHandler.setCharInfo(&charInfo);
- charServerHandler.setLoginData(loginData);
-
- // Send login infos
- MessageOut outMsg;
- outMsg.writeShort(0x0065);
- outMsg.writeLong(loginData->account_ID);
- outMsg.writeLong(loginData->session_ID1);
- outMsg.writeLong(loginData->session_ID2);
- outMsg.writeShort(0); // unknown
- outMsg.writeByte(loginData->sex);
-}
-
void mapLogin(Network *network, LoginData *loginData)
{
MessageOut outMsg;
@@ -617,7 +595,6 @@ int main(int argc, char *argv[])
// Those states don't cause a network disconnect
case ACCOUNT_STATE:
- case CHAR_CONNECT_STATE:
case CONNECTING_STATE:
break;
@@ -649,14 +626,6 @@ int main(int argc, char *argv[])
currentDialog = new RegisterDialog(&loginData);
break;
- case CHAR_SERVER_STATE:
- logger->log("State: CHAR_SERVER");
- currentDialog = new ServerSelectDialog(&loginData);
- if (options.chooseDefault) {
- ((ServerSelectDialog*)currentDialog)->action("ok");
- }
- break;
-
case CHAR_SELECT_STATE:
logger->log("State: CHAR_SELECT");
currentDialog = new CharSelectDialog(network, &charInfo,
@@ -700,11 +669,6 @@ int main(int argc, char *argv[])
currentDialog = new ConnectionDialog();
break;
- case CHAR_CONNECT_STATE:
- printf("Char: %i\n", loginData.sex);
- charLogin(network, &loginData);
- break;
-
case ACCOUNT_STATE:
printf("Account: %i\n", loginData.sex);
accountLogin(network, &loginData);
@@ -717,7 +681,6 @@ int main(int argc, char *argv[])
}
}
- network->disconnect();
delete network;
enet_deinitialize();