From a387dc5d5230af3a9d0d784b946de7fd05a14416 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 15 Jun 2011 16:07:34 -0700 Subject: Remove useless ping packet The comment in game.cpp about the server waiting for this is a lie. Reviewed-by: Bertram. --- src/net/gamehandler.h | 2 -- src/net/manaserv/gamehandler.cpp | 5 ----- src/net/manaserv/gamehandler.h | 2 -- src/net/tmwa/gamehandler.cpp | 12 ------------ src/net/tmwa/gamehandler.h | 2 -- src/net/tmwa/protocol.h | 2 -- 6 files changed, 25 deletions(-) (limited to 'src/net') diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h index 0c5d889f..2c430033 100644 --- a/src/net/gamehandler.h +++ b/src/net/gamehandler.h @@ -41,8 +41,6 @@ class GameHandler virtual void quit() = 0; - virtual void ping(int tick) = 0; - virtual bool removeDeadBeings() const = 0; /** diff --git a/src/net/manaserv/gamehandler.cpp b/src/net/manaserv/gamehandler.cpp index 63f84fd1..e9c2442a 100644 --- a/src/net/manaserv/gamehandler.cpp +++ b/src/net/manaserv/gamehandler.cpp @@ -127,11 +127,6 @@ void GameHandler::quit(bool reconnectAccount) gameServerConnection->send(msg); } -void GameHandler::ping(int tick) -{ - // TODO -} - void GameHandler::gameLoading() { MessageOut msg(PGMSG_CONNECT); diff --git a/src/net/manaserv/gamehandler.h b/src/net/manaserv/gamehandler.h index 2e9f37fe..10f9d5ff 100644 --- a/src/net/manaserv/gamehandler.h +++ b/src/net/manaserv/gamehandler.h @@ -48,8 +48,6 @@ class GameHandler : public MessageHandler, public Net::GameHandler void quit() { quit(false); } - void ping(int tick); - bool removeDeadBeings() const { return false; } void clear(); diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 2194c77d..8ba2e200 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -49,7 +49,6 @@ GameHandler::GameHandler() { static const Uint16 _messages[] = { SMSG_MAP_LOGIN_SUCCESS, - SMSG_SERVER_PING, SMSG_WHO_ANSWER, SMSG_CHAR_SWITCH_RESPONSE, SMSG_MAP_QUIT_RESPONSE, @@ -80,11 +79,6 @@ void GameHandler::handleMessage(Net::MessageIn &msg) mTileX = x; mTileY = y; } break; - case SMSG_SERVER_PING: - // We ignore this for now - // int tick = msg.readInt32() - break; - case SMSG_WHO_ANSWER: SERVER_NOTICE(strprintf(_("Online users: %d"), msg.readInt32())) break; @@ -177,12 +171,6 @@ void GameHandler::quit() MessageOut outMsg(CMSG_CLIENT_QUIT); } -void GameHandler::ping(int tick) -{ - MessageOut msg(CMSG_CLIENT_PING); - msg.writeInt32(tick); -} - void GameHandler::setMap(const std::string map) { mMap = map.substr(0, map.rfind(".")); diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index 016df18e..04e0a087 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -53,8 +53,6 @@ class GameHandler : public MessageHandler, public Net::GameHandler, void quit(); - void ping(int tick); - bool removeDeadBeings() const { return true; } void clear(); diff --git a/src/net/tmwa/protocol.h b/src/net/tmwa/protocol.h index d7cb81e5..0624ad2f 100644 --- a/src/net/tmwa/protocol.h +++ b/src/net/tmwa/protocol.h @@ -66,7 +66,6 @@ static const int STORAGE_OFFSET = 1; *********************************/ #define SMSG_SERVER_VERSION_RESPONSE 0x7531 -#define SMSG_SERVER_PING 0x007f /**< Contains server tick */ #define SMSG_CONNECTION_PROBLEM 0x0081 #define SMSG_UPDATE_HOST 0x0063 /**< Custom update host packet */ @@ -224,7 +223,6 @@ static const int STORAGE_OFFSET = 1; #define CMSG_CHAR_DELETE 0x0068 #define CMSG_MAP_SERVER_CONNECT 0x0072 -#define CMSG_CLIENT_PING 0x007e /**< Send to server with tick */ #define CMSG_MAP_LOADED 0x007d #define CMSG_CLIENT_QUIT 0x018A -- cgit v1.2.3-70-g09d2