Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2759


Ignore:
Timestamp:
Mar 8, 2009, 4:51:27 PM (15 years ago)
Author:
scheusso
Message:

merged network branch (windows,multiplayer fixes) back to trunk

Location:
code/trunk/src
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/ArgumentCompletionFunctions.cc

    r2728 r2759  
    7676                    std::string dir = startdirectory.string();
    7777                    if (dir.size() > 0 && dir[dir.size() - 1] == ':')
    78                         startdirectory = dir + CP_SLASH;
     78                        startdirectory = dir + '/';
    7979                }
    8080#endif
     
    8686                {
    8787                    if (boost::filesystem::is_directory(*file))
    88                         dirlist.push_back(ArgumentCompletionListElement((*file).string() + CP_SLASH, getLowercase((*file).string()) + "/", (*file).BOOST_LEAF_FUNCTION() + "/"));
     88                        dirlist.push_back(ArgumentCompletionListElement((*file).string() + '/', getLowercase((*file).string()) + '/', (*file).BOOST_LEAF_FUNCTION() + '/'));
    8989                    else
    9090                        filelist.push_back(ArgumentCompletionListElement((*file).string(), getLowercase((*file).string()), (*file).BOOST_LEAF_FUNCTION()));
  • code/trunk/src/core/CommandLine.cc

    r2710 r2759  
    307307        // They will not overwrite the arguments given directly
    308308        std::ifstream file;
    309         file.open(filepath.file_string().c_str());
     309        file.open(filepath.string().c_str());
    310310        args.clear();
    311311        if (file)
  • code/trunk/src/core/ConfigFileManager.cc

    r2731 r2759  
    241241        // Open the file
    242242        std::ifstream file;
    243         file.open(filepath.file_string().c_str(), std::fstream::in);
     243        file.open(filepath.string().c_str(), std::fstream::in);
    244244        if (file.is_open())
    245245        {
     
    347347
    348348        std::ofstream file;
    349         file.open(filepath.file_string().c_str(), std::fstream::out);
     349        file.open(filepath.string().c_str(), std::fstream::out);
    350350        file.setf(std::ios::fixed, std::ios::floatfield);
    351351        file.precision(6);
  • code/trunk/src/core/Core.cc

    r2727 r2759  
    260260    /*static*/ std::string Core::getMediaPathString()
    261261    {
    262         return mediaPath_g.directory_string() + CP_SLASH;
    263     }
    264     /*static*/ std::string Core::getMediaPathPOSIXString()
    265     {
    266262        return mediaPath_g.string() + '/';
    267 
    268263    }
    269264
     
    274269    /*static*/ std::string Core::getConfigPathString()
    275270    {
    276         return configPath_g.directory_string() + CP_SLASH;
    277     }
    278     /*static*/ std::string Core::getConfigPathPOSIXString()
    279     {
    280271        return configPath_g.string() + '/';
    281272    }
     
    286277    }
    287278    /*static*/ std::string Core::getLogPathString()
    288     {
    289         return logPath_g.directory_string() + CP_SLASH;
    290     }
    291     /*static*/ std::string Core::getLogPathPOSIXString()
    292279    {
    293280        return logPath_g.string() + '/';
     
    456443            {
    457444                ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
    458                                          Please remove " + it->first.file_string());
     445                                         Please remove " + it->first.string());
    459446            }
    460447            if (boost::filesystem::create_directories(it->first)) // function may not return true at all (bug?)
  • code/trunk/src/core/Core.h

    r2710 r2759  
    8383            static std::string getConfigPathString();
    8484            static std::string getLogPathString();
    85             static std::string getMediaPathPOSIXString();
    86             static std::string getConfigPathPOSIXString();
    87             static std::string getLogPathPOSIXString();
    8885
    8986            // fast access global variables.
  • code/trunk/src/core/Factory.cc

    r2662 r2759  
    8787    void Factory::changeNetworkID(Identifier* identifier, const uint32_t oldID, const uint32_t newID)
    8888    {
    89         getFactoryPointer()->identifierNetworkIDMap_.erase(oldID);
     89//        getFactoryPointer()->identifierNetworkIDMap_.erase(oldID);
    9090        getFactoryPointer()->identifierNetworkIDMap_[newID] = identifier;
    9191//std::cout << identifier->getName() << ": " << oldID << " -> " << newID << std::endl;
     92    }
     93
     94    /**
     95        @brief Cleans the NetworkID map (needed on clients for correct initialization)
     96    */
     97    void Factory::cleanNetworkIDs()
     98    {
     99        getFactoryPointer()->identifierNetworkIDMap_.clear();
    92100    }
    93101
  • code/trunk/src/core/Factory.h

    r2710 r2759  
    6363            static void add(const std::string& name, Identifier* identifier);
    6464            static void changeNetworkID(Identifier* identifier, const uint32_t oldID, const uint32_t newID);
     65            static void cleanNetworkIDs();
    6566            static void createClassHierarchy();
    6667
  • code/trunk/src/core/Language.cc

    r2710 r2759  
    210210        // This creates the file if it's not existing
    211211        std::ofstream createFile;
    212         createFile.open(filepath.file_string().c_str(), std::fstream::app);
     212        createFile.open(filepath.string().c_str(), std::fstream::app);
    213213        createFile.close();
    214214
    215215        // Open the file
    216216        std::ifstream file;
    217         file.open(filepath.file_string().c_str(), std::fstream::in);
     217        file.open(filepath.string().c_str(), std::fstream::in);
    218218
    219219        if (!file.is_open())
     
    261261        // Open the file
    262262        std::ifstream file;
    263         file.open(filepath.file_string().c_str(), std::fstream::in);
     263        file.open(filepath.string().c_str(), std::fstream::in);
    264264
    265265        if (!file.is_open())
     
    317317        // Open the file
    318318        std::ofstream file;
    319         file.open(filepath.file_string().c_str(), std::fstream::out);
     319        file.open(filepath.string().c_str(), std::fstream::out);
    320320
    321321        if (!file.is_open())
  • code/trunk/src/core/LuaBind.cc

    r2710 r2759  
    5353    LuaBind::singletonRef_s = this;
    5454
    55     this->includePath_ = Core::getMediaPathPOSIXString();
     55    this->includePath_ = Core::getMediaPathString();
    5656
    5757    luaState_ = lua_open();
     
    9090    output_ = "";
    9191    std::ifstream file;
    92     file.open(filepath.file_string().c_str(), std::fstream::in);
     92    file.open(filepath.string().c_str(), std::fstream::in);
    9393
    9494    if (!file.is_open())
  • code/trunk/src/network/ConnectionManager.cc

    r2662 r2759  
    4646#include <boost/bind.hpp>
    4747
    48 #include "core/CoreIncludes.h"
    49 #include "core/BaseObject.h"
    50 #include "core/Iterator.h"
    5148#include "util/Math.h"
    5249#include "util/Sleep.h"
     
    124121  void ConnectionManager::createListener() {
    125122    receiverThread_ = new boost::thread(boost::bind(&ConnectionManager::receiverThread, this));
    126     //network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
    127          //boost::thread thr(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
    128123    return;
    129124  }
     
    131126  bool ConnectionManager::quitListener() {
    132127    quit=true;
    133     //network_threads.join_all();
    134128    receiverThread_->join();
    135129    return true;
     
    206200        // log handling ================
    207201        case ENET_EVENT_TYPE_CONNECT:
    208           //COUT(3) << "adding event_type_connect to queue" << std::endl;
    209202        case ENET_EVENT_TYPE_DISCONNECT:
    210           //addClient(event);
    211           //this is a workaround to ensure thread safety
    212           //COUT(5) << "Con.Man: connection event has occured" << std::endl;
    213           //break;
    214203        case ENET_EVENT_TYPE_RECEIVE:
    215           //std::cout << "received data" << std::endl;
    216           //COUT(5) << "Con.Man: receive event has occured" << std::endl;
    217           // only add, if client has connected yet and not been disconnected
    218           //if(head_->findClient(&event->peer->address))
    219204            processData(event);
    220205            event = new ENetEvent;
    221 //           else
    222 //             COUT(3) << "received a packet from a client we don't know" << std::endl;
    223206          break;
    224         //case ENET_EVENT_TYPE_DISCONNECT:
    225           //clientDisconnect(event->peer);
    226           //break;
    227207        case ENET_EVENT_TYPE_NONE:
    228208          //receiverThread_->yield();
     
    299279  }
    300280
    301   /**
    302    *
    303    * @param clientID
    304    */
     281
    305282  void ConnectionManager::syncClassid(unsigned int clientID) {
    306     unsigned int network_id=0, failures=0;
    307     std::string classname;
    308     Identifier *id;
    309     std::map<std::string, Identifier*>::const_iterator it = Factory::getFactoryMapBegin();
    310     while(it != Factory::getFactoryMapEnd()){
    311       id = (*it).second;
    312       if(id == NULL)
    313         continue;
    314       classname = id->getName();
    315       network_id = id->getNetworkID();
    316       if(network_id==0)
    317         COUT(3) << "we got a null class id: " << id->getName() << std::endl;
    318       COUT(4) << "Con.Man:syncClassid:\tnetwork_id: " << network_id << ", classname: " << classname << std::endl;
    319 
    320       packet::ClassID *classid = new packet::ClassID( network_id, classname );
    321       classid->setClientID(clientID);
    322       while(!classid->send() && failures < 10){
    323         failures++;
    324       }
    325       ++it;
    326     }
    327     //sendPackets();
     283    int failures=0;
     284    packet::ClassID *classid = new packet::ClassID();
     285    classid->setClientID(clientID);
     286    while(!classid->send() && failures < 10){
     287      failures++;
     288    }
     289    assert(failures<10);
    328290    COUT(4) << "syncClassid:\tall synchClassID packets have been sent" << std::endl;
    329291  }
    330 
     292 
    331293
    332294  void ConnectionManager::disconnectClient(ClientInformation *client){
  • code/trunk/src/network/ConnectionManager.h

    r2756 r2759  
    8080    static boost::recursive_mutex enet_mutex;
    8181    ConnectionManager();
    82     //ConnectionManager(ClientInformation *head);
    8382    ConnectionManager(int port);
    8483    ConnectionManager(int port, const char *address);
    8584    ConnectionManager(int port, const std::string& address);
    8685    ~ConnectionManager();
    87     //ENetPacket *getPacket(ENetAddress &address); // thread1
    88     //ENetPacket *getPacket(int &clientID);
    8986    ENetEvent *getEvent();
    9087    bool queueEmpty();
    9188    void createListener();
    9289    bool quitListener();
    93 //     bool addPacket(Packet::Packet *packet);
    9490    static bool addPacket(ENetPacket *packet, ENetPeer *peer);
    9591    static bool addPacket(ENetPacket *packet, int ID);
    9692    static bool addPacketAll(ENetPacket *packet);
    97   //  bool sendPackets(ENetEvent *event);
    9893    bool sendPackets();
    99     //bool createClient(int clientID);
    10094    void disconnectClient(ClientInformation *client);
    10195    void syncClassid(unsigned int clientID);
    10296
    10397  private:
    104 //     bool clientDisconnect(ENetPeer *peer);
    105 //     bool removeClient(int clientID);
    10698    bool processData(ENetEvent *event);
    107     //bool addClient(ENetEvent *event);
    10899    void receiverThread();
    109100    void disconnectClients();
  • code/trunk/src/network/packet/ClassID.cc

    r2669 r2759  
    3131#include "ClassID.h"
    3232#include "core/CoreIncludes.h"
     33#include "core/Factory.h"
    3334#include <cstring>
     35#include <string>
    3436#include <assert.h>
     37#include <map>
     38#include <queue>
    3539
    3640namespace orxonox {
     
    3842
    3943
     44#define PACKET_FLAGS_CLASSID  ENET_PACKET_FLAG_RELIABLE
     45#define _PACKETID             0
    4046
    41   ClassID::ClassID( unsigned int classID, std::string className )
    42  : Packet()
    43 {
     47
     48ClassID::ClassID( ) : Packet(){
     49  Identifier *id;
     50  std::string classname;
     51  unsigned int nrOfClasses=0;
     52  unsigned int packetSize=2*sizeof(uint32_t); //space for the packetID and for the nrofclasses
     53  uint32_t network_id;
    4454  flags_ = flags_ | PACKET_FLAGS_CLASSID;
    45   classNameLength_=className.length()+1;
    46   assert(getSize());
    47   data_=new unsigned char[ getSize() ];
    48   assert(data_);
    49   *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::ClassID;
    50   *(unsigned int *)(data_ + _CLASSID ) = classID;
    51   *(unsigned int *)(data_ + _CLASSNAMELENGTH ) = classNameLength_;
    52   memcpy( data_+_CLASSNAME, (void *)className.c_str(), classNameLength_ );
     55  std::queue<std::pair<uint32_t, std::string> > tempQueue;
     56 
     57  //calculate total needed size (for all strings and integers)
     58  std::map<std::string, Identifier*>::const_iterator it = Factory::getFactoryMapBegin();
     59  for(;it != Factory::getFactoryMapEnd();++it){
     60    id = (*it).second;
     61    if(id == NULL)
     62      continue;
     63    classname = id->getName();
     64    network_id = id->getNetworkID();
     65    if(network_id==0)
     66      COUT(3) << "we got a null class id: " << id->getName() << std::endl;
     67    // now push the network id and the classname to the stack
     68    tempQueue.push( std::pair<unsigned int, std::string>(network_id, classname) );
     69    ++nrOfClasses;
     70    packetSize += (classname.size()+1)+sizeof(uint32_t)+sizeof(uint32_t);
     71  }
     72 
     73  this->data_=new uint8_t[ packetSize ];
     74  //set the appropriate packet id
     75  assert(this->data_);
     76  *(ENUM::Type *)(this->data_ + _PACKETID ) = ENUM::ClassID;
     77 
     78  uint8_t *temp=data_+sizeof(uint32_t);
     79  // save the number of all classes
     80  *(uint32_t*)temp = nrOfClasses;
     81  temp += sizeof(uint32_t);
     82 
     83  // now save all classids and classnames
     84  std::pair<uint32_t, std::string> tempPair;
     85  while( !tempQueue.empty() ){
     86    tempPair = tempQueue.front();
     87    tempQueue.pop();
     88    *(uint32_t*)temp = tempPair.first;
     89    *(uint32_t*)(temp+sizeof(uint32_t)) = tempPair.second.size()+1;
     90    memcpy(temp+2*sizeof(uint32_t), tempPair.second.c_str(), tempPair.second.size()+1);
     91    temp+=2*sizeof(uint32_t)+tempPair.second.size()+1;
     92  }
     93 
     94  COUT(0) << "classid packetSize is " << packetSize << endl;
     95 
    5396}
    5497
     
    5699  : Packet(data, clientID)
    57100{
    58   memcpy( (void *)&classNameLength_, &data[ _CLASSNAMELENGTH ], sizeof(classNameLength_) );
    59101}
    60102
     
    63105}
    64106
    65 unsigned int ClassID::getSize() const{
    66   return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t) + classNameLength_;
     107uint32_t ClassID::getSize() const{
     108  uint8_t *temp = data_+sizeof(uint32_t); // packet identification
     109  uint32_t totalsize = sizeof(uint32_t); // packet identification
     110  uint32_t nrOfClasses = *(uint32_t*)temp;
     111  temp += sizeof(uint32_t);
     112  totalsize += sizeof(uint32_t); // storage size for nr of all classes
     113 
     114  for(unsigned int i=0; i<nrOfClasses; i++){
     115    totalsize += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t));
     116  }
     117  return totalsize;
    67118}
    68119
     120
    69121bool ClassID::process(){
    70   COUT(3) << "processing classid: " << getClassID() << " name: " << getClassName() << std::endl;
    71   Identifier *id=ClassByString( std::string(getClassName()) );
    72   if(id==NULL)
    73     return false;
    74   id->setNetworkID( getClassID() );
     122  int nrOfClasses;
     123  uint8_t *temp = data_+sizeof(uint32_t); //skip the packetid
     124  uint32_t networkID;
     125  uint32_t stringsize;
     126  unsigned char *classname;
     127 
     128 
     129  //clean the map of network ids
     130  Factory::cleanNetworkIDs();
     131 
     132  COUT(4) << "=== processing classids: " << endl;
     133  std::pair<uint32_t, std::string> tempPair;
     134  Identifier *id;
     135  // read the total number of classes
     136  nrOfClasses = *(uint32_t*)temp;
     137  temp += sizeof(uint32_t);
     138 
     139  for( int i=0; i<nrOfClasses; i++){
     140    networkID = *(uint32_t*)temp;
     141    stringsize = *(uint32_t*)(temp+sizeof(uint32_t));
     142    classname = temp+2*sizeof(uint32_t);
     143    id=ClassByString( std::string((const char*)classname) );
     144    COUT(0) << "processing classid: " << networkID << " name: " << classname << " id: " << id << std::endl;
     145    if(id==NULL){
     146      COUT(0) << "Recieved a bad classname" << endl;
     147      abort();
     148    }
     149    id->setNetworkID( networkID );
     150    temp += 2*sizeof(uint32_t) + stringsize;
     151  }
    75152  delete this;
    76153  return true;
     
    78155
    79156
    80 unsigned int ClassID::getClassID(){
    81   return *(uint32_t *)(data_ + _CLASSID);
    82 }
    83 
    84157} //namespace packet
    85158}//namespace orxonox
  • code/trunk/src/network/packet/ClassID.h

    r2669 r2759  
    3838namespace packet {
    3939
    40 #define PACKET_FLAGS_CLASSID  ENET_PACKET_FLAG_RELIABLE
    41 #define _PACKETID             0
    42 #define _CLASSID              _PACKETID + sizeof(ENUM::Type)
    43 #define _CLASSNAMELENGTH      _CLASSID + sizeof(uint32_t)
    44 #define _CLASSNAME            _CLASSNAMELENGTH + sizeof(classNameLength_)
    4540 
    4641/**
     
    5045{
    5146public:
    52   ClassID( unsigned int classID, std::string className );
     47  ClassID( );
    5348  ClassID( uint8_t* data, unsigned int clientID );
    5449  ~ClassID();
    5550
    56   inline unsigned int getSize() const;
     51  uint32_t getSize() const;
    5752  bool process();
    5853
    59   unsigned int getClassID();
    60   unsigned int getClassNameLength(){ return classNameLength_; }
    61   const char *getClassName(){ return (const char*)(data_+_CLASSNAME); }
    6254private:
    63   uint32_t classNameLength_;
    6455};
    6556
  • code/trunk/src/network/packet/Gamestate.cc

    r2710 r2759  
    4848#define PACKET_FLAG_GAMESTATE  ENET_PACKET_FLAG_RELIABLE
    4949
    50 // Gamestate::Gamestate()
    51 // {
    52 //   flags_ = flags_ | PACKET_FLAG_GAMESTATE;
    53 // }
    5450
    5551Gamestate::Gamestate()
     
    127123#endif
    128124
    129     //if(it->doSelection(id))
    130125    if ( it->doSync( id, mode ) )
    131126      dataMap_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
    132 //     dataMap_[mem-data_]=(*it);  // save the mem location of the synchronisable data
    133127    if(!it->getData(mem, id, mode))
    134128      return false; // mem pointer gets automatically increased because of call by reference
     
    158152  assert(!header_->isDiffed());
    159153  uint8_t *mem=data_+GamestateHeader::getSize();
    160     // get the start of the Synchronisable list
    161   //ObjectList<Synchronisable>::iterator it=ObjectList<Synchronisable>::begin();
    162154  Synchronisable *s;
    163155
     
    177169        mem += objectheader.getDataSize();
    178170      }
    179 //         COUT(0) << "could not fabricate synchronisable: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: " << objectheader->creatorID << endl;
    180 //       else
    181 //         COUT(0) << "fabricated: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: "  << objectheader->creatorID << endl;
    182171    }
    183172    else
    184173    {
    185174      bool b = s->updateData(mem, mode);
    186 //      if(!b)
    187 //        COUT(0) << "data could not be updated" << endl;
    188175      assert(b);
    189176    }
     
    262249  uint8_t *ndata = new uint8_t[buffer+GamestateHeader::getSize()];
    263250  uint8_t *dest = ndata + GamestateHeader::getSize();
    264   //unsigned char *dest = new unsigned char[buffer];
    265251  uint8_t *source = data_ + GamestateHeader::getSize();
    266252  int retval;
     
    294280  uint32_t compsize = header_->getCompSize();
    295281  uint32_t bufsize;
    296 //  assert(compsize<=datasize);
    297282  bufsize = datasize;
    298283  assert(bufsize!=0);
     
    340325  assert(!header_->isDiffed());
    341326  GamestateHeader diffHeader(base->data_);
    342   //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;
    343327  uint8_t *basep = GAMESTATE_START(base->data_), *gs = GAMESTATE_START(this->data_);
    344328  uint32_t of=0; // pointers offset
     
    397381  //copy in the zeros
    398382  for(it=dataMap_.begin(); it!=dataMap_.end();){
    399 //    if((*it).objSize==0)
    400 //      continue;
    401 //    if(it->second->getSize(HEADER->id)==0) // merged from objecthierarchy2, doesn't work anymore; TODO: change this
    402 //      continue;                            // merged from objecthierarchy2, doesn't work anymore; TODO: change this
    403383    SynchronisableHeader oldobjectheader(origdata);
    404384    SynchronisableHeader newobjectheader(newdata);
     
    408388      continue;
    409389    }
    410 //     object = Synchronisable::getSynchronisable( (*it).objID );
    411 //     assert(object->objectID == oldobjectheader->objectID);
    412390    objectsize = oldobjectheader.getDataSize();
    413391    objectOffset=SynchronisableHeader::getSize(); //skip the size and the availableData variables in the objectheader
     
    447425  assert(header_->isDiffed());
    448426  assert(!header_->isCompressed() && !base->header_->isCompressed());
    449   //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;
    450427  uint8_t *basep = GAMESTATE_START(base->data_);
    451428  uint8_t *gs = GAMESTATE_START(this->data_);
  • code/trunk/src/network/packet/Gamestate.h

    r2662 r2759  
    9393  private:
    9494    uint8_t *data_;
    95 //#define GAMESTATE_START(data) (data + sizeof(GamestateHeader))
    96 //#define GAMESTATE_HEADER(data) ((GamestateHeader *)data)
    97 //#define HEADER GAMESTATE_HEADER(data_)
    9895
    9996};
  • code/trunk/src/network/synchronisable/Synchronisable.cc

    r2710 r2759  
    100100      if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer()))
    101101        deletedObjects_.push(objectID);
    102 //       COUT(3) << "destruct synchronisable +++" << objectID << " | " << classID << std::endl;
    103 //       COUT(3) << " bump ---" << objectID << " | " << &objectMap_ << std::endl;
    104 //       assert(objectMap_[objectID]->objectID==objectID);
    105 //       objectMap_.erase(objectID);
    106102    }
    107103    std::map<uint32_t, Synchronisable*>::iterator it;
     
    110106      objectMap_.erase(it);
    111107
    112     //HACK HACK HACK HACK HACK HACK
    113     // this hack ensures that children of this object also get destroyed
    114 //     ObjectList<Synchronisable>::iterator it2, it3;
    115 //     // get total size of gamestate
    116 //     for(it2 = ObjectList<Synchronisable>::begin(); it2; ++it2)
    117 //     {
    118 //       if ( it2->getCreatorID() == this->objectID && it2->getCreatorID() != OBJECTID_UNKNOWN )
    119 //       {
    120 //         Synchronisable::deleteObject( it2->getObjectID() );
    121 //       }
    122 //     }
    123     //HACK HACK HACK HACK HACK HACK
    124108  }
    125109
     
    158142    if (!id)
    159143    {
     144        for(int i = 0; i<100; i++)
     145            COUT(0) << "classid: " << i << " identifier: " << ClassByID(i) << endl;
    160146        COUT(0) << "Assertion failed: id" << std::endl;
    161147        COUT(0) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl;
     
    203189   */
    204190  bool Synchronisable::deleteObject(uint32_t objectID){
    205 //     assert(getSynchronisable(objectID));
    206191    if(!getSynchronisable(objectID))
    207192      return false;
    208193    assert(getSynchronisable(objectID)->objectID==objectID);
    209 //     delete objectMap_[objectID];
    210194    Synchronisable *s = getSynchronisable(objectID);
    211195    if(s)
     
    258242    if(!doSync(id, mode))
    259243      return true;
    260     //std::cout << "inside getData" << std::endl;
    261244    uint32_t tempsize = 0;
    262245    if (this->classID==0)
     
    267250
    268251    assert(this->classID==this->getIdentifier()->getNetworkID());
    269 //     this->classID=this->getIdentifier()->getNetworkID(); // TODO: correct this
    270252    std::list<SynchronisableVariableBase*>::iterator i;
    271253    uint32_t size;
     
    305287      mode=state_;
    306288    std::list<SynchronisableVariableBase *>::iterator i;
    307     //assert(objectMode_!=0x0);
    308     //assert( (mode ^ objectMode_) != 0);
    309289    if(syncList.empty()){
    310290      assert(0);
  • code/trunk/src/network/synchronisable/Synchronisable.h

    r2710 r2759  
    142142  protected:
    143143    Synchronisable(BaseObject* creator);
    144 //     void registerVariable(void *var, int size, variableType t, uint8_t mode=0x1, NetworkCallbackBase *cb=0);
    145144    template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
    146145    template <class T> void unregisterVariable(T& var);
     
    205204  template <> _NetworkExport void Synchronisable::registerVariable( const Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);
    206205  template <> _NetworkExport void Synchronisable::registerVariable( Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);
    207 //   template <> _NetworkExport void Synchronisable::registerVariable( LODParticle::LOD& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);
    208 //   template <> _NetworkExport void Synchronisable::registerVariable( Ogre::Light::LightTypes& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);
    209206}
    210207
  • code/trunk/src/orxonox/gamestates/GSGraphics.cc

    r2710 r2759  
    136136        // load debug overlay
    137137        COUT(3) << "Loading Debug Overlay..." << std::endl;
    138         this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").file_string());
     138        this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").string());
    139139        Loader::open(debugOverlay_);
    140140
     
    304304        // create our own log that we can listen to
    305305        Ogre::Log *myLog;
    306         myLog = ogreLogger_->createLog(ogreLogFilepath.file_string(), true, false, false);
     306        myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false);
    307307        COUT(4) << "Ogre Log created" << std::endl;
    308308
     
    317317            // create a zero sized file
    318318            std::ofstream creator;
    319             creator.open(ogreConfigFilepath.file_string().c_str());
     319            creator.open(ogreConfigFilepath.string().c_str());
    320320            creator.close();
    321321        }
    322322
    323323        // Leave plugins file empty. We're going to do that part manually later
    324         ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.file_string(), ogreLogFilepath.file_string());
     324        ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string());
    325325
    326326        COUT(3) << "Ogre set up done." << std::endl;
     
    336336        // Do some SubString magic to get the comma separated list of plugins
    337337        SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0');
     338        // Use backslash paths on Windows! file_string() already does that though.
    338339        for (unsigned int i = 0; i < plugins.size(); ++i)
    339340            ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
     
    356357        try
    357358        {
    358             cf.load((Core::getMediaPath() / resourceFile_).file_string());
     359            cf.load((Core::getMediaPath() / resourceFile_).string());
    359360        }
    360361        catch (...)
     
    382383
    383384                    Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
    384                         (Core::getMediaPath() / archName).directory_string(), typeName, secName);
     385                        (Core::getMediaPath() / archName).string(), typeName, secName);
    385386                }
    386387            }
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r2710 r2759  
    202202        std::string levelName;
    203203        CommandLine::getValue("level", &levelName);
    204         startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + CP_SLASH + levelName);
     204        startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName);
    205205        Loader::open(startFile_);
    206206    }
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r2756 r2759  
    104104
    105105        // initialise TCL
    106         this->tclBind_ = new TclBind(Core::getMediaPathPOSIXString());
     106        this->tclBind_ = new TclBind(Core::getMediaPathString());
    107107        this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
    108108
  • code/trunk/src/orxonox/gui/GUIManager.cc

    r2710 r2759  
    154154                boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");
    155155                this->ceguiLogger_ = new DefaultLogger();
    156                 this->ceguiLogger_->setLogFilename(ceguiLogFilepath.file_string());
     156                this->ceguiLogger_->setLogFilename(ceguiLogFilepath.string());
    157157                // set the log level according to ours (translate by subtracting 1)
    158158                this->ceguiLogger_->setLoggingLevel(
  • code/trunk/src/orxonox/objects/worldentities/ExplosionChunk.cc

    r2662 r2759  
    4747        RegisterObject(ExplosionChunk);
    4848
    49         if (!this->getScene() || !Core::showsGraphics() || !this->getScene()->getSceneManager())
     49        if ( Core::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
    5050            ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given.");
    5151
     
    5353        this->LOD_ = LODParticle::normal;
    5454
    55         try
     55        if ( Core::showsGraphics() )
    5656        {
    57             this->fire_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
    58             this->attachOgreObject(this->fire_->getParticleSystem());
    59             this->smoke_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
    60             this->attachOgreObject(this->smoke_->getParticleSystem());
     57            try
     58            {
     59                this->fire_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
     60                this->attachOgreObject(this->fire_->getParticleSystem());
     61                this->smoke_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
     62                this->attachOgreObject(this->smoke_->getParticleSystem());
     63            }
     64            catch (...)
     65            {
     66                COUT(1) << "Error: Couln't load particle effect in ExplosionChunk." << std::endl;
     67                this->fire_ = 0;
     68                this->smoke_ = 0;
     69            }
    6170        }
    62         catch (...)
     71        else
    6372        {
    64             COUT(1) << "Error: Couln't load particle effect in ExplosionChunk." << std::endl;
    6573            this->fire_ = 0;
    6674            this->smoke_ = 0;
Note: See TracChangeset for help on using the changeset viewer.