# HG changeset patch # User terom # Date 1228791511 0 # Node ID 0fafdf0029c0e07aa9e9ea3975924faa6d56cda5 # Parent d9b0e213ce156a33ba0a40df36d3ac90aadfc765 misc. touching up of doc and NetworkServer comments... diff -r d9b0e213ce15 -r 0fafdf0029c0 doc/kishna.tex --- a/doc/kishna.tex Tue Dec 09 02:55:45 2008 +0000 +++ b/doc/kishna.tex Tue Dec 09 02:58:31 2008 +0000 @@ -304,7 +304,7 @@ Two of these classes are NetworkClientLocalPlayer and NetworkClientRemotePlayer. Both inherit from NetworkClientPlayerBase, which inherits Player (virtually) and NetworkObject\_Client. NetworkClientLocalPlayer and NetworkClientRemotePlayer then also inherit LocalPlayer and Remote player virtually, respectively. -NetworkClientPlayerBase, contains the common methods that update the Player's state in response to messages received +NetworkClientPlayerBase contains the common methods that update the Player's state in response to messages received from the server. NetworkClientLocalPlayer overrides handleInput to send the input mask to the server, and NetworkClientRemotePlayer can handle remote clients disconnecting from the server. @@ -323,7 +323,7 @@ \item If player dies while rope is attached the rope will still be attached when the player spawns. \item If rope is thrown without releasing it first, rope will pull worm - when midair + while in mid-air \item Collisions with the terrain are only tested for the edgepoints of the polygon. \item Existing Player ropes and Projectiles are not sent to the client when it connects, which can cause apparent diff -r d9b0e213ce15 -r 0fafdf0029c0 src/Network/Server.cc --- a/src/Network/Server.cc Tue Dec 09 02:55:45 2008 +0000 +++ b/src/Network/Server.cc Tue Dec 09 02:58:31 2008 +0000 @@ -62,17 +62,22 @@ // send other player objects for (std::list::iterator it = server.players.begin(); it != server.players.end(); it++) { + NetworkPacket player_pkt; NetworkServerPlayer *player = *it; - NetworkPacket player_pkt; // player is not in players list yet assert(player != this); + // write packet player_pkt.write_vector(player->position); player->send_to(node, NETMSG_PLAYER_INFO, player_pkt, true); + + // XXX: send rope info... } + // XXX: send projectiles? Or let the client handle the events that the unknown projectiles generate? + // broadcast NETMSG_PLAYER_JOIN to all clients except current this->send_all_except(NETMSG_PLAYER_JOIN, hello_pkt, node, true);