Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2008, 5:12:31 PM (16 years ago)
Author:
scheusso
Message:

bidirectional synchronisation works now:
register variables with mode direction::serverMaster or direction::clientMaster
clientMaster: both sides may change the variable but the client is master
serverMaster: both sides may change the variable but the server is master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/network/packet/Packet.cc

    r2112 r2132  
    5353#define _PACKETID           0
    5454
    55 std::map<ENetPacket *, Packet *> Packet::packetMap_;
     55std::map<size_t, Packet *> Packet::packetMap_;
    5656
    5757Packet::Packet(){
     
    134134    // Add the packet to a global list so we can access it again once enet calls our
    135135    // deletePacket method. We can of course only give a one argument function to the ENet C library.
    136     packetMap_[enetPacket_] = this;
     136    packetMap_[(size_t)(void*)enetPacket_] = this;
    137137  }
    138138#ifndef NDEBUG
     
    208208void Packet::deletePacket(ENetPacket *enetPacket){
    209209  // Get our Packet from a gloabal map with all Packets created in the send() method of Packet.
    210   std::map<ENetPacket*, Packet*>::iterator it = packetMap_.find(enetPacket);
     210  std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket);
    211211  assert(it != packetMap_.end());
    212212  // Make sure we don't delete it again in the destructor
Note: See TracChangeset for help on using the changeset viewer.