summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-15 02:19:06 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-15 02:19:06 +0200
commitfbe26b0e48e6f3714900833174fcf42196e86fc8 (patch)
tree0f9528f2ad25c50e55a13e6fd60bf545f48ebf88 /src/Common
parent082dac7a8cb39ec1b005680680c4f3e1e8ddc256 (diff)
downloadmad-fbe26b0e48e6f3714900833174fcf42196e86fc8.tar
mad-fbe26b0e48e6f3714900833174fcf42196e86fc8.zip
Identifikationsinformationen im ConnectionManager speichern
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/RequestHandlers/IdentifyRequestHandler.cpp48
-rw-r--r--src/Common/RequestHandlers/IdentifyRequestHandler.h40
-rw-r--r--src/Common/RequestHandlers/Makefile.am4
-rw-r--r--src/Common/RequestHandlers/Makefile.in8
-rw-r--r--src/Common/RequestManager.cpp2
5 files changed, 5 insertions, 97 deletions
diff --git a/src/Common/RequestHandlers/IdentifyRequestHandler.cpp b/src/Common/RequestHandlers/IdentifyRequestHandler.cpp
deleted file mode 100644
index d17c3b2..0000000
--- a/src/Common/RequestHandlers/IdentifyRequestHandler.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * IdentifyRequestHandler.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 "IdentifyRequestHandler.h"
-#include <Net/Connection.h>
-
-namespace Mad {
-namespace Common {
-namespace RequestHandlers {
-
-bool IdentifyRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
- if(isFinished())
- return false;
-
- if(packet.getType() != Net::Packet::IDENTIFY)
- return false; // TODO Logging
-
- // TODO Require authentication
-
- connection->setName(std::string((const char*)packet.getData(), packet.getLength()));
-
- if(!connection->send(Net::Packet(Net::Packet::OK, packet.getRequestId())))
- return false;
-
- setFinished();
-
- return true;
-}
-
-}
-}
-}
diff --git a/src/Common/RequestHandlers/IdentifyRequestHandler.h b/src/Common/RequestHandlers/IdentifyRequestHandler.h
deleted file mode 100644
index 6bd4b31..0000000
--- a/src/Common/RequestHandlers/IdentifyRequestHandler.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * IdentifyRequestHandler.h
- *
- * 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/>.
- */
-
-#ifndef MAD_COMMON_REQUESTHANDLERS_IDENTIFYREQUESTHANDLER_H_
-#define MAD_COMMON_REQUESTHANDLERS_IDENTIFYREQUESTHANDLER_H_
-
-#include "../RequestHandler.h"
-
-namespace Mad {
-namespace Common {
-namespace RequestHandlers {
-
-class IdentifyRequestHandler : public RequestHandler {
- public:
- IdentifyRequestHandler() {}
-
- virtual bool handlePacket(Net::Connection *connection, const Net::Packet &packet);
-};
-
-}
-}
-}
-
-#endif /* MAD_COMMON_REQUESTHANDLERS_IDENTIFYREQUESTHANDLER_H_ */
diff --git a/src/Common/RequestHandlers/Makefile.am b/src/Common/RequestHandlers/Makefile.am
index a8aac28..9133148 100644
--- a/src/Common/RequestHandlers/Makefile.am
+++ b/src/Common/RequestHandlers/Makefile.am
@@ -1,5 +1,5 @@
noinst_LTLIBRARIES = librequesthandlers.la
-librequesthandlers_la_SOURCES = DisconnectRequestHandler.cpp IdentifyRequestHandler.cpp
+librequesthandlers_la_SOURCES = DisconnectRequestHandler.cpp
-noinst_HEADERS = DisconnectRequestHandler.h IdentifyRequestHandler.h
+noinst_HEADERS = DisconnectRequestHandler.h
diff --git a/src/Common/RequestHandlers/Makefile.in b/src/Common/RequestHandlers/Makefile.in
index f149d99..c55394a 100644
--- a/src/Common/RequestHandlers/Makefile.in
+++ b/src/Common/RequestHandlers/Makefile.in
@@ -45,8 +45,7 @@ CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
librequesthandlers_la_LIBADD =
-am_librequesthandlers_la_OBJECTS = DisconnectRequestHandler.lo \
- IdentifyRequestHandler.lo
+am_librequesthandlers_la_OBJECTS = DisconnectRequestHandler.lo
librequesthandlers_la_OBJECTS = $(am_librequesthandlers_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -185,8 +184,8 @@ target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = librequesthandlers.la
-librequesthandlers_la_SOURCES = DisconnectRequestHandler.cpp IdentifyRequestHandler.cpp
-noinst_HEADERS = DisconnectRequestHandler.h IdentifyRequestHandler.h
+librequesthandlers_la_SOURCES = DisconnectRequestHandler.cpp
+noinst_HEADERS = DisconnectRequestHandler.h
all: all-am
.SUFFIXES:
@@ -239,7 +238,6 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DisconnectRequestHandler.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IdentifyRequestHandler.Plo@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/src/Common/RequestManager.cpp b/src/Common/RequestManager.cpp
index 93bbea5..8ebfce0 100644
--- a/src/Common/RequestManager.cpp
+++ b/src/Common/RequestManager.cpp
@@ -20,7 +20,6 @@
#include "RequestManager.h"
#include "Request.h"
#include "RequestHandlers/DisconnectRequestHandler.h"
-#include "RequestHandlers/IdentifyRequestHandler.h"
#include <iostream>
@@ -140,7 +139,6 @@ void RequestManager::unregisterPacketType(Net::Packet::Type type) {
RequestManager::RequestManager(bool core) : requestId(core ? -2 : -1) {
registerPacketType<RequestHandlers::DisconnectRequestHandler>(Net::Packet::DISCONNECT);
- registerPacketType<RequestHandlers::IdentifyRequestHandler>(Net::Packet::IDENTIFY);
}
RequestManager::~RequestManager() {