summaryrefslogtreecommitdiff
path: root/src/net/net.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-02 17:26:44 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-02 17:27:39 +0100
commit72ceaaa426166bfa425f519c2418a66872839e12 (patch)
tree1ce7253fc629d4df445b89b2f533899341f03fc5 /src/net/net.cpp
parent78d6d9352f66f41963207b04a999d94c17d67cf2 (diff)
downloadmana-72ceaaa426166bfa425f519c2418a66872839e12.tar.gz
mana-72ceaaa426166bfa425f519c2418a66872839e12.tar.bz2
mana-72ceaaa426166bfa425f519c2418a66872839e12.tar.xz
mana-72ceaaa426166bfa425f519c2418a66872839e12.zip
Changed server type to "enum class"
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r--src/net/net.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp
index c060d2e8..86f7dc13 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -125,18 +125,18 @@ Net::TradeHandler *Net::getTradeHandler()
namespace Net
{
-ServerInfo::Type networkType = ServerInfo::UNKNOWN;
+ServerType networkType = ServerType::UNKNOWN;
void connectToServer(ServerInfo &server)
{
- if (server.type == ServerInfo::UNKNOWN)
+ if (server.type == ServerType::UNKNOWN)
{
// TODO: Query the server about itself and choose the netcode based on
// that
if (server.port == 6901)
- server.type = ServerInfo::TMWATHENA;
+ server.type = ServerType::TMWATHENA;
else if (server.port == 9601)
- server.type = ServerInfo::MANASERV;
+ server.type = ServerType::MANASERV;
else
logger->error(_("Unknown Server Type! Exiting."));
}
@@ -147,7 +147,7 @@ void connectToServer(ServerInfo &server)
}
else
{
- if (networkType != ServerInfo::UNKNOWN && getGeneralHandler() != nullptr)
+ if (networkType != ServerType::UNKNOWN && getGeneralHandler() != nullptr)
{
getGeneralHandler()->unload();
}
@@ -155,11 +155,11 @@ void connectToServer(ServerInfo &server)
switch (server.type)
{
#ifdef MANASERV_SUPPORT
- case ServerInfo::MANASERV:
+ case ServerType::MANASERV:
new ManaServ::GeneralHandler;
break;
#endif
- case ServerInfo::TMWATHENA:
+ case ServerType::TMWATHENA:
new TmwAthena::GeneralHandler;
break;
default:
@@ -186,7 +186,7 @@ void unload()
}
}
-ServerInfo::Type getNetworkType()
+ServerType getNetworkType()
{
return networkType;
}