diff options
-rw-r--r-- | .mailmap | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | src/main.h | 2 | ||||
-rw-r--r-- | src/net/ea/itemhandler.cpp | 67 | ||||
-rw-r--r-- | src/net/ea/itemhandler.h | 35 | ||||
-rw-r--r-- | src/resources/spritedef.cpp | 2 | ||||
-rw-r--r-- | src/resources/spritedef.h | 2 | ||||
-rw-r--r-- | src/winver.h | 6 |
9 files changed, 109 insertions, 10 deletions
@@ -1,3 +1,4 @@ Bjørn Lindeijer <bjorn@lindeijer.nl> +Bjørn Lindeijer <thorbjorn.lindeijer@nokia.com> Majin Sniper <sniper@livecd.janhome.net> Victor Fury <frictor@unknown> diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d123870..71d85b12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(TMW) -SET(VERSION 0.1.0) +SET(VERSION 0.0.29) # where to look for cmake modules SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) @@ -1,7 +1,7 @@ THE MANA WORLD ============== - Version: 0.1.0 Date: XX/XX/2009 + Version: 0.0.29 Date: XX/XX/2009 Development team: - See AUTHORS file for a list @@ -58,7 +58,7 @@ #elif defined WIN32 #include "winver.h" #elif defined __APPLE__ -#define PACKAGE_VERSION "0.1.0" +#define PACKAGE_VERSION "0.0.29" #endif #ifndef PKG_DATADIR diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp new file mode 100644 index 00000000..73268554 --- /dev/null +++ b/src/net/ea/itemhandler.cpp @@ -0,0 +1,67 @@ +/* + * The Mana World + * Copyright (C) 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "itemhandler.h" +#include "../messagein.h" +#include "protocol.h" + +#include "../../engine.h" +#include "../../flooritemmanager.h" + +ItemHandler::ItemHandler() +{ + static const Uint16 _messages[] = { + SMSG_ITEM_VISIBLE, + SMSG_ITEM_DROPPED, + SMSG_ITEM_REMOVE, + 0 + }; + handledMessages = _messages; +} + +void ItemHandler::handleMessage(MessageIn &msg) +{ + Uint32 id; + Uint16 x, y; + int itemId; + + switch (msg.getId()) + { + case SMSG_ITEM_VISIBLE: + case SMSG_ITEM_DROPPED: + id = msg.readInt32(); + itemId = msg.readInt16(); + msg.readInt8(); // identify flag + x = msg.readInt16(); + y = msg.readInt16(); + msg.skip(4); // amount,subX,subY / subX,subY,amount + + floorItemManager->create(id, itemId, x, y, engine->getCurrentMap()); + break; + + case SMSG_ITEM_REMOVE: + FloorItem *item; + item = floorItemManager->findById(msg.readInt32()); + if (item) + floorItemManager->destroy(item); + break; + } +} diff --git a/src/net/ea/itemhandler.h b/src/net/ea/itemhandler.h new file mode 100644 index 00000000..da93f6b4 --- /dev/null +++ b/src/net/ea/itemhandler.h @@ -0,0 +1,35 @@ +/* + * The Mana World + * Copyright (C) 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef NET_ITEMHANDLER_H +#define NET_ITEMHANDLER_H + +#include "../messagehandler.h" + +class ItemHandler : public MessageHandler +{ + public: + ItemHandler(); + + void handleMessage(MessageIn &msg); +}; + +#endif diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 390bd3d0..125edbea 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -348,7 +348,6 @@ SpriteAction SpriteDef::makeSpriteAction(const std::string &action) else if (action == "attack_throw") { return ACTION_ATTACK_THROW; } -#ifdef TMWSERV_SUPPORT else if (action == "special0") { return ACTION_SPECIAL_0; } @@ -379,7 +378,6 @@ SpriteAction SpriteDef::makeSpriteAction(const std::string &action) else if (action == "special9") { return ACTION_SPECIAL_9; } -#endif else if (action == "cast_magic") { return ACTION_CAST_MAGIC; } diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index c3db8d64..cd7bd7f0 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -43,7 +43,6 @@ enum SpriteAction ACTION_ATTACK_STAB, ACTION_ATTACK_BOW, ACTION_ATTACK_THROW, -#ifdef TMWSERV_SUPPORT ACTION_SPECIAL_0, ACTION_SPECIAL_1, ACTION_SPECIAL_2, @@ -54,7 +53,6 @@ enum SpriteAction ACTION_SPECIAL_7, ACTION_SPECIAL_8, ACTION_SPECIAL_9, -#endif ACTION_CAST_MAGIC, ACTION_USE_ITEM, ACTION_SIT, diff --git a/src/winver.h b/src/winver.h index abf91e9f..4996bdfb 100644 --- a/src/winver.h +++ b/src/winver.h @@ -1,6 +1,6 @@ /* VERSION DEFINITIONS */ #define VER_MAJOR 0 -#define VER_MINOR 1 -#define VER_RELEASE 0 +#define VER_MINOR 0 +#define VER_RELEASE 29 #define VER_BUILD 0 -#define PACKAGE_VERSION "0.1.0" +#define PACKAGE_VERSION "0.0.29" |