summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/download.cpp1
-rw-r--r--src/net/ea/buysellhandler.cpp2
-rw-r--r--src/net/ea/charserverhandler.cpp1
-rw-r--r--src/net/ea/charserverhandler.h9
-rw-r--r--src/net/ea/chathandler.cpp2
-rw-r--r--src/net/ea/chathandler.h6
-rw-r--r--src/net/ea/gamehandler.cpp2
-rw-r--r--src/net/ea/gamehandler.h6
-rw-r--r--src/net/ea/gui/guildtab.cpp3
-rw-r--r--src/net/ea/gui/guildtab.h3
-rw-r--r--src/net/ea/gui/partytab.h3
-rw-r--r--src/net/ea/guildhandler.cpp4
-rw-r--r--src/net/ea/guildhandler.h7
-rw-r--r--src/net/ea/inventoryhandler.cpp8
-rw-r--r--src/net/ea/inventoryhandler.h10
-rw-r--r--src/net/ea/itemhandler.cpp2
-rw-r--r--src/net/ea/itemhandler.h7
-rw-r--r--src/net/ea/loginhandler.cpp7
-rw-r--r--src/net/ea/loginhandler.h6
-rw-r--r--src/net/ea/npchandler.cpp2
-rw-r--r--src/net/ea/npchandler.h8
-rw-r--r--src/net/ea/partyhandler.cpp7
-rw-r--r--src/net/ea/partyhandler.h11
-rw-r--r--src/net/ea/playerhandler.cpp9
-rw-r--r--src/net/ea/playerhandler.h6
-rw-r--r--src/net/ea/skillhandler.cpp2
-rw-r--r--src/net/ea/skillhandler.h8
-rw-r--r--src/net/ea/tradehandler.cpp5
-rw-r--r--src/net/ea/tradehandler.h6
-rw-r--r--src/net/eathena/chathandler.cpp3
-rw-r--r--src/net/eathena/chathandler.h2
-rw-r--r--src/net/eathena/generalhandler.cpp1
-rw-r--r--src/net/eathena/messageout.cpp2
-rw-r--r--src/net/eathena/network.cpp1
-rw-r--r--src/net/eathena/network.h3
-rw-r--r--src/net/eathena/partyhandler.cpp1
-rw-r--r--src/net/loginhandler.h5
-rw-r--r--src/net/messagein.cpp25
-rw-r--r--src/net/messagein.h7
-rw-r--r--src/net/net.cpp11
-rw-r--r--src/net/serverinfo.h5
-rw-r--r--src/net/tmwa/chathandler.cpp3
-rw-r--r--src/net/tmwa/chathandler.h2
-rw-r--r--src/net/tmwa/generalhandler.cpp1
-rw-r--r--src/net/tmwa/messageout.cpp2
-rw-r--r--src/net/tmwa/network.cpp1
-rw-r--r--src/net/tmwa/network.h3
-rw-r--r--src/net/tmwa/partyhandler.cpp1
-rw-r--r--src/net/tmwa/pethandler.cpp3
-rw-r--r--src/net/tradehandler.h2
50 files changed, 134 insertions, 103 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index d0c6515fc..141a7772f 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -568,6 +568,7 @@ size_t Download::writeFunction(void *ptr,
memcpy(buf, ptr, totalMem);
buf[totalMem] = 0;
mUploadResponse.append(buf);
+ delete [] buf;
return totalMem;
}
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index 0f592b123..d55a3cea6 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -39,8 +39,6 @@
#include "net/chathandler.h"
#include "net/net.h"
-#include "net/ea/eaprotocol.h"
-
#include "utils/timer.h"
#include "debug.h"
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index a11c157fd..d541ce09b 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -33,6 +33,7 @@
#include "net/ea/gamehandler.h"
#include "net/ea/network.h"
+#include "net/messagein.h"
#include "net/net.h"
#include "utils/dtor.h"
diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h
index 5ffd714f2..af6aafa9b 100644
--- a/src/net/ea/charserverhandler.h
+++ b/src/net/ea/charserverhandler.h
@@ -24,8 +24,13 @@
#define NET_EA_CHARSERVERHANDLER_H
#include "net/charserverhandler.h"
-#include "net/messagein.h"
-#include "net/serverinfo.h"
+
+class ServerInfo;
+
+namespace Net
+{
+ class MessageIn;
+}
namespace Ea
{
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index 6654950f2..997e4bfc1 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -38,6 +38,8 @@
#include "gui/widgets/tabs/chattab.h"
+#include "net/messagein.h"
+
#include <string>
#include "debug.h"
diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h
index 1fabda09d..237abf10a 100644
--- a/src/net/ea/chathandler.h
+++ b/src/net/ea/chathandler.h
@@ -24,10 +24,14 @@
#define NET_EA_CHATHANDLER_H
#include "net/chathandler.h"
-#include "net/messagein.h"
#include <queue>
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index 6e1982b6d..de1d6f151 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -31,6 +31,8 @@
#include "gui/windows/okdialog.h"
+#include "net/messagein.h"
+
#include "debug.h"
namespace Ea
diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h
index 8a31ee030..4a0624be0 100644
--- a/src/net/ea/gamehandler.h
+++ b/src/net/ea/gamehandler.h
@@ -24,7 +24,11 @@
#define NET_EA_GAMEHANDLER_H
#include "net/gamehandler.h"
-#include "net/messagein.h"
+
+namespace Net
+{
+ class MessageIn;
+}
namespace Ea
{
diff --git a/src/net/ea/gui/guildtab.cpp b/src/net/ea/gui/guildtab.cpp
index 46b1f1649..af8c3b8df 100644
--- a/src/net/ea/gui/guildtab.cpp
+++ b/src/net/ea/gui/guildtab.cpp
@@ -28,10 +28,9 @@
#include "soundconsts.h"
#include "soundmanager.h"
+#include "net/guildhandler.h"
#include "net/net.h"
-#include "net/ea/guildhandler.h"
-
#include "utils/gettext.h"
#include "debug.h"
diff --git a/src/net/ea/gui/guildtab.h b/src/net/ea/gui/guildtab.h
index 2b6a4bd1a..931b53397 100644
--- a/src/net/ea/gui/guildtab.h
+++ b/src/net/ea/gui/guildtab.h
@@ -31,7 +31,8 @@ namespace Ea
/**
* A tab for a guild chat channel.
*/
-class GuildTab : public ChatTab, public ConfigListener
+class GuildTab : public ChatTab,
+ public ConfigListener
{
public:
explicit GuildTab(const Widget2 *const widget);
diff --git a/src/net/ea/gui/partytab.h b/src/net/ea/gui/partytab.h
index d141452d0..6c61990dd 100644
--- a/src/net/ea/gui/partytab.h
+++ b/src/net/ea/gui/partytab.h
@@ -31,7 +31,8 @@ namespace Ea
/**
* A tab for a party chat channel.
*/
-class PartyTab : public ChatTab, public ConfigListener
+class PartyTab : public ChatTab,
+ public ConfigListener
{
public:
explicit PartyTab(const Widget2 *const widget);
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index 536c93263..1e56ac75b 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -30,6 +30,10 @@
#include "gui/windows/socialwindow.h"
+#include "net/messagein.h"
+
+#include "net/ea/gui/guildtab.h"
+
#include "debug.h"
namespace Ea
diff --git a/src/net/ea/guildhandler.h b/src/net/ea/guildhandler.h
index 191d6fd44..e8bec6a09 100644
--- a/src/net/ea/guildhandler.h
+++ b/src/net/ea/guildhandler.h
@@ -23,12 +23,15 @@
#define NET_EA_GUILDHANDLER_H
#include "net/guildhandler.h"
-#include "net/messagein.h"
-#include "net/ea/gui/guildtab.h"
+namespace Net
+{
+ class MessageIn;
+}
namespace Ea
{
+class GuildTab;
class GuildHandler : public Net::GuildHandler
{
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 74f0a4ba7..2262a79f9 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -29,6 +29,8 @@
#include "gui/windows/ministatuswindow.h"
+#include "net/messagein.h"
+
#include "net/ea/eaprotocol.h"
#include "debug.h"
@@ -150,7 +152,7 @@ int InventoryHandler::convertFromServerSlot(const int serverSlot) const
return EQUIP_CONVERT[serverSlot];
}
-int InventoryHandler::getSlot(const int eAthenaSlot) const
+int InventoryHandler::getSlot(const int eAthenaSlot)
{
if (eAthenaSlot == 0)
return Equipment::EQUIP_VECTOREND;
@@ -158,7 +160,7 @@ int InventoryHandler::getSlot(const int eAthenaSlot) const
if (eAthenaSlot & 0x8000)
return Equipment::EQUIP_PROJECTILE_SLOT;
- int mask = 1;
+ unsigned int mask = 1;
int position = 0;
while (!(eAthenaSlot & mask))
{
@@ -564,7 +566,7 @@ void InventoryHandler::processPlayerUnEquip(Net::MessageIn &msg)
miniStatusWindow->updateArrows();
}
-void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg) const
+void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg)
{
const int range = msg.readInt16();
if (player_node)
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index 6e8ecec38..ac88c1d6c 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -33,11 +33,15 @@
#include "gui/windows/inventorywindow.h"
#include "net/inventoryhandler.h"
-#include "net/messagein.h"
#include <vector>
#include <queue>
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
@@ -171,7 +175,7 @@ class InventoryHandler : public Net::InventoryHandler
void pushPickup(const int floorId)
{ mSentPickups.push(floorId); }
- int getSlot(const int eAthenaSlot) const A_WARN_UNUSED;
+ static int getSlot(const int eAthenaSlot) A_WARN_UNUSED;
void processPlayerInventory(Net::MessageIn &msg,
const bool playerInvintory);
@@ -200,7 +204,7 @@ class InventoryHandler : public Net::InventoryHandler
void processPlayerUnEquip(Net::MessageIn &msg);
- void processPlayerAttackRange(Net::MessageIn &msg) const;
+ static void processPlayerAttackRange(Net::MessageIn &msg);
void processPlayerArrowEquip(Net::MessageIn &msg);
diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp
index 9ce85a59b..383ba2753 100644
--- a/src/net/ea/itemhandler.cpp
+++ b/src/net/ea/itemhandler.cpp
@@ -24,6 +24,8 @@
#include "actormanager.h"
+#include "net/messagein.h"
+
#include "debug.h"
namespace Ea
diff --git a/src/net/ea/itemhandler.h b/src/net/ea/itemhandler.h
index 6bc23fb10..80c0a4dbf 100644
--- a/src/net/ea/itemhandler.h
+++ b/src/net/ea/itemhandler.h
@@ -25,6 +25,13 @@
#include "net/messagein.h"
+#include "localconsts.h"
+
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 57edcefbf..44d834b94 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -32,6 +32,8 @@
#include "utils/gettext.h"
#include "utils/paths.h"
+#include "net/messagein.h"
+
#include "debug.h"
namespace Ea
@@ -68,12 +70,7 @@ void LoginHandler::loginAccount(LoginData *const loginData1) const
{
if (loginData1)
{
- // Since we're attempting to use the tAthena protocol,
- // let's reset the character slots to the good value,
- // in case we just logged out a Manaserv server
- // with a different config.
loginData1->resetCharacterSlots();
-
sendLoginRegister(loginData1->username, loginData1->password, "");
}
}
diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h
index 8fea9d49f..f539176f5 100644
--- a/src/net/ea/loginhandler.h
+++ b/src/net/ea/loginhandler.h
@@ -24,7 +24,6 @@
#define NET_EA_LOGINHANDLER_H
#include "net/loginhandler.h"
-#include "net/messagein.h"
#include "net/ea/token.h"
@@ -32,6 +31,11 @@
class LoginData;
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp
index 70c4ce08a..03def7298 100644
--- a/src/net/ea/npchandler.cpp
+++ b/src/net/ea/npchandler.cpp
@@ -24,6 +24,8 @@
#include "gui/windows/npcdialog.h"
+#include "net/messagein.h"
+
#include "debug.h"
namespace Ea
diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h
index b8a10bc18..07c281587 100644
--- a/src/net/ea/npchandler.h
+++ b/src/net/ea/npchandler.h
@@ -23,11 +23,17 @@
#ifndef NET_EA_NPCHANDLER_H
#define NET_EA_NPCHANDLER_H
-#include "net/messagein.h"
#include "net/npchandler.h"
+#include "localconsts.h"
+
class NpcDialog;
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 98dec750a..4e4cac3df 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -25,11 +25,16 @@
#include "configuration.h"
#include "notifications.h"
#include "notifymanager.h"
+#include "party.h"
#include "being/localplayer.h"
#include "gui/windows/socialwindow.h"
+#include "net/messagein.h"
+
+#include "net/ea/gui/partytab.h"
+
#include "debug.h"
namespace Ea
@@ -55,7 +60,7 @@ void PartyHandler::join(const int partyId A_UNUSED) const
{
}
-void PartyHandler::reload() const
+void PartyHandler::reload()
{
taParty = Party::getParty(1);
}
diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h
index e7ab8f8ef..24923bd4a 100644
--- a/src/net/ea/partyhandler.h
+++ b/src/net/ea/partyhandler.h
@@ -22,15 +22,18 @@
#ifndef NET_EA_PARTYHANDLER_H
#define NET_EA_PARTYHANDLER_H
-#include "net/messagein.h"
#include "net/partyhandler.h"
-#include "net/ea/gui/partytab.h"
+class Party;
-#include "party.h"
+namespace Net
+{
+ class MessageIn;
+}
namespace Ea
{
+class PartyTab;
class PartyHandler : public Net::PartyHandler
{
@@ -49,7 +52,7 @@ class PartyHandler : public Net::PartyHandler
PartyShare getShareItems() const override final A_WARN_UNUSED
{ return mShareItems; }
- void reload() const;
+ static void reload();
void clear() const override final;
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 3e5db9169..de376cead 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -41,6 +41,7 @@
#include "resources/db/deaddb.h"
+#include "net/messagein.h"
#include "net/net.h"
#include "net/ea/eaprotocol.h"
@@ -60,9 +61,9 @@ namespace
/**
* Listener used for handling the overweigth message.
*/
- struct WeightListener final : public gcn::ActionListener
+ struct WeightListener final : public ActionListener
{
- void action(const gcn::ActionEvent &event A_UNUSED)
+ void action(const ActionEvent &event A_UNUSED)
{
weightNotice = nullptr;
}
@@ -71,9 +72,9 @@ namespace
/**
* Listener used for handling death message.
*/
- struct DeathListener final : public gcn::ActionListener
+ struct DeathListener final : public ActionListener
{
- void action(const gcn::ActionEvent &event A_UNUSED)
+ void action(const ActionEvent &event A_UNUSED)
{
if (Net::getPlayerHandler())
Net::getPlayerHandler()->respawn();
diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h
index 589874e2e..087627f92 100644
--- a/src/net/ea/playerhandler.h
+++ b/src/net/ea/playerhandler.h
@@ -23,9 +23,13 @@
#ifndef NET_EA_PLAYERHANDLER_H
#define NET_EA_PLAYERHANDLER_H
-#include "net/messagein.h"
#include "net/playerhandler.h"
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp
index 3a5a1ab75..fd10a6087 100644
--- a/src/net/ea/skillhandler.cpp
+++ b/src/net/ea/skillhandler.cpp
@@ -33,6 +33,8 @@
#include "utils/stringutils.h"
+#include "net/messagein.h"
+
#include "debug.h"
/** job dependend identifiers (?) */
diff --git a/src/net/ea/skillhandler.h b/src/net/ea/skillhandler.h
index 8dc724e0a..484ca6878 100644
--- a/src/net/ea/skillhandler.h
+++ b/src/net/ea/skillhandler.h
@@ -23,9 +23,15 @@
#ifndef NET_EA_SKILLHANDLER_H
#define NET_EA_SKILLHANDLER_H
-#include "net/messagein.h"
#include "net/skillhandler.h"
+#include "localconsts.h"
+
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 9457a31db..19e597967 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -34,6 +34,7 @@
#include "gui/windows/confirmdialog.h"
#include "gui/windows/tradewindow.h"
+#include "net/messagein.h"
#include "net/net.h"
#include "net/ea/eaprotocol.h"
@@ -48,9 +49,9 @@ ConfirmDialog *confirmDlg = nullptr;
*/
namespace
{
- struct RequestTradeListener : public gcn::ActionListener
+ struct RequestTradeListener : public ActionListener
{
- void action(const gcn::ActionEvent &event)
+ void action(const ActionEvent &event)
{
confirmDlg = nullptr;
const std::string &eventId = event.getId();
diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h
index 22a78e9e6..d4c9510b8 100644
--- a/src/net/ea/tradehandler.h
+++ b/src/net/ea/tradehandler.h
@@ -23,9 +23,13 @@
#ifndef NET_EA_TRADEHANDLER_H
#define NET_EA_TRADEHANDLER_H
-#include "net/messagein.h"
#include "net/tradehandler.h"
+namespace Net
+{
+ class MessageIn;
+}
+
namespace Ea
{
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 61e0a8404..a9d11f563 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -24,8 +24,7 @@
#include "being/localplayer.h"
-#include "gui/widgets/tabs/chattab.h"
-
+#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
#include <string>
diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h
index 9c6b8ea0c..3efaf2d31 100644
--- a/src/net/eathena/chathandler.h
+++ b/src/net/eathena/chathandler.h
@@ -26,10 +26,10 @@
#include "net/ea/chathandler.h"
#include "net/eathena/messagehandler.h"
-#include "net/eathena/messageout.h"
namespace EAthena
{
+class MessageOut;
class ChatHandler final : public MessageHandler, public Ea::ChatHandler
{
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index ebb5d46d7..3a18dede9 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -33,6 +33,7 @@
#include "net/ea/guildhandler.h"
+#include "net/ea/gui/guildtab.h"
#include "net/ea/gui/partytab.h"
#include "net/eathena/adminhandler.h"
diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp
index 3ac6a417e..ff16f5dd0 100644
--- a/src/net/eathena/messageout.cpp
+++ b/src/net/eathena/messageout.cpp
@@ -96,7 +96,7 @@ void MessageOut::writeCoordinates(const uint16_t x,
mNetwork->mOutSize += 3;
mPos += 3;
- int16_t temp = x;
+ uint16_t temp = x;
temp <<= 6;
data[0] = 0;
data[1] = 1;
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 56d4f5aae..0162d82e8 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -24,6 +24,7 @@
#include "logger.h"
+#include "net/eathena/messagehandler.h"
#include "net/eathena/messagein.h"
#include "net/eathena/protocol.h"
diff --git a/src/net/eathena/network.h b/src/net/eathena/network.h
index 4c9349f96..fae4f06d5 100644
--- a/src/net/eathena/network.h
+++ b/src/net/eathena/network.h
@@ -25,8 +25,6 @@
#include "net/ea/network.h"
-#include "net/eathena/messagehandler.h"
-
/**
* Protocol version, reported to the eAthena char and mapserver who can adjust
* the protocol accordingly.
@@ -35,6 +33,7 @@
namespace EAthena
{
+class MessageHandler;
class Network final : public Ea::Network
{
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index fcc650171..cfec2fe81 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -24,6 +24,7 @@
#include "actormanager.h"
#include "notifications.h"
#include "notifymanager.h"
+#include "party.h"
#include "being/localplayer.h"
diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h
index 0c3fa27ff..91c2e4603 100644
--- a/src/net/loginhandler.h
+++ b/src/net/loginhandler.h
@@ -36,11 +36,6 @@ namespace Net
class LoginHandler
{
public:
- /**
- * This enum describes options specific to either eAthena or Manaserv.
- * By querying for these flags, the GUI can adapt to the current
- * server type dynamically.
- */
enum OptionalAction
{
Unregister = 0x1,
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 9d9c68b94..121e1e58f 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -59,22 +59,6 @@ unsigned char MessageIn::readInt8()
return value;
}
-void MessageIn::readCoordinates(uint16_t &restrict x, uint16_t &restrict y)
-{
- if (mPos + 3 <= mLength)
- {
- const unsigned char *const p
- = reinterpret_cast<unsigned char const *const>(mData + mPos);
- x = static_cast<uint16_t>(p[0] | ((p[1] & 0x07) << 8));
- y = static_cast<uint16_t>((p[1] >> 3) | ((p[2] & 0x3F) << 5));
- }
- mPos += 3;
- PacketCounters::incInBytes(3);
- DEBUGLOG(std::string("readCoordinates: ").append(toString(
- static_cast<int>(x))).append(",").append(toString(
- static_cast<int>(y))));
-}
-
uint8_t MessageIn::fromServerDirection(const uint8_t serverDir)
{
// Translate from eAthena format
@@ -97,10 +81,7 @@ uint8_t MessageIn::fromServerDirection(const uint8_t serverDir)
case 7:
return 9;
case 8:
-#ifdef MANASERV_SUPPORT
- if (Net::getNetworkType() != ServerInfo::MANASERV)
-#endif
- return 8;
+ return 8;
default:
logger->log("incorrect direction: %d",
static_cast<int>(serverDir));
@@ -115,7 +96,7 @@ void MessageIn::readCoordinates(uint16_t &restrict x, uint16_t &restrict y,
if (mPos + 3 <= mLength)
{
const char *const data = mData + mPos;
- int16_t temp = MAKEWORD(data[1] & 0x00c0, data[0] & 0x00ff);
+ uint16_t temp = MAKEWORD(data[1] & 0x00c0, data[0] & 0x00ff);
x = static_cast<uint16_t>(temp >> 6);
temp = MAKEWORD(data[2] & 0x00f0, data[1] & 0x003f);
y = static_cast<uint16_t>(temp >> 4);
@@ -147,7 +128,7 @@ void MessageIn::readCoordinatePair(uint16_t &restrict srcX,
if (mPos + 5 <= mLength)
{
const char *const data = mData + mPos;
- int16_t temp = MAKEWORD(data[3], data[2] & 0x000f);
+ uint16_t temp = MAKEWORD(data[3], data[2] & 0x000f);
dstX = static_cast<uint16_t>(temp >> 2);
dstY = MAKEWORD(data[4], data[3] & 0x0003);
diff --git a/src/net/messagein.h b/src/net/messagein.h
index c3ed294c3..7b2b2400b 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -65,13 +65,6 @@ class MessageIn
virtual int readInt32() = 0; /**< Reads a long. */
/**
- * Reads a 3-byte block containing tile-based coordinates. Used by
- * manaserv.
- */
- virtual void readCoordinates(uint16_t &restrict x,
- uint16_t &restrict y);
-
- /**
* Reads a special 3 byte block used by eAthena, containing x and y
* coordinates and direction.
*/
diff --git a/src/net/net.cpp b/src/net/net.cpp
index c7a4f33f7..90cf9e16a 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -32,10 +32,6 @@
#include "net/eathena/generalhandler.h"
#endif
-#ifdef MANASERV_SUPPORT
-#include "net/manaserv/generalhandler.h"
-#endif
-
#include "debug.h"
Net::AdminHandler *adminHandler = nullptr;
@@ -162,13 +158,6 @@ void connectToServer(const ServerInfo &server)
new TmwAthena::GeneralHandler;
#endif
break;
- case ServerInfo::MANASERV:
-#ifdef MANASERV_SUPPORT
- new ManaServ::GeneralHandler;
-#else
- new TmwAthena::GeneralHandler;
-#endif
- break;
case ServerInfo::TMWATHENA:
case ServerInfo::UNKNOWN:
default:
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h
index 0b17184fd..48f216855 100644
--- a/src/net/serverinfo.h
+++ b/src/net/serverinfo.h
@@ -38,7 +38,6 @@ public:
enum Type
{
UNKNOWN = 0,
- MANASERV,
TMWATHENA,
EVOL,
EATHENA
@@ -139,10 +138,6 @@ public:
else if (compareStrI(serverType, "eathena") == 0)
return TMWATHENA;
#endif
-#ifdef MANASERV_SUPPORT
- else if (compareStrI(serverType, "manaserv") == 0)
- return MANASERV;
-#endif
return UNKNOWN;
}
};
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index af236f00b..d00f12dd3 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -24,8 +24,7 @@
#include "being/localplayer.h"
-#include "gui/widgets/tabs/chattab.h"
-
+#include "net/tmwa/messageout.h"
#include "net/tmwa/protocol.h"
#include <string>
diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h
index a7226c52c..c4f51fec7 100644
--- a/src/net/tmwa/chathandler.h
+++ b/src/net/tmwa/chathandler.h
@@ -26,10 +26,10 @@
#include "net/ea/chathandler.h"
#include "net/tmwa/messagehandler.h"
-#include "net/tmwa/messageout.h"
namespace TmwAthena
{
+class MessageOut;
class ChatHandler final : public MessageHandler, public Ea::ChatHandler
{
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 683eb0711..46d1d490f 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -33,6 +33,7 @@
#include "net/ea/guildhandler.h"
+#include "net/ea/gui/guildtab.h"
#include "net/ea/gui/partytab.h"
#include "net/tmwa/adminhandler.h"
diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp
index 8dfbf2bd7..8c3ecb5ec 100644
--- a/src/net/tmwa/messageout.cpp
+++ b/src/net/tmwa/messageout.cpp
@@ -98,7 +98,7 @@ void MessageOut::writeCoordinates(const uint16_t x,
mNetwork->mOutSize += 3;
mPos += 3;
- int16_t temp = x;
+ uint16_t temp = x;
temp <<= 6;
data[0] = 0;
data[1] = 1;
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index c91387898..cc94b6161 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -24,6 +24,7 @@
#include "logger.h"
+#include "net/tmwa/messagehandler.h"
#include "net/tmwa/messagein.h"
#include "net/tmwa/protocol.h"
diff --git a/src/net/tmwa/network.h b/src/net/tmwa/network.h
index 6d05d0e48..bf9381227 100644
--- a/src/net/tmwa/network.h
+++ b/src/net/tmwa/network.h
@@ -25,8 +25,6 @@
#include "net/ea/network.h"
-#include "net/tmwa/messagehandler.h"
-
/**
* Protocol version, reported to the eAthena char and mapserver who can adjust
* the protocol accordingly.
@@ -36,6 +34,7 @@
namespace TmwAthena
{
+class MessageHandler;
class Network final : public Ea::Network
{
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index 78d56f669..ba18a9efa 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -24,6 +24,7 @@
#include "actormanager.h"
#include "notifications.h"
#include "notifymanager.h"
+#include "party.h"
#include "being/localplayer.h"
diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp
index 6b9e5adb7..3293b7edd 100644
--- a/src/net/tmwa/pethandler.cpp
+++ b/src/net/tmwa/pethandler.cpp
@@ -24,8 +24,7 @@
#include "net/net.h"
-#include "net/tmwa/chathandler.h"
-#include "net/tmwa/protocol.h"
+#include "net/chathandler.h"
#include "debug.h"
diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h
index 823352239..21ca65e97 100644
--- a/src/net/tradehandler.h
+++ b/src/net/tradehandler.h
@@ -29,6 +29,8 @@
#include "localconsts.h"
+class Item;
+
namespace Net
{
class TradeHandler