]> git.tdb.fi Git - r2c2.git/blobdiff - source/network/server.h
Separate train routing logic to a class derived from TrainAI
[r2c2.git] / source / network / server.h
index dc7543fe293278f09be6fb673731108500bae8bf..cfc8d7642c9e929e49a4624ff22547410f88fef7 100644 (file)
@@ -1,18 +1,12 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2009-2010  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #ifndef R2C2_NET_SERVER_H_
 #define R2C2_NET_SERVER_H_
 
 #include <msp/io/eventdispatcher.h>
 #include <msp/net/communicator.h>
 #include <msp/net/streamsocket.h>
-#include <msp/net/streamlistensocket.h>
+#include <msp/net/streamserversocket.h>
 #include "libr2c2/layout.h"
+#include "libr2c2/trainai.h"
 #include "packets.h"
 #include "protocol.h"
 
@@ -45,7 +39,7 @@ private:
 
        Protocol proto;
        Layout &layout;
-       Msp::Net::StreamListenSocket listen_sock;
+       Msp::Net::StreamServerSocket listen_sock;
        Msp::IO::EventDispatcher *event_disp;
        std::vector<Connection *> connections;
 
@@ -60,7 +54,7 @@ private:
        void train_added(Train &);
        void train_control_changed(const Train &, const std::string &, float);
        void train_function_changed(const Train &, unsigned, bool);
-       void train_route_changed(const Train &, const Route *);
+       void train_ai_event(const Train &, TrainAI &, const TrainAI::Message &);
        void train_status_changed(const Train &, const std::string &);
 
        template<typename P>