From 236706b8432ac16534cb4d8d426a5b526b9e660b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 18 Oct 2011 02:24:46 +0300 Subject: Add method to reset send buffer pointer in created MessageOut instance. --- src/net/tmwa/messageout.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h index da86f06f6..d97851d4a 100644 --- a/src/net/tmwa/messageout.h +++ b/src/net/tmwa/messageout.h @@ -56,6 +56,9 @@ class MessageOut : public Net::MessageOut void writeCoordinates(unsigned short x, unsigned short y, unsigned char direction); + void resetPos() + { mPos = 0; } + private: void expand(size_t size); -- cgit v1.2.3-70-g09d2 From 3945c533f8930093b6101b00827a37d6bbde0fb4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 19 Oct 2011 00:04:40 +0300 Subject: Disable autofix position for move to target archer mode. --- src/localplayer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index f33a72bb0..58edbfd78 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -3779,8 +3779,11 @@ void LocalPlayer::fixAttackTarget() if (!mMap || !mTarget) return; - if (!getAttackType() || !config.getBoolValue("autofixPos")) + if (getMoveToTargetType() == 7 || !getAttackType() + || !config.getBoolValue("autofixPos")) + { return; + } const Vector &playerPos = getPosition(); Path debugPath = mMap->findPath( -- cgit v1.2.3-70-g09d2 From 990c96c992c4cf21173c904dd85f0b378e1c89b0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 19 Oct 2011 01:05:22 +0300 Subject: Hide passwords from packets logs. --- src/net/messageout.cpp | 28 ++++++++++++++++++++++++++++ src/net/messageout.h | 7 +++++++ src/net/tmwa/loginhandler.cpp | 6 +++--- 3 files changed, 38 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index a8b66f5ae..f18f65a93 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -82,6 +82,34 @@ void MessageOut::writeString(const std::string &string, int length) PacketCounters::incOutBytes(length); } +void MessageOut::writeStringNoLog(const std::string &string, int length) +{ + DEBUGLOG("writeString: ***"); + int stringLength = static_cast(string.length()); + if (length < 0) + { + // Write the length at the start if not fixed + writeInt16(static_cast(stringLength)); + length = stringLength; + } + else if (length < stringLength) + { + // Make sure the length of the string is no longer than specified + stringLength = length; + } + expand(length); + + // Write the actual string + memcpy(mData + mPos, string.c_str(), stringLength); + + // Pad remaining space with zeros + if (length > stringLength) + memset(mData + mPos + stringLength, '\0', length - stringLength); + + mPos += length; + PacketCounters::incOutBytes(length); +} + char *MessageOut::getData() const { return mData; diff --git a/src/net/messageout.h b/src/net/messageout.h index 39a2e68bd..4445bbbe8 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -56,6 +56,13 @@ class MessageOut */ virtual void writeString(const std::string &string, int length = -1); + /** + * Writes a string. If a fixed length is not given (-1), it is stored + * as a short at the start of the string. + */ + virtual void writeStringNoLog(const std::string &string, + int length = -1); + /** * Returns the content of the message. */ diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index cac8df623..bdc944d63 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -118,8 +118,8 @@ void LoginHandler::changePassword(const std::string &username A_UNUSED, const std::string &newPassword) { MessageOut outMsg(CMSG_CHAR_PASSWORD_CHANGE); - outMsg.writeString(oldPassword, 24); - outMsg.writeString(newPassword, 24); + outMsg.writeStringNoLog(oldPassword, 24); + outMsg.writeStringNoLog(newPassword, 24); } void LoginHandler::sendLoginRegister(const std::string &username, @@ -128,7 +128,7 @@ void LoginHandler::sendLoginRegister(const std::string &username, MessageOut outMsg(0x0064); outMsg.writeInt32(0); // client version outMsg.writeString(username, 24); - outMsg.writeString(password, 24); + outMsg.writeStringNoLog(password, 24); /* * eAthena calls the last byte "client version 2", but it isn't used at -- cgit v1.2.3-70-g09d2 From 2b696349cc1d6289b21ff667ae92a79cf9cabd17 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 19 Oct 2011 01:14:05 +0300 Subject: Add to debug log number of sended and received bytes. --- src/net/tmwa/network.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index 0af74c295..e26f48324 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -260,6 +260,7 @@ void Network::flush() SDL_mutexP(mMutex); ret = SDLNet_TCP_Send(mSocket, mOutBuffer, mOutSize); + DEBUGLOG("Send " + toString(mOutSize) + " bytes"); if (ret < static_cast(mOutSize)) { setError("Error in SDLNet_TCP_Send(): " + @@ -427,6 +428,7 @@ void Network::receive() } else { + DEBUGLOG("Receive " + toString(ret) + " bytes"); mInSize += ret; if (mToSkip) { -- cgit v1.2.3-70-g09d2 From 60621b7cd02030ab86a670c2124fb50f237b0c4f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Oct 2011 02:18:18 +0300 Subject: Fix possible crash in network code after destroing all not leaked objects. --- src/logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/logger.h b/src/logger.h index c2fabb383..4ce89f759 100644 --- a/src/logger.h +++ b/src/logger.h @@ -29,7 +29,7 @@ class ChatWindow; #ifdef ENABLEDEBUGLOG -#define DEBUGLOG(msg) logger->dlog(msg) +#define DEBUGLOG(msg) if (logger) logger->dlog(msg) #else #define DEBUGLOG(msg) {} #endif -- cgit v1.2.3-70-g09d2 From 2fcfbc4b1136265cbd463b9d3b721ce0cad52fe0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Oct 2011 02:19:07 +0300 Subject: Fix parsing replace tags without item ids inside in items.xml. --- src/resources/itemdb.cpp | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 9ff80de22..74474e067 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -636,19 +636,20 @@ void loadReplaceSprite(ItemInfo *itemInfo, xmlNodePtr replaceNode) { case -1: { - for_each_xml_child_node(itemNode, replaceNode) + for (int f = 0; f < 9; f ++) { - if (xmlStrEqual(itemNode->name, BAD_CAST "item")) + std::map *mapList + = itemInfo->addReplaceSprite( + parseSpriteName(removeSprite), f); + if (!mapList) + continue; + for_each_xml_child_node(itemNode, replaceNode) { - int from = XML::getProperty(itemNode, "from", 0); - int to = XML::getProperty(itemNode, "to", 1); - for (int f = 0; f < 9; f ++) + if (xmlStrEqual(itemNode->name, BAD_CAST "item")) { - std::map *mapList - = itemInfo->addReplaceSprite( - parseSpriteName(removeSprite), f); - if (!mapList) - continue; + int from = XML::getProperty(itemNode, "from", 0); + int to = XML::getProperty(itemNode, "to", 1); + (*mapList)[from] = to; } } @@ -657,6 +658,13 @@ void loadReplaceSprite(ItemInfo *itemInfo, xmlNodePtr replaceNode) } case -2: { + itemInfo->addReplaceSprite(parseSpriteName( + removeSprite), DIRECTION_DOWN); + itemInfo->addReplaceSprite(parseSpriteName( + removeSprite), DIRECTION_DOWNLEFT); + itemInfo->addReplaceSprite(parseSpriteName( + removeSprite), DIRECTION_DOWNRIGHT); + for_each_xml_child_node(itemNode, replaceNode) { if (xmlStrEqual(itemNode->name, BAD_CAST "item")) @@ -683,6 +691,13 @@ void loadReplaceSprite(ItemInfo *itemInfo, xmlNodePtr replaceNode) } case -3: { + itemInfo->addReplaceSprite(parseSpriteName( + removeSprite), DIRECTION_UP); + itemInfo->addReplaceSprite(parseSpriteName( + removeSprite), DIRECTION_UPLEFT); + itemInfo->addReplaceSprite(parseSpriteName( + removeSprite), DIRECTION_UPRIGHT); + for_each_xml_child_node(itemNode, replaceNode) { if (xmlStrEqual(itemNode->name, BAD_CAST "item")) -- cgit v1.2.3-70-g09d2 From f1beb8d910253a31b9dd239071effa2d518ceee0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Oct 2011 00:25:26 +0300 Subject: Add chat commands for using server side ignore for all whispers. Commands: /serverignoreall and /serverunignoreall --- src/commandhandler.cpp | 17 ++++++++++++++++ src/commandhandler.h | 6 ++++++ src/gui/chatwindow.cpp | 2 ++ src/net/chathandler.h | 4 ++++ src/net/ea/chathandler.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++ src/net/ea/chathandler.h | 2 ++ src/net/manaserv/chathandler.h | 4 ++++ src/net/tmwa/chathandler.cpp | 17 +++++++++++++++- src/net/tmwa/chathandler.h | 4 ++++ src/net/tmwa/protocol.h | 2 ++ 10 files changed, 102 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index f1b7518c5..7a4773d81 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -190,6 +190,10 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) handleAddIgnoreAttack(args, tab); else if (type == "dump") handleDump(args, tab); + else if (type == "serverignoreall") + handleServerIgnoreAll(args, tab); + else if (type == "serverunignoreall") + handleServerUnIgnoreAll(args, tab); else if (tab->handleCommand(type, args)) ; else if (type == "hack") @@ -1020,6 +1024,18 @@ void CommandHandler::handleCacheInfo(const std::string &args A_UNUSED, #endif } +void CommandHandler::handleServerIgnoreAll(const std::string &args, + ChatTab *tab A_UNUSED) +{ + Net::getChatHandler()->ignoreAll(); +} + +void CommandHandler::handleServerUnIgnoreAll(const std::string &args, + ChatTab *tab A_UNUSED) +{ + Net::getChatHandler()->unIgnoreAll(); +} + #ifdef DEBUG_DUMP_LEAKS void showRes(std::string str, ResourceManager::Resources *res); @@ -1076,6 +1092,7 @@ void CommandHandler::handleDump(const std::string &args, + toString(res->size())); } } + #elif defined ENABLE_MEM_DEBUG void CommandHandler::handleDump(const std::string &args A_UNUSED, ChatTab *tab A_UNUSED) diff --git a/src/commandhandler.h b/src/commandhandler.h index 52080dfcd..a082f950e 100644 --- a/src/commandhandler.h +++ b/src/commandhandler.h @@ -290,6 +290,12 @@ class CommandHandler void handleAddIgnoreAttack(const std::string &args, ChatTab *tab A_UNUSED); + void handleServerIgnoreAll(const std::string &args, + ChatTab *tab A_UNUSED); + + void handleServerUnIgnoreAll(const std::string &args, + ChatTab *tab A_UNUSED); + void handleDump(const std::string &args, ChatTab *tab); void handleCacheInfo(const std::string &args, ChatTab *tab A_UNUSED); diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 59bd173bd..d8bc7f3c4 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -294,6 +294,8 @@ void ChatWindow::fillCommands() mCommands.push_back("/removeattack "); mCommands.push_back("/addignoreattack "); mCommands.push_back("/blacklist "); + mCommands.push_back("/serverignoreall"); + mCommands.push_back("/serverunignoreall"); } void ChatWindow::resetToDefaultSize() diff --git a/src/net/chathandler.h b/src/net/chathandler.h index a0e232027..fc6c10376 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -64,6 +64,10 @@ class ChatHandler virtual void who() = 0; virtual void sendRaw(const std::string &args) = 0; + + virtual void ignoreAll() = 0; + + virtual void unIgnoreAll() = 0; }; } diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 60af645be..35e8597f0 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -353,4 +353,49 @@ void ChatHandler::processMVP(Net::MessageIn &msg) } } +void ChatHandler::processIgnoreAllResponse(Net::MessageIn &msg) +{ + int action = msg.readInt8(); + int fail = msg.readInt8(); + if (!localChatTab) + return; + + switch (action) + { + case 0: + { + switch (fail) + { + case 0: + localChatTab->chatLog(_("All whispers ignored."), + BY_SERVER); + break; + default: + localChatTab->chatLog(_("All whispers ignore failed."), + BY_SERVER); + break; + } + break; + } + case 1: + { + switch (fail) + { + case 0: + localChatTab->chatLog(_("All whispers unignored."), + BY_SERVER); + break; + default: + localChatTab->chatLog(_("All whispers unignore failed."), + BY_SERVER); + break; + } + break; + } + default: + // unknown result + break; + } +} + } // namespace Ea diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index d000b673d..cff9bf589 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -84,6 +84,8 @@ class ChatHandler : public Net::ChatHandler virtual void processMVP(Net::MessageIn &msg); + virtual void processIgnoreAllResponse(Net::MessageIn &msg); + protected: typedef std::queue WhisperQueue; WhisperQueue mSentWhispers; diff --git a/src/net/manaserv/chathandler.h b/src/net/manaserv/chathandler.h index 5eb2a0ff4..beea40423 100644 --- a/src/net/manaserv/chathandler.h +++ b/src/net/manaserv/chathandler.h @@ -133,6 +133,10 @@ class ChatHandler : public MessageHandler, public Net::ChatHandler * Handle who responses. */ void handleWhoResponse(Net::MessageIn &msg); + + void ignoreAll() + + void unIgnoreAll() }; } // namespace ManaServ diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 4e4318595..fe6592d93 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -60,6 +60,7 @@ ChatHandler::ChatHandler() SMSG_WHISPER_RESPONSE, SMSG_GM_CHAT, SMSG_MVP, // MVP + SMSG_IGNORE_ALL_RESPONSE, 0 }; handledMessages = _messages; @@ -96,6 +97,9 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) processMVP(msg); break; + case SMSG_IGNORE_ALL_RESPONSE: + processIgnoreAllResponse(msg); + default: break; } @@ -249,5 +253,16 @@ void ChatHandler::processRaw(MessageOut &outMsg, std::string &line) } } -} // namespace TmwAthena +void ChatHandler::ignoreAll() +{ + MessageOut outMsg(CMSG_IGNORE_ALL); + outMsg.writeInt8(0); +} +void ChatHandler::unIgnoreAll() +{ + MessageOut outMsg(CMSG_IGNORE_ALL); + outMsg.writeInt8(1); +} + +} // namespace TmwAthena diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index d9e927e03..197ba12b3 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -57,6 +57,10 @@ class ChatHandler : public MessageHandler, public Ea::ChatHandler void sendRaw(const std::string &args); + void ignoreAll(); + + void unIgnoreAll(); + void processRaw(MessageOut &outMsg, std::string &line); }; diff --git a/src/net/tmwa/protocol.h b/src/net/tmwa/protocol.h index 3a753e351..caf3c8e53 100644 --- a/src/net/tmwa/protocol.h +++ b/src/net/tmwa/protocol.h @@ -331,5 +331,7 @@ enum #define SMSG_BEING_IP_RESPONSE 0x020c #define SMSG_PVP_MAP_MODE 0x0199 #define SMSG_PVP_SET 0x019a +#define CMSG_IGNORE_ALL 0x00d0 +#define SMSG_IGNORE_ALL_RESPONSE 0x00d2 #endif -- cgit v1.2.3-70-g09d2 From c905067448700c63f7645b08d80bffbde57a45fa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Oct 2011 02:35:55 +0300 Subject: Protect trade against abusing. --- src/net/ea/tradehandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index bdbba9715..e91541cb7 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -121,6 +121,13 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg) void TradeHandler::processTradeResponse(Net::MessageIn &msg) { + if (confirmDlg || tradePartnerName.empty() + || !player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) + { + Net::getTradeHandler()->respond(false); + return; + } + switch (msg.readInt8()) { case 0: // Too far away -- cgit v1.2.3-70-g09d2 From cd0b35a6c1a86e4432d9dc9ec75b4da0ae9a7bdc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 27 Oct 2011 22:17:21 +0300 Subject: Add command to dump to chat main graphics settings. Command: /dumpg --- src/commandhandler.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++++++--- src/commandhandler.h | 5 +++++ src/graphics.cpp | 4 ++++ src/graphics.h | 16 ++++++++++++++ src/gui/chatwindow.cpp | 1 + src/opengl1graphics.cpp | 1 + src/openglgraphics.cpp | 1 + src/resources/image.h | 3 +++ 8 files changed, 85 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 7a4773d81..cac12b8ec 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -26,6 +26,7 @@ #include "actorspritemanager.h" #include "channelmanager.h" #include "channel.h" +#include "configuration.h" #include "game.h" #include "guildmanager.h" #include "localplayer.h" @@ -194,6 +195,8 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) handleServerIgnoreAll(args, tab); else if (type == "serverunignoreall") handleServerUnIgnoreAll(args, tab); + else if (type == "dumpg") + handleDumpGraphics(args, tab); else if (tab->handleCommand(type, args)) ; else if (type == "hack") @@ -376,14 +379,20 @@ void CommandHandler::handleParty(const std::string &args, ChatTab *tab) } void CommandHandler::handleMe(const std::string &args, ChatTab *tab) +{ + const std::string str = strprintf("*%s*", args.c_str()); + outString(tab, strprintf("*%s*", args.c_str()), args); +} + +void CommandHandler::outString(ChatTab *tab, const std::string &str, + const std::string &def) { if (!tab) { - Net::getChatHandler()->me(args); + Net::getChatHandler()->me(def); return; } - const std::string str = strprintf("*%s*", args.c_str()); switch (tab->getType()) { case ChatTab::TAB_PARTY: @@ -406,7 +415,7 @@ void CommandHandler::handleMe(const std::string &args, ChatTab *tab) break; } default: - Net::getChatHandler()->me(args); + Net::getChatHandler()->me(def); break; } } @@ -1036,6 +1045,48 @@ void CommandHandler::handleServerUnIgnoreAll(const std::string &args, Net::getChatHandler()->unIgnoreAll(); } +void CommandHandler::handleDumpGraphics(const std::string &args, ChatTab *tab) +{ + std::string str; + str = strprintf ("%s,%s,%dX%dX%d,", PACKAGE_OS, SMALL_VERSION, + mainGraphics->getWidth(), mainGraphics->getHeight(), + mainGraphics->getBpp()); + + if (mainGraphics->getFullScreen()) + str += "F"; + else + str += "W"; + if (mainGraphics->getHWAccel()) + str += "H"; + else + str += "S"; + + if (mainGraphics->getDoubleBuffer()) + str += "D"; + else + str += "_"; + +#if defined USE_OPENGL + str += strprintf(",%d", mainGraphics->getOpenGL()); +#else + str += ",0"; +#endif + + str += strprintf(",%f,", Client::getGuiAlpha()); + str += config.getBoolValue("adjustPerfomance") ? "1" : "0"; + str += config.getBoolValue("alphaCache") ? "1" : "0"; + str += config.getBoolValue("enableMapReduce") ? "1" : "0"; + str += config.getBoolValue("beingopacity") ? "1" : "0"; + str += ","; + str += config.getBoolValue("enableAlphaFix") ? "1" : "0"; + str += config.getBoolValue("disableAdvBeingCaching") ? "1" : "0"; + str += config.getBoolValue("disableBeingCaching") ? "1" : "0"; + str += config.getBoolValue("particleeffects") ? "1" : "0"; + + str += strprintf(",%d-%d", fps, config.getIntValue("fpslimit")); + outString(tab, str, str); +} + #ifdef DEBUG_DUMP_LEAKS void showRes(std::string str, ResourceManager::Resources *res); diff --git a/src/commandhandler.h b/src/commandhandler.h index a082f950e..0b3146af8 100644 --- a/src/commandhandler.h +++ b/src/commandhandler.h @@ -298,6 +298,11 @@ class CommandHandler void handleDump(const std::string &args, ChatTab *tab); + void handleDumpGraphics(const std::string &args, ChatTab *tab); + + void outString(ChatTab *tab, const std::string &str, + const std::string &def); + void handleCacheInfo(const std::string &args, ChatTab *tab A_UNUSED); bool parse2Int(const std::string &args, int *x, int *y); diff --git a/src/graphics.cpp b/src/graphics.cpp index efa1058a6..d914b0b00 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -53,6 +53,7 @@ Graphics::Graphics(): mRect.y = 0; mRect.w = 0; mRect.h = 0; + mOpenGL = 0; } Graphics::~Graphics() @@ -100,7 +101,10 @@ bool Graphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel) logger->log("Double buffer mode: %s", mDoubleBuffer ? "yes" : "no"); if (mTarget->format) + { logger->log("Bits per pixel: %d", mTarget->format->BytesPerPixel); + bpp = mTarget->format->BytesPerPixel; + } const SDL_VideoInfo *vi = SDL_GetVideoInfo(); if (!vi) diff --git a/src/graphics.h b/src/graphics.h index f3e0bd05d..4a4676b26 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -275,6 +275,21 @@ class Graphics : public gcn::SDLGraphics bool getSecure() { return mSecure; } + int getBpp() + { return mBpp; } + + bool getFullScreen() + { return mFullscreen; } + + bool getHWAccel() + { return mHWAccel; } + + bool getDoubleBuffer() + { return mDoubleBuffer; } + + int getOpenGL() + { return mOpenGL; } + int mWidth; int mHeight; @@ -290,6 +305,7 @@ class Graphics : public gcn::SDLGraphics bool mDoubleBuffer; SDL_Rect mRect; bool mSecure; + int mOpenGL; }; extern Graphics *mainGraphics; diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index d8bc7f3c4..7969f55f8 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -296,6 +296,7 @@ void ChatWindow::fillCommands() mCommands.push_back("/blacklist "); mCommands.push_back("/serverignoreall"); mCommands.push_back("/serverunignoreall"); + mCommands.push_back("/dumpg"); } void ChatWindow::resetToDefaultSize() diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp index 46e482df6..1f1a0231d 100644 --- a/src/opengl1graphics.cpp +++ b/src/opengl1graphics.cpp @@ -49,6 +49,7 @@ OpenGL1Graphics::OpenGL1Graphics(): mAlpha(false), mTexture(false), mColorAlpha(false), mSync(false) { + mOpenGL = 2; } OpenGL1Graphics::~OpenGL1Graphics() diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index 2ec5db490..049556c76 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -53,6 +53,7 @@ OpenGLGraphics::OpenGLGraphics(): mAlpha(false), mTexture(false), mColorAlpha(false), mSync(false) { + mOpenGL = 1; mFloatTexArray = new GLfloat[vertexBufSize * 4 + 30]; mIntTexArray = new GLint[vertexBufSize * 4 + 30]; mIntVertArray = new GLint[vertexBufSize * 4 + 30]; diff --git a/src/resources/image.h b/src/resources/image.h index 9ac2b163e..941b34465 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -188,6 +188,9 @@ class Image : public Resource static void SDLSetEnableAlphaCache(bool n) { mEnableAlphaCache = n; } + static bool SDLGetEnableAlphaCache() + { return mEnableAlphaCache; } + static void setEnableAlpha(bool n) { mEnableAlpha = n; } -- cgit v1.2.3-70-g09d2 From dbe7df424ce015248d8c58976ec381fa8b84e3de Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 29 Oct 2011 15:44:21 +0300 Subject: Change version to 1.1.10.30. --- ChangeLog | 11 +++++++++++ README | 2 +- README.txt | 2 +- build/packwin | 2 +- configure.ac | 2 +- src/main.h | 4 ++-- 6 files changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 463e48933..f1158ae7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-10-30 New release 1.1.10.30 +ManaPlus: +fix: disable autofix position for archer mode. +fix; hide password from packets log. +fix: replace tags without item id in items.xml. +fix: protect trades from some kind of abusing. +add: chat commands to use server side ignore for whispers: +Commands: /serverignoreall and /serverunignoreall +add: command for dump graphics and some other settings to chat. +Command: /dumpg + 2011-10-16 New release 1.1.10.16 ManaPlus: fix: particle effects Y position. diff --git a/README b/README index ad106569c..fd3bcf6fd 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ THE MANA PLUS CLIENT =============== - Version: 1.1.10.16 Date: 2011-10-16 + Version: 1.1.10.30 Date: 2011-10-30 Development team: - See AUTHORS file for a list diff --git a/README.txt b/README.txt index 268a7b0c7..846685c60 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ THE MANA PLUS CLIENT =============== - Version: 1.1.10.16 Date: 2011-10-16 + Version: 1.1.10.30 Date: 2011-10-30 Development team: - See AUTHORS file for a list diff --git a/build/packwin b/build/packwin index 81920b9fa..a817b5d4b 100755 --- a/build/packwin +++ b/build/packwin @@ -7,7 +7,7 @@ dir=`pwd` cd packaging/windows ./make-translations.sh makensis -DDLLDIR=$dir/../mana_win/libs/dll/ \ - -DPRODUCT_VERSION="1.1.10.16" \ + -DPRODUCT_VERSION="1.1.10.30" \ -DEXESUFFIX=/src \ -DUPX=true \ setup.nsi diff --git a/configure.ac b/configure.ac index 3c4b8d011..f718e7318 100755 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT([ManaPlus], [1.1.10.16], [akaras@inbox.ru], [manaplus]) +AC_INIT([ManaPlus], [1.1.10.30], [akaras@inbox.ru], [manaplus]) AM_INIT_AUTOMAKE([1.9]) AC_CONFIG_HEADERS([config.h:config.h.in]) AC_LANG_CPLUSPLUS diff --git a/src/main.h b/src/main.h index 548c3283f..63db481a5 100644 --- a/src/main.h +++ b/src/main.h @@ -45,8 +45,8 @@ * different interfaces, which have different implementations for each server. */ -#define SMALL_VERSION "1.1.10.16" -#define CHECK_VERSION "01.01.10.16" +#define SMALL_VERSION "1.1.10.30" +#define CHECK_VERSION "01.01.10.30" #ifdef HAVE_CONFIG_H #include "../config.h" -- cgit v1.2.3-70-g09d2 From 2c3c118c03ece5cad2b73affffbcbbc5a5746c7a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 30 Oct 2011 03:38:25 +0300 Subject: Fix code style. --- src/net/ea/tradehandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index e91541cb7..19aa474e3 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -122,7 +122,8 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg) void TradeHandler::processTradeResponse(Net::MessageIn &msg) { if (confirmDlg || tradePartnerName.empty() - || !player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) + || !player_relations.hasPermission(tradePartnerName, + PlayerRelation::TRADE)) { Net::getTradeHandler()->respond(false); return; -- cgit v1.2.3-70-g09d2