summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-21 12:28:40 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-21 20:26:12 +0300
commitf4fe732ccbd65fd584b7787f3b5aec904a85d11b (patch)
tree5cf6023ab3713316326547026c10f2fb4ce6d8b8 /src/net
parentc78423448941517eeae0a60e703a5dc2976aed0c (diff)
downloadplus-f4fe732ccbd65fd584b7787f3b5aec904a85d11b.tar.gz
plus-f4fe732ccbd65fd584b7787f3b5aec904a85d11b.tar.bz2
plus-f4fe732ccbd65fd584b7787f3b5aec904a85d11b.tar.xz
plus-f4fe732ccbd65fd584b7787f3b5aec904a85d11b.zip
Fix code style.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/character.h7
-rw-r--r--src/net/charserverhandler.h3
-rw-r--r--src/net/download.cpp14
-rw-r--r--src/net/downloadstatus.h14
-rw-r--r--src/net/ea/equipbackend.h3
-rw-r--r--src/net/ea/inventoryhandler.h6
-rw-r--r--src/net/ea/playerhandler.cpp2
-rw-r--r--src/net/ea/tradehandler.cpp1
-rw-r--r--src/net/eathena/attrs.h2
-rw-r--r--src/net/eathena/generalhandler.cpp1
-rw-r--r--src/net/eathena/loginhandler.h2
-rw-r--r--src/net/eathena/partyhandler.h2
-rw-r--r--src/net/tmwa/generalhandler.cpp1
-rw-r--r--src/net/tmwa/loginhandler.cpp2
-rw-r--r--src/net/tmwa/partyhandler.h2
15 files changed, 24 insertions, 38 deletions
diff --git a/src/net/character.h b/src/net/character.h
index 89789335c..1b5113627 100644
--- a/src/net/character.h
+++ b/src/net/character.h
@@ -23,14 +23,15 @@
#ifndef NET_CHARACTER_H
#define NET_CHARACTER_H
+#include "being/localplayer.h"
+#include "being/playerinfo.h"
+
#include "utils/delete2.h"
#include <string>
#include <vector>
-class LocalPlayer;
-
-struct PlayerInfoBackend;
+#include "localconsts.h"
namespace Net
{
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index 744ee685b..f552f6ba7 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -24,9 +24,6 @@
#define NET_CHARSERVERHANDLER_H
#include "being/localplayer.h"
-#include "being/playerinfo.h"
-
-#include "utils/delete2.h"
#include <string>
#include <vector>
diff --git a/src/net/download.cpp b/src/net/download.cpp
index c61e42e0c..011182a7e 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -202,7 +202,7 @@ bool Download::start()
logger->log1(DOWNLOAD_ERROR_MESSAGE_THREAD);
if (mError)
strcpy(mError, DOWNLOAD_ERROR_MESSAGE_THREAD);
- mUpdateFunction(mPtr, DownloadStatus::THREAD_ERROR, 0, 0);
+ mUpdateFunction(mPtr, DownloadStatus::ThreadError, 0, 0);
if (!mIgnoreError)
return false;
}
@@ -239,12 +239,12 @@ int Download::downloadProgress(void *clientp, double dltotal, double dlnow,
if (d->mOptions.cancel)
{
- return d->mUpdateFunction(d->mPtr, DownloadStatus::CANCELLED,
+ return d->mUpdateFunction(d->mPtr, DownloadStatus::Cancelled,
static_cast<size_t>(dltotal),
static_cast<size_t>(dlnow));
}
- return d->mUpdateFunction(d->mPtr, DownloadStatus::IDLE,
+ return d->mUpdateFunction(d->mPtr, DownloadStatus::Idle,
static_cast<size_t>(dltotal),
static_cast<size_t>(dlnow));
}
@@ -283,7 +283,7 @@ int Download::downloadThread(void *ptr)
logger->log_r("selected url: %s", d->mUrl.c_str());
while (attempts < 3 && !complete && !d->mOptions.cancel)
{
- d->mUpdateFunction(d->mPtr, DownloadStatus::STARTING, 0, 0);
+ d->mUpdateFunction(d->mPtr, DownloadStatus::Starting, 0, 0);
if (d->mOptions.cancel)
{
@@ -372,7 +372,7 @@ int Download::downloadThread(void *ptr)
if (d->mOptions.cancel)
break;
-// d->mUpdateFunction(d->mPtr, DownloadStatus::ERROR, 0, 0);
+// d->mUpdateFunction(d->mPtr, DownloadStatus::Error, 0, 0);
if (file)
{
@@ -495,11 +495,11 @@ int Download::downloadThread(void *ptr)
}
else if (!complete || attempts >= 3)
{
- d->mUpdateFunction(d->mPtr, DownloadStatus::ERROR, 0, 0);
+ d->mUpdateFunction(d->mPtr, DownloadStatus::Error, 0, 0);
}
else
{
- d->mUpdateFunction(d->mPtr, DownloadStatus::COMPLETE, 0, 0);
+ d->mUpdateFunction(d->mPtr, DownloadStatus::Complete, 0, 0);
}
return 0;
diff --git a/src/net/downloadstatus.h b/src/net/downloadstatus.h
index 8c5066915..c927c0f19 100644
--- a/src/net/downloadstatus.h
+++ b/src/net/downloadstatus.h
@@ -26,13 +26,13 @@ namespace DownloadStatus
{
enum Type
{
- CANCELLED = -3,
- THREAD_ERROR = -2,
- ERROR = -1,
- STARTING = 0,
- IDLE,
- COMPLETE
+ Cancelled = -3,
+ ThreadError = -2,
+ Error = -1,
+ Starting = 0,
+ Idle,
+ Complete
};
-} // namespace Net
+} // namespace DownloadStatus
#endif // NET_DOWNLOADSTATUS_H
diff --git a/src/net/ea/equipbackend.h b/src/net/ea/equipbackend.h
index ff1813500..5a557eaa6 100644
--- a/src/net/ea/equipbackend.h
+++ b/src/net/ea/equipbackend.h
@@ -27,6 +27,9 @@
#include "inventory.h"
#include "item.h"
+#include "being/playerinfo.h"
+
+#include "gui/windows/inventorywindow.h"
namespace Ea
{
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index cd32f28a6..e26878f65 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -23,15 +23,9 @@
#ifndef NET_EA_INVENTORYHANDLER_H
#define NET_EA_INVENTORYHANDLER_H
-#include "equipment.h"
#include "inventory.h"
-#include "item.h"
#include "localconsts.h"
-#include "being/playerinfo.h"
-
-#include "gui/windows/inventorywindow.h"
-
#include "net/inventoryhandler.h"
#include "net/ea/equipbackend.h"
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index da38cce6a..0ed9f9a18 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -35,7 +35,6 @@
#include "gui/viewport.h"
#include "gui/windows/okdialog.h"
-#include "gui/windows/npcdialog.h"
#include "gui/windows/skilldialog.h"
#include "gui/windows/statuswindow.h"
@@ -48,7 +47,6 @@
#include "listeners/weightlistener.h"
#include "net/messagein.h"
-#include "net/net.h"
#include "net/ea/eaprotocol.h"
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 48d80c9ee..64e41646a 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -35,7 +35,6 @@
#include "gui/windows/tradewindow.h"
#include "net/messagein.h"
-#include "net/net.h"
#include "net/ea/eaprotocol.h"
diff --git a/src/net/eathena/attrs.h b/src/net/eathena/attrs.h
index dc3108ce0..d79e0de27 100644
--- a/src/net/eathena/attrs.h
+++ b/src/net/eathena/attrs.h
@@ -49,4 +49,4 @@ namespace EAthena
};
} // namespace EAthena
-#endif // NET_EATHENA_PROTOCOL_H
+#endif // NET_EATHENA_ATTRS_H
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index ea4444ea7..2b54be9cb 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -59,6 +59,7 @@
#include "resources/db/itemdbstat.h"
+#include "utils/delete2.h"
#include "utils/gettext.h"
#include "debug.h"
diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h
index 8be4f1397..5a5287da0 100644
--- a/src/net/eathena/loginhandler.h
+++ b/src/net/eathena/loginhandler.h
@@ -23,8 +23,6 @@
#ifndef NET_EATHENA_LOGINHANDLER_H
#define NET_EATHENA_LOGINHANDLER_H
-#include "net/loginhandler.h"
-
#include "net/ea/loginhandler.h"
#include "net/eathena/messagehandler.h"
diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h
index dd98a6fce..e80c1ed71 100644
--- a/src/net/eathena/partyhandler.h
+++ b/src/net/eathena/partyhandler.h
@@ -22,8 +22,6 @@
#ifndef NET_EATHENA_PARTYHANDLER_H
#define NET_EATHENA_PARTYHANDLER_H
-#include "net/partyhandler.h"
-
#include "net/eathena/messagehandler.h"
#include "net/ea/partyhandler.h"
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 57b8ee6d5..bc24c8bf2 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -61,6 +61,7 @@
#include "resources/db/itemdbstat.h"
+#include "utils/delete2.h"
#include "utils/gettext.h"
#include "debug.h"
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index eccbf0928..b9a1e7365 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -25,8 +25,6 @@
#include "client.h"
#include "logger.h"
-#include "net/registrationoptions.h"
-
#include "net/tmwa/messageout.h"
#include "net/tmwa/network.h"
#include "net/tmwa/protocol.h"
diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h
index 41e42097e..ec8800316 100644
--- a/src/net/tmwa/partyhandler.h
+++ b/src/net/tmwa/partyhandler.h
@@ -22,8 +22,6 @@
#ifndef NET_TMWA_PARTYHANDLER_H
#define NET_TMWA_PARTYHANDLER_H
-#include "net/partyhandler.h"
-
#include "net/tmwa/messagehandler.h"
#include "net/ea/partyhandler.h"