X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnetwork%2Fserver.cpp;h=a892dedd25a85c79e9ba8edd1f3c60db767855a6;hb=3dd660ffad729fbd6e75e6401f5c7f27b9013faf;hp=951fb9d4be658c4ee480d8a3088749f7fdeca65f;hpb=eb9c7f5200da4f3f31b41233be8cee397cb6abb9;p=r2c2.git diff --git a/source/network/server.cpp b/source/network/server.cpp index 951fb9d..a892ded 100644 --- a/source/network/server.cpp +++ b/source/network/server.cpp @@ -1,6 +1,7 @@ #include #include #include +#include "libr2c2/catalogue.h" #include "libr2c2/driver.h" #include "libr2c2/route.h" #include "libr2c2/train.h" @@ -59,7 +60,7 @@ void Server::driver_state_changed() send(pkt); } -void Server::emergency(const string &msg) +void Server::emergency(Block *, const string &msg) { EmergencyPacket pkt; pkt.message = msg; @@ -74,7 +75,7 @@ void Server::train_added(Train &train) TrainInfoPacket pkt; pkt.address = train.get_address(); - pkt.loco_type = train.get_locomotive_type().get_article_number().str(); + pkt.loco_type = layout.get_catalogue().get_name(&train.get_locomotive_type()); pkt.name = train.get_name(); send(pkt); @@ -169,6 +170,7 @@ void Server::Connection::handshake_done() comm.send(pkt); } + const Catalogue &cat = server.layout.get_catalogue(); const map &trains = server.layout.get_trains(); for(map::const_iterator i=trains.begin(); i!=trains.end(); ++i) { @@ -177,7 +179,7 @@ void Server::Connection::handshake_done() { TrainInfoPacket pkt; pkt.address = train.get_address(); - pkt.loco_type = train.get_locomotive_type().get_article_number().str(); + pkt.loco_type = cat.get_name(&train.get_locomotive_type()); pkt.name = train.get_name(); comm.send(pkt); }