Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 1, 2008, 7:04:09 PM (16 years ago)
Author:
landauf
Message:

merged objecthierarchy branch back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/network/Client.cc

    r1907 r2087  
    3939//
    4040
     41#include <cassert>
     42
    4143#include "Client.h"
    4244#include "Host.h"
     
    4446#include "core/CoreIncludes.h"
    4547#include "packet/Packet.h"
     48
    4649// #include "packet/Acknowledgement.h"
    4750
     
    6770  * @param port port of the application on the server
    6871  */
    69   Client::Client(std::string address, int port) : client_connection(port, address){
     72  Client::Client(const std::string& address, int port) : client_connection(port, address){
    7073    isConnected=false;
    7174    isSynched_=false;
     
    114117  }
    115118
    116   bool Client::processChat(std::string message, unsigned int playerID){
    117     COUT(1) << "Player " << playerID << ": " << message << std::endl;
     119  bool Client::processChat(const std::string& message, unsigned int playerID){
     120//    COUT(1) << "Player " << playerID << ": " << message << std::endl;
    118121    return true;
    119122  }
    120  
     123
    121124  /**
    122125   * This function implements the method of sending a chat message to the server
    123    * @param message message to be sent 
     126   * @param message message to be sent
    124127   * @return result(true/false)
    125128   */
    126   bool Client::chat(std::string message){
     129  bool Client::chat(const std::string& message){
    127130    packet::Chat *m = new packet::Chat(message, Host::getPlayerID());
    128131    return m->send();
     
    132135  /**
    133136   * Processes incoming packets, sends a gamestate to the server and does the cleanup
    134    * @param time 
     137   * @param time
    135138   */
    136139  void Client::tick(float time){
     
    152155      COUT(5) << "tick packet size " << event->packet->dataLength << std::endl;
    153156      packet::Packet *packet = packet::Packet::createPacket(event->packet, event->peer);
     157      // note: packet commits suicide here except for the GameState. That is then deleted by a GamestateHandler
    154158      bool b = packet->process();
    155159      assert(b);
Note: See TracChangeset for help on using the changeset viewer.