Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 28, 2009, 7:46:37 PM (15 years ago)
Author:
rgrieder
Message:

Merged buildsystem3 containing buildsystem2 containing Adi's buildsystem branch back to the trunk.
Please update the media directory if you were not using buildsystem3 before.

Location:
code/trunk
Files:
3 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/network/CMakeLists.txt

    r2662 r2710  
    1 SET( NETWORK_SRC_FILES
     1 #
     2 #             ORXONOX - the hottest 3D action shooter ever to exist
     3 #                             > www.orxonox.net <
     4 #
     5 #        This program is free software; you can redistribute it and/or
     6 #         modify it under the terms of the GNU General Public License
     7 #        as published by the Free Software Foundation; either version 2
     8 #            of the License, or (at your option) any later version.
     9 #
     10 #       This program is distributed in the hope that it will be useful,
     11 #        but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 #                 GNU General Public License for more details.
     14 #
     15 #   You should have received a copy of the GNU General Public License along
     16 #      with this program; if not, write to the Free Software Foundation,
     17 #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     18 #
     19
     20SET_SOURCE_FILES(NETWORK_SRC_FILES
    221  ChatListener.cc
    322  Client.cc
     
    1433  Host.cc
    1534)
     35ADD_SUBDIRECTORY(packet)
     36ADD_SUBDIRECTORY(synchronisable)
     37GET_ALL_HEADER_FILES(NETWORK_HDR_FILES)
     38SET(NETWORK_FILES ${NETWORK_SRC_FILES} ${NETWORK_HDR_FILES})
    1639
    17 ADD_SOURCE_DIRECTORY(NETWORK_SRC_FILES packet)
    18 ADD_SOURCE_DIRECTORY(NETWORK_SRC_FILES synchronisable)
     40GENERATE_SOURCE_GROUPS(${NETWORK_FILES})
    1941
    20 
    21 IF(WIN32)
    22   ADD_LIBRARY( network ${NETWORK_SRC_FILES} )
    23 ELSE(WIN32)
    24   ADD_LIBRARY( network SHARED ${NETWORK_SRC_FILES} )
    25 ENDIF(WIN32)
    26 
    27 TARGET_LINK_LIBRARIES( network
     42ADD_LIBRARY(network SHARED ${NETWORK_FILES})
     43SET_TARGET_PROPERTIES(network PROPERTIES DEFINE_SYMBOL "NETWORK_SHARED_BUILD")
     44TARGET_LINK_LIBRARIES(network
    2845  ${ZLIB_LIBRARY}
    29   ${ENet_LIBRARY}
    30   ${Boost_thread_LIBRARIES}
     46  ${ENET_LIBRARY}
     47  ${Boost_THREAD_LIBRARY}
     48  util
    3149  core
    3250)
    3351
     52ORXONOX_INSTALL(network)
    3453
    3554# build those parts only on request.
    3655IF(NETWORK_TESTING_ENABLED)
    3756  ##### test for gamestate stuff #####
    38   SET( TEST_SRC_FILES
     57  SET(TEST_SRC_FILES
    3958    ${NETWORK_SRC_FILES}
    4059  )
    4160  ADD_EXECUTABLE(networktest ${TEST_SRC_FILES})
    42   TARGET_LINK_LIBRARIES( networktest
    43     ${OGRE_LIBRARIES}
     61  TARGET_LINK_LIBRARIES(networktest
     62    ${OGRE_LIBRARY}
    4463    network
    45     ${ENet_LIBRARY}
     64    ${ENET_LIBRARY}
    4665    ${ZLIB_LIBRARY}
    47     ${WINDOWS_ENET_DEPENDENCIES}
    4866  )
    4967  ##### end test for gamestate stuff #####
  • code/trunk/src/network/GamestateManager.cc

    r2662 r2710  
    118118      return 0;
    119119    gs = reference->doSelection(clientID, 10000);
    120 //     gs = new packet::Gamestate(*reference);
    121120    // save the (undiffed) gamestate in the clients gamestate map
    122121    gamestateMap_[clientID][gs->getID()]=gs;
  • code/trunk/src/network/NetworkPrereqs.h

    r2662 r2710  
    3535#define _NetworkPrereqs_H__
    3636
    37 #include "util/OrxonoxPlatform.h"
     37#include "OrxonoxConfig.h"
    3838
    3939//-----------------------------------------------------------------------
    4040// Shared library settings
    4141//-----------------------------------------------------------------------
    42 #if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !defined( NETWORK_STATIC_BUILD )
     42#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined( NETWORK_STATIC_BUILD )
    4343#  ifdef NETWORK_SHARED_BUILD
    4444#    define _NetworkExport __declspec(dllexport)
     
    5555#  define _NetworkExport
    5656#endif
    57 
    58 //-----------------------------------------------------------------------
    59 // Includes
    60 //-----------------------------------------------------------------------
    61 #include "util/Integers.h"
    6257
    6358//-----------------------------------------------------------------------
  • code/trunk/src/network/TrafficControl.h

    r2662 r2710  
    3636#include <utility>
    3737#include <algorithm>
    38 #include "util/Integers.h"
    3938#include "core/OrxonoxClass.h"
    4039#include "network/ClientConnectionListener.h"
  • code/trunk/src/network/packet/Acknowledgement.cc

    r2662 r2710  
    6464
    6565bool Acknowledgement::process(){
    66 COUT(0) << "processing ACK with ID: " << getAckID() << endl;
     66COUT(6) << "processing ACK with ID: " << getAckID() << endl;
    6767  bool b = GamestateHandler::ackGamestate(getAckID(), clientID_);
    6868  delete this;
  • code/trunk/src/network/packet/CMakeLists.txt

    r2131 r2710  
    1 SET( SRC_FILES
     1ADD_SOURCE_FILES(NETWORK_SRC_FILES
    22  Packet.cc
    33  Chat.cc
     
    88  DeleteObjects.cc
    99)
    10 
    11 ADD_SOURCE_FILES(SRC_FILES)
  • code/trunk/src/network/packet/Gamestate.cc

    r2662 r2710  
    110110  for(it = ObjectList<Synchronisable>::begin(); it; ++it){
    111111   
     112    tempsize=it->getSize(id, mode);
    112113#ifndef NDEBUG
    113     tempsize=it->getSize(id, mode);
    114114    if(currentsize+tempsize > size){
    115115      assert(0); // if we don't use multithreading this part shouldn't be neccessary
     
    184184    {
    185185      bool b = s->updateData(mem, mode);
     186//      if(!b)
     187//        COUT(0) << "data could not be updated" << endl;
    186188      assert(b);
    187189    }
  • code/trunk/src/network/packet/Packet.cc

    r2662 r2710  
    167167  assert(ClientInformation::findClient(&peer->address)->getID() != (unsigned int)-2 || !Host::isServer());
    168168  unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
    169   Packet *p;
     169  Packet *p = 0;
    170170  COUT(5) << "packet type: " << *(ENUM::Type *)&data[_PACKETID] << std::endl;
    171171  switch( *(ENUM::Type *)(data + _PACKETID) )
  • code/trunk/src/network/packet/Packet.h

    r2171 r2710  
    3434#include <enet/enet.h>
    3535#include <boost/thread/recursive_mutex.hpp>
    36 
    37 #include "util/Integers.h"
    3836
    3937namespace orxonox {
  • code/trunk/src/network/synchronisable/CMakeLists.txt

    r2662 r2710  
    1 SET( SRC_FILES
     1ADD_SOURCE_FILES(NETWORK_SRC_FILES
    22  NetworkCallbackManager.cc
    33  Synchronisable.cc
     
    55  SynchronisableVariable.cc
    66)
    7 
    8 ADD_SOURCE_FILES(SRC_FILES)
  • code/trunk/src/network/synchronisable/NetworkCallback.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/network/synchronisable/Synchronisable.cc

    r2662 r2710  
    236236    return NULL;
    237237  }
    238 
    239 
    240   /**
    241   * This function is used to register a variable to be synchronized
    242   * also counts the total datasize needed to save the variables
    243   * @param var pointer to the variable
    244   * @param size size of the datatype the variable consists of
    245   * @param t the type of the variable (DATA or STRING
    246   * @param mode same as in getData
    247   * @param cb callback object that should get called, if the value of the variable changes
    248   */
    249 
    250 /*  void Synchronisable::registerVariable(void *var, int size, variableType t, uint8_t mode, NetworkCallbackBase *cb){
    251     assert( mode==variableDirection::toclient || mode==variableDirection::toserver || mode==variableDirection::serverMaster || mode==variableDirection::clientMaster);
    252     // create temporary synch.Var struct
    253     synchronisableVariable *temp = new synchronisableVariable;
    254     temp->size = size;
    255     temp->var = var;
    256     temp->mode = mode;
    257     temp->type = t;
    258     temp->callback = cb;
    259     if( ( mode & variableDirection::bidirectional ) )
    260     {
    261       if(t!=STRING)
    262       {
    263         temp->varBuffer = new uint8_t[size];
    264         memcpy(temp->varBuffer, temp->var, size); //now fill the buffer for the first time
    265       }
    266       else
    267       {
    268         temp->varBuffer=new std::string( *static_cast<std::string*>(var) );
    269       }
    270       temp->varReference = 0;
    271     }
    272     COUT(5) << "Syncronisable::registering var with size: " << temp->size << " and type: " << temp->type << std::endl;
    273     //std::cout << "push temp to syncList (at the bottom) " << datasize << std::endl;
    274     COUT(5) << "Syncronisable::objectID: " << objectID << " this: " << this << " name: " << this->getIdentifier()->getName() << " networkID: " << this->getIdentifier()->getNetworkID() << std::endl;
    275     syncList->push_back(temp);
    276 #ifndef NDEBUG
    277     std::list<synchronisableVariable *>::iterator it = syncList->begin();
    278     while(it!=syncList->end()){
    279       assert(*it!=var);
    280       it++;
    281     }
    282 #endif
    283   }*/
    284238
    285239
  • code/trunk/src/network/synchronisable/Synchronisable.h

    r2662 r2710  
    153153    uint32_t getSize(int32_t id, uint8_t mode=0x0);
    154154    bool updateData(uint8_t*& mem, uint8_t mode=0x0, bool forceCallback=false);
    155     inline bool isMyData(uint8_t* mem);
    156     inline bool doSync(int32_t id, uint8_t mode=0x0);
     155    bool isMyData(uint8_t* mem);
     156    bool doSync(int32_t id, uint8_t mode=0x0);
    157157
    158158    uint32_t objectID;
  • code/trunk/src/network/synchronisable/SynchronisableVariable.cc

    r2662 r2710  
    362362{
    363363  double temp;
    364   *(uint64_t*)(&temp) = *(uint64_t*)(mem);
     364  memcpy(&temp, mem, sizeof(uint64_t));
    365365  *(long double*)(&this->variable_) = static_cast<const long double>(temp);
    366366  mem += SynchronisableVariable<const long double>::returnSize();
     
    370370{
    371371  double temp = static_cast<double>(this->variable_);
    372   *(uint64_t*)(mem) = *(uint64_t*)(&temp);
     372  memcpy(mem, &temp, sizeof(uint64_t));
    373373  mem += SynchronisableVariable<const long double>::returnSize();
    374374}
     
    377377{
    378378  double temp = static_cast<double>(this->variable_);
    379   return *(uint64_t*)(mem) == *(uint64_t*)(&temp);
     379  return memcmp(&temp, mem, sizeof(uint64_t))==0;
    380380}
    381381
  • code/trunk/src/network/synchronisable/SynchronisableVariable.h

    r2662 r2710  
    3535#include <string>
    3636#include <cassert>
    37 #include "util/Integers.h"
    3837#include "core/Core.h"
    3938#include "core/CoreIncludes.h"
Note: See TracChangeset for help on using the changeset viewer.