src/Network/Server.cc
changeset 355 0fafdf0029c0
parent 334 0cf3f2be51eb
child 381 9b35bc329d23
equal deleted inserted replaced
354:d9b0e213ce15 355:0fafdf0029c0
    60 
    60 
    61     this->send_to(node, NETMSG_SERVER_HELLO, hello_pkt, true);
    61     this->send_to(node, NETMSG_SERVER_HELLO, hello_pkt, true);
    62 
    62 
    63     // send other player objects
    63     // send other player objects
    64     for (std::list<NetworkServerPlayer*>::iterator it = server.players.begin(); it != server.players.end(); it++) {
    64     for (std::list<NetworkServerPlayer*>::iterator it = server.players.begin(); it != server.players.end(); it++) {
       
    65         NetworkPacket player_pkt;
    65         NetworkServerPlayer *player = *it;
    66         NetworkServerPlayer *player = *it;
    66         NetworkPacket player_pkt;
       
    67         
    67         
    68         // player is not in players list yet
    68         // player is not in players list yet
    69         assert(player != this);
    69         assert(player != this);
    70         
    70         
       
    71         // write packet
    71         player_pkt.write_vector(player->position);
    72         player_pkt.write_vector(player->position);
    72 
    73 
    73         player->send_to(node, NETMSG_PLAYER_INFO, player_pkt, true);
    74         player->send_to(node, NETMSG_PLAYER_INFO, player_pkt, true);
       
    75 
       
    76         // XXX: send rope info...
    74     }
    77     }
       
    78 
       
    79     // XXX: send projectiles? Or let the client handle the events that the unknown projectiles generate?
    75 
    80 
    76     // broadcast NETMSG_PLAYER_JOIN to all clients except current
    81     // broadcast NETMSG_PLAYER_JOIN to all clients except current
    77     this->send_all_except(NETMSG_PLAYER_JOIN, hello_pkt, node, true);
    82     this->send_all_except(NETMSG_PLAYER_JOIN, hello_pkt, node, true);
    78 
    83 
    79     // send terrain data...
    84     // send terrain data...