summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorDaniel Bradshaw <daniel+commits@the-cell.co.uk>2010-01-31 13:14:07 +0000
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-01-31 17:50:29 +0100
commit2ff6ad2e8a67bd8ef34b56b866ef277c30135f19 (patch)
tree536497f63044441a6e8032209446d1c3213b9d55 /src/net
parent22c75a346e029fad746b6aa0b123c886ddeb5c75 (diff)
downloadmana-client-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.gz
mana-client-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.bz2
mana-client-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.xz
mana-client-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.zip
Unify eAthena and manaserv support in to one build.
Finish support for server types in the server dialog. Using the new server type function, strip out ifdefs, replacing them with if blocks for later merging in smaller atomic commits. Remove any remaining references to the support defs, including in build system.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/playerhandler.cpp10
-rw-r--r--src/net/ea/playerhandler.h2
-rw-r--r--src/net/ea/tradehandler.cpp2
-rw-r--r--src/net/manaserv/playerhandler.cpp10
-rw-r--r--src/net/manaserv/playerhandler.h2
-rw-r--r--src/net/manaserv/tradehandler.cpp2
-rw-r--r--src/net/net.cpp34
-rw-r--r--src/net/net.h4
-rw-r--r--src/net/playerhandler.h2
9 files changed, 34 insertions, 34 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 0965e85a..156e8b26 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -47,9 +47,8 @@
#include "utils/stringutils.h"
#include "utils/gettext.h"
-// TODO Move somewhere else
-OkDialog *weightNotice = NULL;
-OkDialog *deathNotice = NULL;
+extern OkDialog *weightNotice;
+extern OkDialog *deathNotice;
// Max. distance we are willing to scroll after a teleport;
// everything beyond will reset the port hard.
@@ -638,4 +637,9 @@ int PlayerHandler::getJobLocation()
return JOB;
}
+float PlayerHandler::getDefaultWalkSpeed()
+{
+ return 150;
+}
+
} // namespace EAthena
diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h
index 61f3b705..83ca91f6 100644
--- a/src/net/ea/playerhandler.h
+++ b/src/net/ea/playerhandler.h
@@ -65,6 +65,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler
bool canCorrectAttributes();
int getJobLocation();
+
+ float getDefaultWalkSpeed();
};
} // namespace EAthena
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 56528a85..abcfc04f 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -40,7 +40,7 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
-std::string tradePartnerName;
+extern std::string tradePartnerName;
ConfirmDialog *confirmDlg;
/**
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index 60274288..0d7544fd 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -42,9 +42,8 @@
#include "net/manaserv/messageout.h"
#include "net/manaserv/protocol.h"
-// TODO Move somewhere else
-OkDialog *weightNotice = NULL;
-OkDialog *deathNotice = NULL;
+extern OkDialog *weightNotice;
+extern OkDialog *deathNotice;
extern BuyDialog *buyDialog;
extern SellDialog *sellDialog;
@@ -424,4 +423,9 @@ int PlayerHandler::getJobLocation()
return -1;
}
+float PlayerHandler::getDefaultWalkSpeed()
+{
+ return 6.0f;
+}
+
} // namespace ManaServ
diff --git a/src/net/manaserv/playerhandler.h b/src/net/manaserv/playerhandler.h
index 37d485f8..22be69f3 100644
--- a/src/net/manaserv/playerhandler.h
+++ b/src/net/manaserv/playerhandler.h
@@ -73,6 +73,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler
int getJobLocation();
+ float getDefaultWalkSpeed();
+
private:
void handleMapChangeMessage(Net::MessageIn &msg);
};
diff --git a/src/net/manaserv/tradehandler.cpp b/src/net/manaserv/tradehandler.cpp
index 5eedbec8..7f7be6bf 100644
--- a/src/net/manaserv/tradehandler.cpp
+++ b/src/net/manaserv/tradehandler.cpp
@@ -40,7 +40,7 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
-std::string tradePartnerName;
+extern std::string tradePartnerName;
int tradePartnerID;
extern Net::TradeHandler *tradeHandler;
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 593d9cb7..75f8229c 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -126,41 +126,20 @@ ServerInfo::Type networkType = ServerInfo::UNKNOWN;
void connectToServer(const ServerInfo &server)
{
- // Remove with ifdefs
- if (networkType != ServerInfo::UNKNOWN)
- {
- getGeneralHandler()->reload();
- }
- else
- {
-#ifdef MANASERV_SUPPORT
- new ManaServ::GeneralHandler;
-#else
- new EAthena::GeneralHandler;
-#endif
-
- getGeneralHandler()->load();
-
- networkType = server.type;
- }
- // End remove section
-
- // Uncomment after ifdefs removed
- /*ServerInfo server = ServerInfo(inServer);
if (server.type == ServerInfo::UNKNOWN)
{
// TODO: Query the server about itself and choose the netcode based on
// that
}
- //if (networkType == server.type)
- if (networkType != ServerInfo::UNKNOWN)
+ if (networkType == server.type && getGeneralHandler() != NULL)
+ //if (networkType != ServerInfo::UNKNOWN)
{
getGeneralHandler()->reload();
}
else
{
- if (networkType != ServerInfo::UNKNOWN)
+ if (networkType != ServerInfo::UNKNOWN && getGeneralHandler() != NULL)
{
getGeneralHandler()->unload();
}
@@ -183,7 +162,7 @@ void connectToServer(const ServerInfo &server)
getGeneralHandler()->load();
networkType = server.type;
- }*/
+ }
getLoginHandler()->setServer(server);
@@ -199,5 +178,10 @@ void unload()
}
}
+ServerInfo::Type getNetworkType()
+{
+ return networkType;
+}
+
} // namespace Net
diff --git a/src/net/net.h b/src/net/net.h
index d6bb7d39..e26a4b2d 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -26,7 +26,7 @@
* \defgroup Network Core network layer
*/
-class ServerInfo;
+#include "net/serverinfo.h"
namespace Net {
@@ -58,6 +58,8 @@ PlayerHandler *getPlayerHandler();
SpecialHandler *getSpecialHandler();
TradeHandler *getTradeHandler();
+ServerInfo::Type getNetworkType();
+
/**
* Handles server detection and connection
*/
diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h
index d190be01..cc135c7e 100644
--- a/src/net/playerhandler.h
+++ b/src/net/playerhandler.h
@@ -61,6 +61,8 @@ class PlayerHandler
virtual int getJobLocation() = 0;
+ virtual float getDefaultWalkSpeed() = 0;
+
virtual ~PlayerHandler() {}
};