Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9386 in orxonox.OLD


Ignore:
Timestamp:
Jul 21, 2006, 1:41:39 PM (18 years ago)
Author:
bensch
Message:

orxonox/proxy: removed the dependency of the netdefs in pnode, which should decrease compile time enormously.

Location:
branches/proxy/src
Files:
1 added
29 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/coord/p_node.cc

    r9377 r9386  
    2121#include "class_list.h"
    2222
     23#include "netdefs.h"
     24
    2325#include <algorithm>
    2426#include "compiler.h"
     
    2729#include "glincl.h"
    2830#include "color.h"
    29 
    30 #include "synchronizeable.h"
    3131
    3232/**
  • branches/proxy/src/lib/lang/base_object.h

    r9371 r9386  
    1515
    1616#include "class_id.h"
     17#include "sigslot/slot.h"
     18
    1719#include <string>
    18 
    19 #include "sigslot/slot.h"
    2020
    2121class TiXmlNode;
  • branches/proxy/src/lib/network/Makefile.am

    r9347 r9386  
    4747
    4848
    49 noinst_HEADERS = synchronizeable.h \
    50                  network_manager.h \
    51                  shared_network_data.h \
    52                  network_socket.h \
    53                  network_stream.h \
    54                  data_stream.h \
    55                  network_protocol.h \
    56                  server_socket.h \
    57                  tcp_server_socket.h \
    58                  tcp_socket.h \
    59                  udp_server_socket.h \
    60                  udp_socket.h \
    61                  handshake.h \
    62                  network_game_manager.h \
    63                  converter.h \
    64                  peer_info.h \
    65                  netdefs.h \
    66                  message_manager.h \
    67                  network_log.h \
    68                  zip.h \
    69                  player_stats.h \
    70                  udp_broadcast.h \
    71                  \
    72                  proxy/proxy_settings.cc \
    73                  \
    74                  monitor/connection_monitor.h \
    75                  monitor/network_monitor.h \
    76                  monitor/network_node.h \
    77                  \
    78                  synchronizeable_var/synchronizeable_var.h \
    79                  synchronizeable_var/synchronizeable_vector.h \
    80                  synchronizeable_var/synchronizeable_int.h \
    81                  synchronizeable_var/synchronizeable_quaternion.h \
    82                  synchronizeable_var/synchronizeable_string.h \
    83                  synchronizeable_var/synchronizeable_float.h \
    84                  synchronizeable_var/synchronizeable_bool.h \
    85                  synchronizeable_var/synchronizeable_uint.h \
    86                  synchronizeable_var/synchronizeable_ip.h \
    87                  \
    88                  ip.h
    89 
    90 
     49noinst_HEADERS = \
     50                netdefs.h \
     51                net_types.h \
     52                synchronizeable.h \
     53                network_manager.h \
     54                shared_network_data.h \
     55                network_socket.h \
     56                network_stream.h \
     57                data_stream.h \
     58                network_protocol.h \
     59                server_socket.h \
     60                tcp_server_socket.h \
     61                tcp_socket.h \
     62                udp_server_socket.h \
     63                udp_socket.h \
     64                handshake.h \
     65                network_game_manager.h \
     66                converter.h \
     67                peer_info.h \
     68                netdefs.h \
     69                message_manager.h \
     70                network_log.h \
     71                zip.h \
     72                player_stats.h \
     73                udp_broadcast.h \
     74                \
     75                proxy/proxy_settings.cc \
     76                \
     77                monitor/connection_monitor.h \
     78                monitor/network_monitor.h \
     79                monitor/network_node.h \
     80                \
     81                synchronizeable_var/synchronizeable_var.h \
     82                synchronizeable_var/synchronizeable_vector.h \
     83                synchronizeable_var/synchronizeable_int.h \
     84                synchronizeable_var/synchronizeable_quaternion.h \
     85                synchronizeable_var/synchronizeable_string.h \
     86                synchronizeable_var/synchronizeable_float.h \
     87                synchronizeable_var/synchronizeable_bool.h \
     88                synchronizeable_var/synchronizeable_uint.h \
     89                synchronizeable_var/synchronizeable_ip.h \
     90                \
     91                ip.h
  • branches/proxy/src/lib/network/message_manager.cc

    r9357 r9386  
    2020#include "network_stream.h"
    2121#include "shared_network_data.h"
     22#include "converter.h"
     23#include <cassert>
    2224
    2325
  • branches/proxy/src/lib/network/netdefs.h

    r9384 r9386  
    2222 */
    2323
    24 #ifndef _NETDEFS
    25 #define _NETDEFS
     24#ifndef _NETDEFS_H
     25#define _NETDEFS_H
    2626
     27#include "net_types.h"
    2728
    2829#ifdef HAVE_SDL_NET_H
     
    4647//!< orxonox network version identifier
    4748#define _ORXONOX_VERSION   1
    48 
    49 
    50 typedef unsigned char byte;
    5149
    5250
     
    7573} UidType;
    7674
    77 #endif /* _NETWORK_MANAGER */
     75#endif /* _NETDEFS_H */
  • branches/proxy/src/lib/network/network_stream.cc

    r9375 r9386  
    5151
    5252
    53 
     53/// TODO @THIS IS FOR THE INTSIZE
     54#include "converter.h"
    5455
    5556
  • branches/proxy/src/lib/network/player_stats.cc

    r9347 r9386  
    2222#include "state.h"
    2323#include "shared_network_data.h"
     24
     25#include "converter.h"
    2426
    2527#include "preferences.h"
  • branches/proxy/src/lib/network/synchronizeable.cc

    r9377 r9386  
    2828
    2929#include "synchronizeable.h"
     30
     31#include "converter.h"
    3032
    3133
  • branches/proxy/src/lib/network/synchronizeable.h

    r9347 r9386  
    11/*!
    22 * @file synchronizeable.h
    3     \brief interface for all classes that have to be synchronized
     3 * @brief interface for all classes that have to be synchronized
    44 */
    55
     
    88
    99#include "base_object.h"
    10 #include "netdefs.h"
    11 #include "converter.h"
    12 #include "vector.h"
    13 #include "quaternion.h"
     10
    1411#include "synchronizeable_var/synchronizeable_var.h"
    1512#include "synchronizeable_var/synchronizeable_vector.h"
     
    2118#include "synchronizeable_var/synchronizeable_uint.h"
    2219#include "synchronizeable_var/synchronizeable_ip.h"
    23 
    2420
    2521#include <vector>
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_bool.cc

    r7954 r9386  
    1616
    1717#include "synchronizeable_bool.h"
     18#include <cassert>
    1819
    1920
     
    4445{
    4546  assert( maxLength >= 1 );
    46  
     47
    4748  buf[0] = ( *vPtrIn ) ? 1 : 0;
    48  
     49
    4950  return 1;
    5051}
     
    5960{
    6061  assert( maxLength >= 1 );
    61  
     62
    6263  bool oldVal = *vPtrOut;
    63  
     64
    6465  *vPtrOut = buf[0] != 0;
    65  
     66
    6667  setHasChanged( oldVal != *vPtrOut );
    67  
     68
    6869  return 1;
    6970}
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_bool.h

    r9347 r9386  
    22 * @file synchronizeable_int.h
    33 * @brief Definition of SynchronizeableInt
    4 */
    5 
    6 #include "synchronizeable_var/synchronizeable_var.h"
     4 */
    75
    86#ifndef _SYNCHRONIZEABLE_BOOL_H
    97#define _SYNCHRONIZEABLE_BOOL_H
     8
     9#include "synchronizeable_var.h"
    1010
    1111class SynchronizeableBool : public SynchronizeableVar {
     
    1414    SynchronizeableBool( bool * ptrIn, bool * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );
    1515    virtual ~SynchronizeableBool();
    16    
     16
    1717    virtual int writeToBuf( byte * buf, int maxLength );
    1818    virtual int readFromBuf( byte * buf, int maxLength );
    19    
     19
    2020    /**
    2121     * check if writeToBuf will return the same size every time
     
    2323     */
    2424    virtual bool hasStaticSize(){ return true; };
    25    
     25
    2626    virtual void debug();
    27    
     27
    2828  private:
    2929    bool * vPtrIn;       //!< pointer to data (read)
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_float.cc

    r7954 r9386  
    1717#include "synchronizeable_float.h"
    1818#include "converter.h"
     19#include <cassert>
    1920
    2021
     
    4647{
    4748  int res = Converter::floatToByteArray( *vPtrIn, buf, maxLength );
    48  
     49
    4950  assert( res == FLOATSIZE );
    50  
     51
    5152  return res;
    5253}
     
    6162{
    6263  assert( maxLength >= FLOATSIZE );
    63  
     64
    6465  float oldVal = *vPtrOut;
    65  
     66
    6667  int res = Converter::byteArrayToFloat( buf, vPtrOut );
    67  
     68
    6869  setHasChanged( oldVal != *vPtrOut );
    69  
     70
    7071  assert( res == FLOATSIZE );
    71  
     72
    7273  return res;
    7374}
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_float.h

    r9347 r9386  
    22 * @file synchronizeable_float.h
    33 * @brief Definition of SynchronizeableFloat
    4 */
     4 */
    55
    6 #include "synchronizeable_var/synchronizeable_var.h"
    76
    87#ifndef _SYNCHRONIZEABLE_FLOAT_H
    98#define _SYNCHRONIZEABLE_FLOAT_H
     9
     10#include "synchronizeable_var.h"
    1011
    1112class SynchronizeableFloat : public SynchronizeableVar {
     
    1415    SynchronizeableFloat( float * ptrIn, float * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );
    1516    virtual ~SynchronizeableFloat();
    16    
     17
    1718    virtual int writeToBuf( byte * buf, int maxLength );
    1819    virtual int readFromBuf( byte * buf, int maxLength );
    19        
     20
    2021    /**
    2122     * check if writeToBuf will return the same size every time
     
    2324     */
    2425    virtual bool hasStaticSize(){ return true; };
    25    
     26
    2627    virtual void debug();
    27    
     28
    2829  private:
    2930    float * vPtrIn;       //!< pointer to data (read)
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_int.cc

    r7954 r9386  
    1818#include "converter.h"
    1919
     20#include <cassert>
    2021
    2122/**
     
    4647{
    4748  int res = Converter::intToByteArray( *vPtrIn, buf, maxLength );
    48  
     49
    4950  assert( res == INTSIZE );
    50  
     51
    5152  return res;
    5253}
     
    6162{
    6263  assert( maxLength >= INTSIZE );
    63  
     64
    6465  int oldVal = *vPtrOut;
    65  
     66
    6667  int res = Converter::byteArrayToInt( buf, vPtrOut );
    67  
     68
    6869  setHasChanged( oldVal != *vPtrOut );
    69  
     70
    7071  assert( res == INTSIZE );
    71  
     72
    7273  return res;
    7374}
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_int.h

    r9347 r9386  
    44*/
    55
    6 #include "synchronizeable_var/synchronizeable_var.h"
    76
    87#ifndef _SYNCHRONIZEABLE_INT_H
    98#define _SYNCHRONIZEABLE_INT_H
     9
     10#include "synchronizeable_var.h"
    1011
    1112class SynchronizeableInt : public SynchronizeableVar {
     
    1415    SynchronizeableInt( int * ptrIn, int * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );
    1516    virtual ~SynchronizeableInt();
    16    
     17
    1718    virtual int writeToBuf( byte * buf, int maxLength );
    1819    virtual int readFromBuf( byte * buf, int maxLength );
    19    
     20
    2021    /**
    2122     * check if writeToBuf will return the same size every time
     
    2324     */
    2425    virtual bool hasStaticSize(){ return true; };
    25    
     26
    2627    virtual void debug();
    27    
     28
    2829  protected:
    2930    int * vPtrIn;       //!< pointer to data (read)
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_ip.cc

    r9377 r9386  
    1616#include "synchronizeable_ip.h"
    1717#include "converter.h"
    18 // #include "ip.h"
     18#include "netdefs.h"
     19#include "ip.h"
     20#include <cassert>
    1921
    2022/**
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_ip.h

    r9347 r9386  
    44*/
    55
    6 #include "synchronizeable_var/synchronizeable_var.h"
    76
    87#ifndef _SYNCHRONIZEABLE_IP_H
    98#define _SYNCHRONIZEABLE_IP_H
    109
    11 #include "vector.h"
     10#include "synchronizeable_var.h"
    1211
    13 #include "netdefs.h"
    14 #include "ip.h"
     12class IP;
    1513
    1614class SynchronizeableIP : public SynchronizeableVar {
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_quaternion.cc

    r7954 r9386  
    1717#include "synchronizeable_quaternion.h"
    1818#include "converter.h"
     19#include <cassert>
    1920
    2021
     
    9899  assert( res > 0 );
    99100  n += res;
    100  
     101
    101102  Quaternion oldVal = *vPtrOut;
    102103
    103104  *vPtrOut = Quaternion( Vector(x, y, z), w );
    104  
     105
    105106  setHasChanged( ! ( oldVal == *vPtrOut ) );
    106107
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_quaternion.h

    r9347 r9386  
    44*/
    55
    6 #include "synchronizeable_var/synchronizeable_var.h"
    7 
    86#ifndef _SYNCHRONIZEABLE_QUATERNION_H
    97#define _SYNCHRONIZEABLE_QUATERNION_H
     8
     9#include "synchronizeable_var.h"
    1010
    1111#include "quaternion.h"
     
    1616    SynchronizeableQuaternion( Quaternion * ptrIn, Quaternion * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );
    1717    virtual ~SynchronizeableQuaternion();
    18    
     18
    1919    virtual int writeToBuf( byte * buf, int maxLength );
    2020    virtual int readFromBuf( byte * buf, int maxLength );
    21        
     21
    2222    /**
    2323     * check if writeToBuf will return the same size every time
     
    2525     */
    2626    virtual bool hasStaticSize(){ return true; };
    27    
     27
    2828    virtual void debug();
    29    
     29
    3030  private:
    3131    Quaternion * vPtrIn;       //!< pointer to data (read)
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_string.cc

    r8147 r9386  
    1717#include "synchronizeable_string.h"
    1818#include "converter.h"
     19#include <cassert>
    1920
    2021
     
    4647{
    4748  int res = Converter::stringToByteArray( *vPtrIn, buf, maxLength );
    48  
     49
    4950  assert( res > 0 );
    5051  assert( res == vPtrIn->length()+INTSIZE );
    51  
     52
    5253  return res;
     54}
     55
     56int SynchronizeableString::getSize()
     57{
     58   return vPtrIn->length()+INTSIZE;
    5359}
    5460
     
    6268{
    6369  std::string oldVal = *vPtrOut;
    64      
     70
    6571  int res = Converter::byteArrayToString( buf, *vPtrOut, maxLength );
    66  
     72
    6773  setHasChanged( oldVal != *vPtrOut );
    68  
     74
    6975  if ( res < 0 )
    7076  {
     
    7278  }
    7379  assert( res > 0 );
    74  
     80
    7581  return res;
    7682}
     
    94100{
    95101  std::string t;
    96  
     102
    97103  int res = Converter::byteArrayToString( buf, t, maxLength );
    98  
     104
    99105  assert( res > 0 );
    100  
     106
    101107  return res;
    102108}
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_string.h

    r9347 r9386  
    44*/
    55
    6 #include "synchronizeable_var/synchronizeable_var.h"
    7 #include "converter.h"
    8 
    96#ifndef _SYNCHRONIZEABLE_STRING_H
    107#define _SYNCHRONIZEABLE_STRING_H
     8
     9#include "synchronizeable_var.h"
    1110
    1211#include <string>
     
    1716    SynchronizeableString( std::string * ptrIn, std::string * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );
    1817    virtual ~SynchronizeableString();
    19    
     18
    2019    virtual int writeToBuf( byte * buf, int maxLength );
    2120    virtual int readFromBuf( byte * buf, int maxLength );
    22    
    23        
     21
     22
    2423    /**
    2524     * check if writeToBuf will return the same size every time
     
    2726     */
    2827    virtual bool hasStaticSize(){ return false; };
    29    
    30     virtual int getSize(){ return vPtrIn->length()+INTSIZE; }
    31    
     28
     29    virtual int getSize();
     30
    3231    virtual int getSizeFromBuf( byte * buf, int maxLength );
    33    
     32
    3433    virtual void debug();
    35    
     34
    3635  private:
    3736    std::string * vPtrIn;       //!< pointer to data (read)
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_uint.h

    r9347 r9386  
    44*/
    55
    6 #include "synchronizeable_var/synchronizeable_int.h"
    76
    87#ifndef _SYNCHRONIZEABLE_UINT_H
    98#define _SYNCHRONIZEABLE_UINT_H
     9
     10#include "synchronizeable_int.h"
    1011
    1112class SynchronizeableUInt : public SynchronizeableInt {
     
    1415    SynchronizeableUInt( unsigned int * ptrIn, unsigned int * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );
    1516    virtual ~SynchronizeableUInt();
    16    
     17
    1718    virtual void debug();
    1819
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_var.cc

    r7954 r9386  
    1616
    1717#include "synchronizeable_var.h"
    18 
     18#include "netdefs.h"
     19#include <cassert>
    1920
    2021
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_var.h

    r9347 r9386  
    77#define _SYNCHRONIZEABLE_VAR_H
    88
     9#include "net_types.h"
    910#include <string>
    10 #include "netdefs.h"
    11 #include <assert.h>
    1211
    1312enum {
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_vector.cc

    r7954 r9386  
    1717#include "synchronizeable_vector.h"
    1818#include "converter.h"
     19#include <cassert>
    1920
    2021
     
    7980  int res;
    8081  int n = 0;
    81  
     82
    8283  Vector oldVec = *vPtrOut;
    8384
     
    9596
    9697  *vPtrOut = Vector( x, y, z );
    97  
     98
    9899  setHasChanged( !(*vPtrOut == oldVec) );
    99100
  • branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_vector.h

    r9347 r9386  
    44*/
    55
    6 #include "synchronizeable_var/synchronizeable_var.h"
    7 
    86#ifndef _SYNCHRONIZEABLE_VECTOR_H
    97#define _SYNCHRONIZEABLE_VECTOR_H
     8
     9#include "synchronizeable_var.h"
    1010
    1111#include "vector.h"
     
    1616    SynchronizeableVector( Vector * ptrIn, Vector * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 );
    1717    virtual ~SynchronizeableVector();
    18    
     18
    1919    virtual int writeToBuf( byte * buf, int maxLength );
    2020    virtual int readFromBuf( byte * buf, int maxLength );
    21    
     21
    2222    /**
    2323     * check if writeToBuf will return the same size every time
     
    2525     */
    2626    virtual bool hasStaticSize(){ return true; }
    27    
     27
    2828    virtual void debug();
    29    
     29
    3030  private:
    3131    Vector * vPtrIn;       //!< pointer to data (read)
  • branches/proxy/src/lib/particles/particle_system.cc

    r9371 r9386  
    460460    int i = 1;
    461461    Particle* tmpPart = this->deadList;
    462     while (tmpPart = tmpPart->next) { ++i; }
     462    while ((tmpPart = tmpPart->next) != NULL) { ++i; }
    463463    PRINT(0)("count: %d\n", i);
    464464  }
  • branches/proxy/src/util/network_stats_widget.h

    r9385 r9386  
    8484
    8585
     86      void addProxy(const std::string& name, const IP& proxy);
     87
     88
    8689      //void rebuildConnectedHosts(std::vector<hosts> hosts);
    8790
  • branches/proxy/src/world_entities/spawning_point.cc

    r9371 r9386  
    3030
    3131#include "shared_network_data.h"
     32
     33
     34/// TODO REMOVE converter.h
     35#include "converter.h"
    3236
    3337CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT );
Note: See TracChangeset for help on using the changeset viewer.