From bc7f22d39578c0b6e106426905dbd6881ac6e450 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 10 Jan 2012 00:46:20 -0200 Subject: [PATCH] fix map padding, parse rule violations protocol opts --- src/otclient/net/protocolcodes.h | 8 ++++---- src/otclient/net/protocolgame.h | 1 - src/otclient/net/protocolgameparse.cpp | 20 ++++++++++---------- src/otclient/ui/uimap.cpp | 5 +---- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/otclient/net/protocolcodes.h b/src/otclient/net/protocolcodes.h index 941b784d..fd7c3ff3 100644 --- a/src/otclient/net/protocolcodes.h +++ b/src/otclient/net/protocolcodes.h @@ -117,10 +117,10 @@ namespace Proto { GameServerChannels = 171, GameServerOpenChannel = 172, GameServerPrivateChannel = 173, - GameServerRuleViolation = 174, // absolate in last tibia? - GameServerRuleViolation1 = 175, // absolate in last tibia? - GameServerRuleViolation2 = 176, // absolate in last tibia? - GameServerRuleViolation3 = 177, // absolate in last tibia? + GameServerRuleViolationChannel = 174, // absolate in last tibia? + GameServerRuleViolationRemove = 175, // absolate in last tibia? + GameServerRuleViolationCancel = 176, // absolate in last tibia? + GameServerRuleViolationLock = 177, // absolate in last tibia? GameServerOpenOwnChannel = 178, GameServerCloseChannel = 179, GameServerMessage = 180, diff --git a/src/otclient/net/protocolgame.h b/src/otclient/net/protocolgame.h index 378fb702..5dc1c489 100644 --- a/src/otclient/net/protocolgame.h +++ b/src/otclient/net/protocolgame.h @@ -156,7 +156,6 @@ private: void parseChannelList(InputMessage& msg); void parseOpenChannel(InputMessage& msg); void parseOpenPrivatePlayerChat(InputMessage& msg); - void parseOpenRuleViolation(InputMessage& msg); void parseCreatePrivateChannel(InputMessage& msg); void parseClosePrivateChannel(InputMessage& msg); void parseSafeTradeRequest(InputMessage& msg); diff --git a/src/otclient/net/protocolgameparse.cpp b/src/otclient/net/protocolgameparse.cpp index e377741a..c1ceed88 100644 --- a/src/otclient/net/protocolgameparse.cpp +++ b/src/otclient/net/protocolgameparse.cpp @@ -198,11 +198,16 @@ void ProtocolGame::parseMessage(InputMessage& msg) case Proto::GameServerPrivateChannel: parseOpenPrivatePlayerChat(msg); break; - case Proto::GameServerRuleViolation: - case Proto::GameServerRuleViolation1: - case Proto::GameServerRuleViolation2: - case Proto::GameServerRuleViolation3: - parseOpenRuleViolation(msg); + case Proto::GameServerRuleViolationChannel: + msg.getU16(); + break; + case Proto::GameServerRuleViolationRemove: + msg.getString(); + break; + case Proto::GameServerRuleViolationCancel: + msg.getString(); + break; + case Proto::GameServerRuleViolationLock: break; case Proto::GameServerOpenOwnChannel: parseCreatePrivateChannel(msg); @@ -783,11 +788,6 @@ void ProtocolGame::parseOpenPrivatePlayerChat(InputMessage& msg) msg.getString(); // name } -void ProtocolGame::parseOpenRuleViolation(InputMessage& msg) -{ - msg.getU16(); // a -} - void ProtocolGame::parseCreatePrivateChannel(InputMessage& msg) { msg.getU16(); // channel id diff --git a/src/otclient/ui/uimap.cpp b/src/otclient/ui/uimap.cpp index 985ba661..6561bd86 100644 --- a/src/otclient/ui/uimap.cpp +++ b/src/otclient/ui/uimap.cpp @@ -82,10 +82,7 @@ TilePtr UIMap::getTile(const Point& mousePos) void UIMap::onGeometryChange(const Rect& oldRect, const Rect& newRect) { Rect mapRect = newRect.expanded(-1); - mapRect.addTop(m_paddingTop); - mapRect.addLeft(m_paddingLeft); - mapRect.addBottom(-m_paddingBottom); - mapRect.addRight(-m_paddingRight); + mapRect.add(-m_paddingTop, -m_paddingLeft, -m_paddingBottom, -m_paddingRight); Size mapSize(g_map.getVibibleSize().width() * Map::NUM_TILE_PIXELS, g_map.getVibibleSize().height() * Map::NUM_TILE_PIXELS); mapSize.scale(mapRect.size(), Fw::KeepAspectRatio);