From 6a7e4f64cc802f52e3fc350c88f6571c4913ba6d Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Thu, 29 Dec 2005 20:45:58 +0000 Subject: Restored Dev-Cpp default execution options, updated walkmap in snow map, smoothed login sequence. --- src/gui/connection.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/gui/connection.cpp') diff --git a/src/gui/connection.cpp b/src/gui/connection.cpp index 3cff4abd..c7eb3667 100644 --- a/src/gui/connection.cpp +++ b/src/gui/connection.cpp @@ -86,8 +86,20 @@ void ConnectionDialog::logic() closeConnection(); break; case NET_CONNECTED: - mapLogin(); - state = GAME_STATE; + attemptMapLogin(); + mStatus = NET_DATA; + break; + case NET_DATA: + if (in_size > 6) + { + skip(4); + checkMapLogin(); + state = GAME_STATE; + } + else + { + flush(); + } break; } } @@ -100,7 +112,7 @@ void ConnectionDialog::action(const std::string& eventId) } } -void ConnectionDialog::mapLogin() +void ConnectionDialog::attemptMapLogin() { // Send login infos MessageOut outMsg; @@ -110,11 +122,10 @@ void ConnectionDialog::mapLogin() outMsg.writeInt32(session_ID1); outMsg.writeInt32(session_ID2); outMsg.writeInt8(sex); +} - // Skip a mysterious 4 bytes - while ((in_size < 4)|| (out_size > 0)) flush(); - skip(4); - +void ConnectionDialog::checkMapLogin() +{ MessageIn msg = get_next_message(); if (msg.getId() == SMSG_LOGIN_SUCCESS) -- cgit v1.2.3-70-g09d2