aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/clientopcodes.h3
-rw-r--r--src/network/connection.cpp14
-rw-r--r--src/network/connection.h12
-rw-r--r--src/network/networkpacket.cpp2
-rw-r--r--src/network/networkpacket.h2
-rw-r--r--src/network/serveropcodes.h3
6 files changed, 22 insertions, 14 deletions
diff --git a/src/network/clientopcodes.h b/src/network/clientopcodes.h
index 43a93bb4f..789c9c0bb 100644
--- a/src/network/clientopcodes.h
+++ b/src/network/clientopcodes.h
@@ -23,7 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client.h"
#include "networkprotocol.h"
-#include "networkpacket.h"
+
+class NetworkPacket;
enum ToClientConnectionState {
TOCLIENT_STATE_NOT_CONNECTED,
diff --git a/src/network/connection.cpp b/src/network/connection.cpp
index d1ab948db..c93971cac 100644
--- a/src/network/connection.cpp
+++ b/src/network/connection.cpp
@@ -564,6 +564,20 @@ void IncomingSplitBuffer::removeUnreliableTimedOuts(float dtime, float timeout)
}
/*
+ ConnectionCommand
+ */
+
+void ConnectionCommand::send(u16 peer_id_, u8 channelnum_, NetworkPacket *pkt,
+ bool reliable_)
+{
+ type = CONNCMD_SEND;
+ peer_id = peer_id_;
+ channelnum = channelnum_;
+ data = pkt->oldForgePacket();
+ reliable = reliable_;
+}
+
+/*
Channel
*/
diff --git a/src/network/connection.h b/src/network/connection.h
index 289c79125..3dc87b489 100644
--- a/src/network/connection.h
+++ b/src/network/connection.h
@@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "socket.h"
#include "exceptions.h"
#include "constants.h"
-#include "network/networkpacket.h"
#include "util/pointer.h"
#include "util/container.h"
#include "util/thread.h"
@@ -433,15 +432,8 @@ struct ConnectionCommand
type = CONNCMD_DISCONNECT_PEER;
peer_id = peer_id_;
}
- void send(u16 peer_id_, u8 channelnum_,
- NetworkPacket* pkt, bool reliable_)
- {
- type = CONNCMD_SEND;
- peer_id = peer_id_;
- channelnum = channelnum_;
- data = pkt->oldForgePacket();
- reliable = reliable_;
- }
+
+ void send(u16 peer_id_, u8 channelnum_, NetworkPacket* pkt, bool reliable_);
void ack(u16 peer_id_, u8 channelnum_, const SharedBuffer<u8> &data_)
{
diff --git a/src/network/networkpacket.cpp b/src/network/networkpacket.cpp
index 78c73d253..ab7ddfb57 100644
--- a/src/network/networkpacket.cpp
+++ b/src/network/networkpacket.cpp
@@ -18,7 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "networkpacket.h"
-#include "debug.h"
+#include <sstream>
#include "exceptions.h"
#include "util/serialize.h"
diff --git a/src/network/networkpacket.h b/src/network/networkpacket.h
index 7eb8cc3ff..40a20eb2e 100644
--- a/src/network/networkpacket.h
+++ b/src/network/networkpacket.h
@@ -20,9 +20,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef NETWORKPACKET_HEADER
#define NETWORKPACKET_HEADER
+#include <SColor.h>
#include "util/pointer.h"
#include "util/numeric.h"
-#include "networkprotocol.h"
class NetworkPacket
{
diff --git a/src/network/serveropcodes.h b/src/network/serveropcodes.h
index 72323ae24..296b7d471 100644
--- a/src/network/serveropcodes.h
+++ b/src/network/serveropcodes.h
@@ -23,7 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "server.h"
#include "networkprotocol.h"
-#include "networkpacket.h"
+
+class NetworkPacket;
enum ToServerConnectionState {
TOSERVER_STATE_NOT_CONNECTED,