Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 19, 2008, 8:42:39 PM (16 years ago)
Author:
scheusso
Message:

-fixed a compiler error
-fixed a problem with multiple clients connected

Location:
code/branches/objecthierarchy/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/core/Identifier.h

    r1947 r1952  
    6161#include <typeinfo>
    6262#include <stdlib.h>
     63#include <cassert>
    6364
    6465#include "MetaObjectList.h"
  • code/branches/objecthierarchy/src/network/ClientInformation.cc

    r1735 r1952  
    185185  ClientInformation *ClientInformation::insertBack(ClientInformation *ins) {
    186186    ClientInformation *temp = head_;
    187     if(temp==head_){
     187    if(temp==ins){
    188188      return head_;
    189189    }
  • code/branches/objecthierarchy/src/network/Server.cc

    r1944 r1952  
    282282
    283283  bool Server::addClient(ENetEvent *event){
    284     unsigned int newid=0;
    285 
     284    static unsigned int newid=1;
     285
     286    COUT(2) << "Server: adding client" << std::endl;
    286287    ClientInformation *temp = ClientInformation::insertBack(new ClientInformation);
    287288    if(!temp){
     
    289290      return false;
    290291    }
    291     if(temp==ClientInformation::getBegin()) { //not good if you use anything else than insertBack
     292    /*if(temp==ClientInformation::getBegin()) { //not good if you use anything else than insertBack
    292293      newid=1;
    293294    }
    294295    else
    295       newid=temp->prev()->getID()+1;
     296      newid=temp->prev()->getID()+1;*/
    296297    temp->setID(newid);
    297298    temp->setPeer(event->peer);
     
    303304      listener++;
    304305    }
     306   
     307    newid++;
    305308
    306309    COUT(3) << "Server: added client id: " << temp->getID() << std::endl;
  • code/branches/objecthierarchy/src/network/packet/Packet.cc

    r1940 r1952  
    135135Packet *Packet::createPacket(ENetPacket *packet, ENetPeer *peer){
    136136  uint8_t *data = packet->data;
     137  assert(ClientInformation::findClient(&peer->address)->getID()!=-2 || !Host::isServer());
    137138  unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
    138139  Packet *p;
Note: See TracChangeset for help on using the changeset viewer.