Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1233


Ignore:
Timestamp:
May 5, 2008, 11:14:45 AM (17 years ago)
Author:
scheusso
Message:

took out some mallocs and replaced them with new

Location:
code/branches/network3/src/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network3/src/network/Client.cc

    r1232 r1233  
    116116    Synchronisable::setClient(true);
    117117    isConnected=client_connection.createConnection();
    118     /*if(isConnected){
    119       COUT(2) << "sending connectrequest" << std::endl;
     118    if(isConnected){
     119      COUT(4) << "sending connectrequest" << std::endl;
    120120      client_connection.addPacket(pck_gen.generateConnectRequest());
    121121      client_connection.sendPackets();
    122122    }else
    123       COUT(2) << "could not create connection" << std::endl;*/
     123      COUT(1) << "could not create connection" << std::endl;
    124124    return isConnected;
    125125  }
  • code/branches/network3/src/network/ConnectionManager.cc

    r1232 r1233  
    184184          addClient(&event);
    185185          //this is a workaround to ensure thread safety
    186           if(!addFakeConnectRequest(&event))
    187             COUT(3) << "Problem pushing fakeconnectRequest to queue" << std::endl;
     186          /*if(!addFakeConnectRequest(&event))
     187            COUT(3) << "Problem pushing fakeconnectRequest to queue" << std::endl;*/
    188188          COUT(5) << "Con.Man: connection event has occured" << std::endl;
    189189          break;
  • code/branches/network3/src/network/GameStateManager.cc

    r1232 r1233  
    101101    //Server::sendGameState?
    102102    int gID = head_->findClient(clientID)->getGamestateID();
    103     COUT(4) << "G.St.Man: popgamestate: sending gstate_id: " << id_ << " diffed from: " << gID << " (not diffed yet)" << std::endl;
     103    COUT(4) << "G.St.Man: popgamestate: sending gstate_id: " << id_ << " diffed from: " << gID << std::endl;
    104104//     COUT(3) << "gamestatemap: " << &gameStateMap << std::endl;
    105105    //chose wheather the next gamestate is the first or not
  • code/branches/network3/src/network/PacketDecoder.cc

    r1232 r1233  
    181181    if(currentState->compsize==0)
    182182      COUT(2) << "PacketDecoder: compsize is 0" << std::endl;
    183     currentState->data = (unsigned char*)(malloc( currentState->compsize ));
     183//     currentState->data = (unsigned char*)(malloc( currentState->compsize ));
     184    currentState->data = new unsigned char[currentState->compsize];
    184185    if(currentState->data==NULL)
    185186      COUT(2) << "PacketDecoder: Gamestatepacket-decoder: memory leak" << std::endl;
     
    198199    cid->id = ((classid *)(packet->data))->id;
    199200    cid->clid = ((classid *)(packet->data))->clid;
    200     cid->message = (const char *)malloc(cid->length);
     201//     cid->message = (const char *)malloc(cid->length);
     202    cid->message = new char[cid->length];
    201203    void *data  = (void *)cid->message;
    202204    memcpy(data, (const void*)(packet->data+3*sizeof(int)), cid->length);
Note: See TracChangeset for help on using the changeset viewer.