]> git.tdb.fi Git - r2c2.git/commitdiff
Bugfixes for the network server
authorMikko Rasa <tdb@tdb.fi>
Fri, 10 Apr 2015 18:02:39 +0000 (21:02 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 10 Apr 2015 18:02:39 +0000 (21:02 +0300)
source/network/server.cpp

index 43dce66cfc7353022df95b4893fba47710df31d6..588734ec039d83965e6cae4a8fff7c7cc11cb45e 100644 (file)
@@ -144,7 +144,8 @@ void Server::send(const P &pkt)
 Server::Connection::Connection(Server &s, Net::StreamSocket *o):
        server(s),
        socket(o),
-       comm(*socket, server.proto, *this)
+       comm(*socket, server.proto, *this),
+       stale(false)
 {
        socket->signal_end_of_file.connect(sigc::mem_fun(this, &Connection::end_of_file));
        comm.signal_handshake_done.connect(sigc::mem_fun(this, &Connection::handshake_done));
@@ -279,7 +280,7 @@ void Server::Connection::receive(const TrainAIControlPacket &pkt)
        {
                Train &train = server.layout.get_train(pkt.address);
                train.ai_message(TrainAI::Message("set-target-speed", pkt.target_speed));
-               train.ai_message(TrainAI::Message("set-reverse", pkt.reverse));
+               train.ai_message(TrainAI::Message("set-reverse", static_cast<bool>(pkt.reverse)));
        }
        catch(const exception &e)
        {