src/Network/Server.hh
changeset 431 c6d7272a164b
parent 408 e6cfc44266af
child 435 7bad24ab668e
equal deleted inserted replaced
430:74e562e16399 431:c6d7272a164b
    70         
    70         
    71         /**
    71         /**
    72          * Called from on_node_connected to send the initial Terrain data using the NETCHAN_TERRAIN_ARRAY channel to
    72          * Called from on_node_connected to send the initial Terrain data using the NETCHAN_TERRAIN_ARRAY channel to
    73          * the given node.
    73          * the given node.
    74          */
    74          */
    75         void send_terrain_data (NetworkNode *node);
    75         void send_terrain_data (NetworkNode &node);
    76 };
    76 };
    77 
    77 
    78 /**
    78 /**
    79  * Our base NetworkObject_Server class, that also holds the NetworkServer reference and a CL_SlotContainer for
    79  * Our base NetworkObject_Server class, that also holds the NetworkServer reference and a CL_SlotContainer for
    80  * conveniance.
    80  * conveniance.
    99 class NetworkServerPlayer : public LocalPlayer, public NetworkServerObject {
    99 class NetworkServerPlayer : public LocalPlayer, public NetworkServerObject {
   100     protected:
   100     protected:
   101         /**
   101         /**
   102          * The remote node that represents this actual player
   102          * The remote node that represents this actual player
   103          */
   103          */
   104         NetworkNode *node;
   104         NetworkNode &node;
   105 
   105 
   106     public:
   106     public:
   107         /**
   107         /**
   108          * Construct this using the given server (for NetworkServerObject) and node (for node).
   108          * Construct this using the given server (for NetworkServerObject) and node (for node).
   109          *
   109          *
   111          * for all the other players, a NETMSG_PLAYER_JOIN to all the other clients, and then calls
   111          * for all the other players, a NETMSG_PLAYER_JOIN to all the other clients, and then calls
   112          * send_terrain_data to sync the initial terrain.
   112          * send_terrain_data to sync the initial terrain.
   113          *
   113          *
   114          * @see NetworkServerObject
   114          * @see NetworkServerObject
   115          */
   115          */
   116         NetworkServerPlayer (NetworkServer &server, NetworkNode *node);
   116         NetworkServerPlayer (NetworkServer &server, NetworkNode &node);
   117     
   117     
   118     protected:    
   118     protected:    
   119         // @{
   119         // @{
   120         /**
   120         /**
   121          * These methods are overriden from Player to replicate events to our clients
   121          * These methods are overriden from Player to replicate events to our clients
   165          * @param position the Projectile's initial position
   165          * @param position the Projectile's initial position
   166          * @param velocity the Projectile's initial velocity
   166          * @param velocity the Projectile's initial velocity
   167          * @param weapon the Player's Weapon that was fired
   167          * @param weapon the Player's Weapon that was fired
   168          */
   168          */
   169         NetworkServerProjectile (NetworkServer &server, NetworkServerPlayer *player, Vector position, Vector velocity, Weapon *weapon);
   169         NetworkServerProjectile (NetworkServer &server, NetworkServerPlayer *player, Vector position, Vector velocity, Weapon *weapon);
   170     
   170    
   171     protected:
   171     protected:
   172         /**
   172         /**
   173          * Overriden from Projectile to send a NETMSG_PROJECTILE_DESTROY with the given position and flags
   173          * Overriden from Projectile to send a NETMSG_PROJECTILE_DESTROY with the given position and flags
   174          *
   174          *
   175          * @param position the Projectile's final position, where the ground gets removed
   175          * @param position the Projectile's final position, where the ground gets removed