*/
#include <msp/net/inet.h>
-#include "libmarklin/locotype.h"
#include "libmarklin/route.h"
#include "libmarklin/train.h"
+#include "libmarklin/vehicletype.h"
#include "server.h"
using namespace std;
TrainInfoPacket pkt;
pkt.address = train.get_address();
- pkt.loco_type = train.get_locomotive_type().get_article_number();
+ pkt.loco_type = train.get_locomotive_type().get_article_number().str();
pkt.name = train.get_name();
send(pkt);
}
void Server::Connection::handshake_done()
{
- const map<string, Route *> &routes = server.layout.get_routes();
- for(map<string, Route *>::const_iterator i=routes.begin(); i!=routes.end(); ++i)
+ const set<Route *> &routes = server.layout.get_routes();
+ for(set<Route *>::const_iterator i=routes.begin(); i!=routes.end(); ++i)
{
RouteInfoPacket pkt;
- pkt.name = i->first;
+ pkt.name = (*i)->get_name();
comm.send(pkt);
}
{
TrainInfoPacket pkt;
pkt.address = train.get_address();
- pkt.loco_type = train.get_locomotive_type().get_article_number();
+ pkt.loco_type = train.get_locomotive_type().get_article_number().str();
pkt.name = train.get_name();
comm.send(pkt);
}