summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-16 22:35:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-16 22:35:17 +0300
commitb3d17866a3c5700b52c2b0b954fce132a52c1dbf (patch)
tree7ba07c98a1842eb766de35e172f559dcf5ac6fb4 /src/net/tmwa
parent5e8e53f6e795a84ab5ca6cfe0d08672878044707 (diff)
downloadplus-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.gz
plus-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.bz2
plus-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.xz
plus-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.zip
Convert State enum into strong typed.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/charserverrecv.cpp6
-rw-r--r--src/net/tmwa/gamehandler.cpp2
-rw-r--r--src/net/tmwa/gamerecv.cpp2
-rw-r--r--src/net/tmwa/generalhandler.cpp2
-rw-r--r--src/net/tmwa/generalrecv.cpp4
-rw-r--r--src/net/tmwa/loginrecv.cpp8
6 files changed, 12 insertions, 12 deletions
diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp
index f2e1b0943..6c47f5e05 100644
--- a/src/net/tmwa/charserverrecv.cpp
+++ b/src/net/tmwa/charserverrecv.cpp
@@ -177,7 +177,7 @@ void CharServerRecv::processCharLogin(Net::MessageIn &msg)
}
}
- client->setState(STATE_CHAR_SELECT);
+ client->setState(State::CHAR_SELECT);
BLOCK_END("CharServerRecv::processCharLogin")
}
@@ -211,7 +211,7 @@ void CharServerRecv::processCharMapInfo(Net::MessageIn &restrict msg)
if (network)
network->disconnect();
- client->setState(STATE_CONNECT_GAME);
+ client->setState(State::CONNECT_GAME);
BLOCK_END("CharServerRecv::processCharMapInfo")
}
@@ -241,7 +241,7 @@ void CharServerRecv::processChangeMapServer(Net::MessageIn &msg)
server.port = msg.readInt16("port");
network->disconnect();
- client->setState(STATE_CHANGE_MAP);
+ client->setState(State::CHANGE_MAP);
if (localPlayer)
{
localPlayer->setTileCoords(x, y);
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index 7a8628df5..3b6e9bd7e 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -64,7 +64,7 @@ void GameHandler::connect()
Network::mInstance->connect(mapServer);
const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken();
- if (client->getState() == STATE_CONNECT_GAME)
+ if (client->getState() == State::CONNECT_GAME)
{
// Change the player's ID to the account ID to match what eAthena uses
if (localPlayer)
diff --git a/src/net/tmwa/gamerecv.cpp b/src/net/tmwa/gamerecv.cpp
index ba68d9391..f6db8b616 100644
--- a/src/net/tmwa/gamerecv.cpp
+++ b/src/net/tmwa/gamerecv.cpp
@@ -55,7 +55,7 @@ void GameRecv::processMapLogin(Net::MessageIn &msg)
network->pauseDispatch();
// Switch now or we'll have problems
- client->setState(STATE_GAME);
+ client->setState(State::GAME);
if (localPlayer)
localPlayer->setTileCoords(x, y);
}
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 818e2d7a2..8dfdccfbc 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -207,7 +207,7 @@ void GeneralHandler::flushNetwork()
errorMessage = _("Got disconnected from server!");
}
- client->setState(STATE_ERROR);
+ client->setState(State::ERROR);
}
BLOCK_END("GeneralHandler::flushNetwork 3")
}
diff --git a/src/net/tmwa/generalrecv.cpp b/src/net/tmwa/generalrecv.cpp
index 42fc75350..9a87f1446 100644
--- a/src/net/tmwa/generalrecv.cpp
+++ b/src/net/tmwa/generalrecv.cpp
@@ -53,7 +53,7 @@ void GeneralRecv::processConnectionProblem(Net::MessageIn &msg)
errorMessage = _("No servers available.");
break;
case 2:
- if (client->getState() == STATE_GAME)
+ if (client->getState() == State::GAME)
{
// TRANSLATORS: error message
errorMessage = _("Someone else is trying to use this "
@@ -78,7 +78,7 @@ void GeneralRecv::processConnectionProblem(Net::MessageIn &msg)
errorMessage = _("Unknown connection error.");
break;
}
- client->setState(STATE_ERROR);
+ client->setState(State::ERROR);
}
} // namespace TmwAthena
diff --git a/src/net/tmwa/loginrecv.cpp b/src/net/tmwa/loginrecv.cpp
index c6aa48b83..783e5d55c 100644
--- a/src/net/tmwa/loginrecv.cpp
+++ b/src/net/tmwa/loginrecv.cpp
@@ -86,8 +86,8 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg)
if (serverVersion < 5)
{
- if (client->getState() != STATE_LOGIN)
- client->setState(STATE_LOGIN);
+ if (client->getState() != State::LOGIN)
+ client->setState(State::LOGIN);
}
// Leave this last
@@ -101,7 +101,7 @@ void LoginRecv::processCharPasswordResponse(Net::MessageIn &msg)
// Successful pass change
if (errMsg == 1)
{
- client->setState(STATE_CHANGEPASSWORD_SUCCESS);
+ client->setState(State::CHANGEPASSWORD_SUCCESS);
}
// pass change failed
else
@@ -126,7 +126,7 @@ void LoginRecv::processCharPasswordResponse(Net::MessageIn &msg)
errorMessage = _("Unknown error.");
break;
}
- client->setState(STATE_ACCOUNTCHANGE_ERROR);
+ client->setState(State::ACCOUNTCHANGE_ERROR);
}
}