diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 16 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.h | 18 |
2 files changed, 16 insertions, 18 deletions
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 80dc461f5..ce6fa0e14 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -88,7 +88,7 @@ void GameHandler::handleMessage(Net::MessageIn &msg) BLOCK_END("GameHandler::handleMessage") } -void GameHandler::mapLoadedEvent() +void GameHandler::mapLoadedEvent() const { MessageOut outMsg(CMSG_MAP_LOADED); } @@ -99,10 +99,8 @@ void GameHandler::connect() return; mNetwork->connect(mapServer); - - const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); - + const Token &token = static_cast<LoginHandler*>( + Net::getLoginHandler())->getToken(); if (Client::getState() == STATE_CONNECT_GAME) { @@ -137,7 +135,7 @@ void GameHandler::connect() mNetwork->skip(4); } -bool GameHandler::isConnected() +bool GameHandler::isConnected() const { if (!mNetwork) return false; @@ -150,18 +148,18 @@ void GameHandler::disconnect() mNetwork->disconnect(); } -void GameHandler::quit() +void GameHandler::quit() const { MessageOut outMsg(CMSG_CLIENT_QUIT); } -void GameHandler::ping(int tick) +void GameHandler::ping(const int tick) const { MessageOut msg(CMSG_CLIENT_PING); msg.writeInt32(tick); } -void GameHandler::disconnect2() +void GameHandler::disconnect2() const { MessageOut outMsg(CMSG_CLIENT_DISCONNECT); } diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index 5ce70fbca..9a63ddaf4 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -40,23 +40,23 @@ class GameHandler final : public MessageHandler, public Ea::GameHandler A_DELETE_COPY(GameHandler) - void handleMessage(Net::MessageIn &msg); + void handleMessage(Net::MessageIn &msg) override; - void connect(); + void connect() override; - bool isConnected() A_WARN_UNUSED; + bool isConnected() const override A_WARN_UNUSED; - void disconnect(); + void disconnect() override; - void quit(); + void quit() const override; - void ping(int tick); + void ping(const int tick) const override; - void disconnect2(); + void disconnect2() const override; - void mapLoadedEvent(); + void mapLoadedEvent() const override; - bool mustPing() const A_WARN_UNUSED + bool mustPing() const override A_WARN_UNUSED { return false; } }; |