diff options
Diffstat (limited to 'src/Net')
-rw-r--r-- | src/Net/Makefile.am | 2 | ||||
-rw-r--r-- | src/Net/Makefile.in | 5 | ||||
-rw-r--r-- | src/Net/Packet.cpp | 28 | ||||
-rw-r--r-- | src/Net/Packet.h | 8 |
4 files changed, 8 insertions, 35 deletions
diff --git a/src/Net/Makefile.am b/src/Net/Makefile.am index 8e49695..c7f58da 100644 --- a/src/Net/Makefile.am +++ b/src/Net/Makefile.am @@ -1,6 +1,6 @@ noinst_LTLIBRARIES = libnet.la -libnet_la_SOURCES = ClientConnection.cpp ServerConnection.cpp Connection.cpp Listener.cpp Packet.cpp +libnet_la_SOURCES = ClientConnection.cpp ServerConnection.cpp Connection.cpp Listener.cpp noinst_HEADERS = ClientConnection.h ServerConnection.h Connection.h Exception.h ConnectionException.h \ InvalidAddressException.h IPAddress.h Listener.h Packet.h diff --git a/src/Net/Makefile.in b/src/Net/Makefile.in index e99597e..9ce9a8e 100644 --- a/src/Net/Makefile.in +++ b/src/Net/Makefile.in @@ -46,7 +46,7 @@ CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libnet_la_LIBADD = am_libnet_la_OBJECTS = ClientConnection.lo ServerConnection.lo \ - Connection.lo Listener.lo Packet.lo + Connection.lo Listener.lo libnet_la_OBJECTS = $(am_libnet_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -181,7 +181,7 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libnet.la -libnet_la_SOURCES = ClientConnection.cpp ServerConnection.cpp Connection.cpp Listener.cpp Packet.cpp +libnet_la_SOURCES = ClientConnection.cpp ServerConnection.cpp Connection.cpp Listener.cpp noinst_HEADERS = ClientConnection.h ServerConnection.h Connection.h Exception.h ConnectionException.h \ InvalidAddressException.h IPAddress.h Listener.h Packet.h @@ -239,7 +239,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClientConnection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Listener.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Packet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ServerConnection.Plo@am__quote@ .cpp.o: diff --git a/src/Net/Packet.cpp b/src/Net/Packet.cpp deleted file mode 100644 index 9c90db7..0000000 --- a/src/Net/Packet.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Packet.cpp - * - * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de> - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "Packet.h" - -namespace Mad { -namespace Net { - - - -} -} diff --git a/src/Net/Packet.h b/src/Net/Packet.h index 7ef5cb0..c867ffa 100644 --- a/src/Net/Packet.h +++ b/src/Net/Packet.h @@ -36,7 +36,8 @@ class Packet { struct Data { unsigned short type; unsigned short requestId; - unsigned long length; + unsigned short reserved; + unsigned short length; unsigned char data[0]; }; @@ -44,11 +45,12 @@ class Packet { Data *rawData; public: - Packet(Type type, unsigned short requestId, const void *data = NULL, unsigned long length = 0) { + Packet(Type type, unsigned short requestId, const void *data = NULL, unsigned short length = 0) { rawData = (Data*)std::malloc(sizeof(Data)+length); rawData->type = type; rawData->requestId = requestId; + rawData->reserved = 0; rawData->length = length; if(length) @@ -84,7 +86,7 @@ class Packet { return rawData->requestId; } - unsigned long getLength() const { + unsigned short getLength() const { return rawData->length; } |