summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-20 12:18:10 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-20 12:18:10 +0300
commit811b0152c0e3911a58c357ec84fac9f84dbe911a (patch)
tree6658623c25525417918503d8b69c9ebd29bebadd /src/net/tmwa
parent91f1d79f268b657c834c8df2c24368fc6067df81 (diff)
downloadplus-811b0152c0e3911a58c357ec84fac9f84dbe911a.tar.gz
plus-811b0152c0e3911a58c357ec84fac9f84dbe911a.tar.bz2
plus-811b0152c0e3911a58c357ec84fac9f84dbe911a.tar.xz
plus-811b0152c0e3911a58c357ec84fac9f84dbe911a.zip
Add more profiler labels.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/charserverhandler.cpp3
-rw-r--r--src/net/tmwa/gamehandler.cpp4
-rw-r--r--src/net/tmwa/playerhandler.cpp6
3 files changed, 13 insertions, 0 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 64626becb..c4571969e 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -315,6 +315,8 @@ void CharServerHandler::connect()
void CharServerHandler::processCharLogin(Net::MessageIn &msg)
{
+ BLOCK_START("CharServerHandler::processCharLogin")
+
msg.skip(2); // Length word
const int slots = msg.readInt16();
if (slots > 0 && slots < 30)
@@ -346,6 +348,7 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg)
}
Client::setState(STATE_CHAR_SELECT);
+ BLOCK_END("CharServerHandler::processCharLogin")
}
} // namespace TmwAthena
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index c92a83654..62457d718 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -98,6 +98,7 @@ void GameHandler::connect()
if (!mNetwork)
return;
+ BLOCK_START("GameHandler::connect")
mNetwork->connect(mapServer);
const Token &token = static_cast<LoginHandler*>(
Net::getLoginHandler())->getToken();
@@ -133,6 +134,7 @@ void GameHandler::connect()
*/
// We get 4 useless bytes before the real answer comes in (what are these?)
mNetwork->skip(4);
+ BLOCK_END("GameHandler::connect")
}
bool GameHandler::isConnected() const
@@ -144,8 +146,10 @@ bool GameHandler::isConnected() const
void GameHandler::disconnect()
{
+ BLOCK_START("GameHandler::disconnect")
if (mNetwork)
mNetwork->disconnect();
+ BLOCK_END("GameHandler::disconnect")
}
void GameHandler::quit() const
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index b63be0a6d..645959fbc 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -222,6 +222,7 @@ void PlayerHandler::processOnlineList(Net::MessageIn &msg) const
if (!whoIsOnline)
return;
+ BLOCK_START("PlayerHandler::processOnlineList")
const int size = msg.readInt16() - 4;
std::vector<OnlinePlayer*> arr;
@@ -229,12 +230,16 @@ void PlayerHandler::processOnlineList(Net::MessageIn &msg) const
{
if (whoIsOnline)
whoIsOnline->loadList(arr);
+ BLOCK_END("PlayerHandler::processOnlineList")
return;
}
char *const start = reinterpret_cast<char*>(msg.readBytes(size));
if (!start)
+ {
+ BLOCK_END("PlayerHandler::processOnlineList")
return;
+ }
const char *buf = start;
@@ -278,6 +283,7 @@ void PlayerHandler::processOnlineList(Net::MessageIn &msg) const
if (whoIsOnline)
whoIsOnline->loadList(arr);
delete [] start;
+ BLOCK_END("PlayerHandler::processOnlineList")
}
void PlayerHandler::updateStatus(const uint8_t status) const