summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/beinghandler.cpp6
-rw-r--r--src/net/ea/gamehandler.cpp12
-rw-r--r--src/net/ea/gamehandler.h6
-rw-r--r--src/net/ea/gui/partytab.cpp1
-rw-r--r--src/net/ea/inventoryhandler.cpp2
-rw-r--r--src/net/ea/itemhandler.cpp37
-rw-r--r--src/net/ea/itemhandler.h4
-rw-r--r--src/net/ea/loginhandler.cpp1
-rw-r--r--src/net/ea/playerhandler.cpp1
9 files changed, 45 insertions, 25 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 84bd03bb1..d9e7e7506 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -511,6 +511,12 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg)
}
break;
+ case 0x01: // dead
+ break;
+ // tmw server can send here garbage?
+// if (srcBeing)
+// srcBeing->setAction(Being::DEAD);
+
case 0x02: // Sit
if (srcBeing)
{
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index b7566e271..6d021d6a9 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -43,20 +43,20 @@ GameHandler::GameHandler()
{
mCharID = 0;
- listen(Mana::CHANNEL_GAME);
+ listen(CHANNEL_GAME);
}
-void GameHandler::processEvent(Mana::Channels channel,
- const Mana::Event &event)
+void GameHandler::processEvent(Channels channel,
+ const Event &event)
{
- if (channel == Mana::CHANNEL_GAME)
+ if (channel == CHANNEL_GAME)
{
- if (event.getName() == Mana::EVENT_ENGINESINITALIZED)
+ if (event.getName() == EVENT_ENGINESINITALIZED)
{
if (mMap != "")
Game::instance()->changeMap(mMap);
}
- else if (event.getName() == Mana::EVENT_MAPLOADED)
+ else if (event.getName() == EVENT_MAPLOADED)
{
mapLoadedEvent();
}
diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h
index 248175617..59cb148c4 100644
--- a/src/net/ea/gamehandler.h
+++ b/src/net/ea/gamehandler.h
@@ -32,13 +32,13 @@
namespace Ea
{
-class GameHandler : public Net::GameHandler, public Mana::Listener
+class GameHandler : public Net::GameHandler, public Listener
{
public:
GameHandler();
- virtual void processEvent(Mana::Channels channel,
- const Mana::Event &event);
+ virtual void processEvent(Channels channel,
+ const Event &event);
virtual void who();
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index cf62af459..d5e344ac2 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -242,4 +242,3 @@ void PartyTab::saveToLogFile(std::string &msg)
}
} // namespace Ea
-
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 4c4fb760c..d870eff38 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -330,7 +330,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
{
Item *item = inventory->getItem(index);
- if (item && item->getId() == itemId)
+ if (item && item->getId() == itemId)
amount += item->getQuantity();
if (serverVersion < 1 && identified > 1)
diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp
index e08fe2cd1..7a6ee2743 100644
--- a/src/net/ea/itemhandler.cpp
+++ b/src/net/ea/itemhandler.cpp
@@ -35,28 +35,39 @@ ItemHandler::ItemHandler()
{
}
-void ItemHandler::processItemVisible(Net::MessageIn &msg, bool isDrop)
+void ItemHandler::processItemVisible(Net::MessageIn &msg)
{
int id = msg.readInt32();
int itemId = msg.readInt16();
unsigned char identify = msg.readInt8(); // identify flag
int x = msg.readInt16();
int y = msg.readInt16();
- int amount1 = msg.readInt16();
- int amount2 = msg.readInt16();
+ int amount = msg.readInt16();
+ int subX = msg.readInt8() + 16 - 8;
+ int subY = msg.readInt8() + 32 - 8;
if (actorSpriteManager)
{
- if (!isDrop)
- {
- actorSpriteManager->createItem(id, itemId,
- x, y, amount1, identify);
- }
- else
- {
- actorSpriteManager->createItem(id, itemId,
- x, y, amount2, identify);
- }
+ actorSpriteManager->createItem(id, itemId,
+ x, y, amount, identify, subX, subY);
+ }
+}
+
+void ItemHandler::processItemDropped(Net::MessageIn &msg)
+{
+ int id = msg.readInt32();
+ int itemId = msg.readInt16();
+ unsigned char identify = msg.readInt8(); // identify flag
+ int x = msg.readInt16();
+ int y = msg.readInt16();
+ int subX = msg.readInt8() + 16 - 8;
+ int subY = msg.readInt8() + 32 - 8;
+ int amount = msg.readInt16();
+
+ if (actorSpriteManager)
+ {
+ actorSpriteManager->createItem(id, itemId,
+ x, y, amount, identify, subX, subY);
}
}
diff --git a/src/net/ea/itemhandler.h b/src/net/ea/itemhandler.h
index 1d0747c61..d5c268d2e 100644
--- a/src/net/ea/itemhandler.h
+++ b/src/net/ea/itemhandler.h
@@ -34,9 +34,11 @@ class ItemHandler
public:
ItemHandler();
- void processItemVisible(Net::MessageIn &msg, bool isDrop);
+ void processItemVisible(Net::MessageIn &msg);
void processItemRemove(Net::MessageIn &msg);
+
+ void processItemDropped(Net::MessageIn &msg);
};
} // namespace Ea
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 291a92906..39a920f03 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -28,6 +28,7 @@
#include "utils/dtor.h"
#include "utils/gettext.h"
+#include "utils/paths.h"
#include "debug.h"
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 76a7b0dbc..27aa4da80 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -22,6 +22,7 @@
#include "net/ea/playerhandler.h"
+#include "localplayer.h"
#include "logger.h"
#include "party.h"
#include "playerinfo.h"