Changeset 9386 in orxonox.OLD for branches/proxy/src/lib
- Timestamp:
- Jul 21, 2006, 1:41:39 PM (18 years ago)
- Location:
- branches/proxy/src/lib
- Files:
-
- 1 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/coord/p_node.cc
r9377 r9386 21 21 #include "class_list.h" 22 22 23 #include "netdefs.h" 24 23 25 #include <algorithm> 24 26 #include "compiler.h" … … 27 29 #include "glincl.h" 28 30 #include "color.h" 29 30 #include "synchronizeable.h"31 31 32 32 /** -
branches/proxy/src/lib/lang/base_object.h
r9371 r9386 15 15 16 16 #include "class_id.h" 17 #include "sigslot/slot.h" 18 17 19 #include <string> 18 19 #include "sigslot/slot.h"20 20 21 21 class TiXmlNode; -
branches/proxy/src/lib/network/Makefile.am
r9347 r9386 47 47 48 48 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 49 noinst_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 20 20 #include "network_stream.h" 21 21 #include "shared_network_data.h" 22 #include "converter.h" 23 #include <cassert> 22 24 23 25 -
branches/proxy/src/lib/network/netdefs.h
r9384 r9386 22 22 */ 23 23 24 #ifndef _NETDEFS 25 #define _NETDEFS 24 #ifndef _NETDEFS_H 25 #define _NETDEFS_H 26 26 27 #include "net_types.h" 27 28 28 29 #ifdef HAVE_SDL_NET_H … … 46 47 //!< orxonox network version identifier 47 48 #define _ORXONOX_VERSION 1 48 49 50 typedef unsigned char byte;51 49 52 50 … … 75 73 } UidType; 76 74 77 #endif /* _NET WORK_MANAGER*/75 #endif /* _NETDEFS_H */ -
branches/proxy/src/lib/network/network_stream.cc
r9375 r9386 51 51 52 52 53 53 /// TODO @THIS IS FOR THE INTSIZE 54 #include "converter.h" 54 55 55 56 -
branches/proxy/src/lib/network/player_stats.cc
r9347 r9386 22 22 #include "state.h" 23 23 #include "shared_network_data.h" 24 25 #include "converter.h" 24 26 25 27 #include "preferences.h" -
branches/proxy/src/lib/network/synchronizeable.cc
r9377 r9386 28 28 29 29 #include "synchronizeable.h" 30 31 #include "converter.h" 30 32 31 33 -
branches/proxy/src/lib/network/synchronizeable.h
r9347 r9386 1 1 /*! 2 2 * @file synchronizeable.h 3 \brief interface for all classes that have to be synchronized3 * @brief interface for all classes that have to be synchronized 4 4 */ 5 5 … … 8 8 9 9 #include "base_object.h" 10 #include "netdefs.h" 11 #include "converter.h" 12 #include "vector.h" 13 #include "quaternion.h" 10 14 11 #include "synchronizeable_var/synchronizeable_var.h" 15 12 #include "synchronizeable_var/synchronizeable_vector.h" … … 21 18 #include "synchronizeable_var/synchronizeable_uint.h" 22 19 #include "synchronizeable_var/synchronizeable_ip.h" 23 24 20 25 21 #include <vector> -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_bool.cc
r7954 r9386 16 16 17 17 #include "synchronizeable_bool.h" 18 #include <cassert> 18 19 19 20 … … 44 45 { 45 46 assert( maxLength >= 1 ); 46 47 47 48 buf[0] = ( *vPtrIn ) ? 1 : 0; 48 49 49 50 return 1; 50 51 } … … 59 60 { 60 61 assert( maxLength >= 1 ); 61 62 62 63 bool oldVal = *vPtrOut; 63 64 64 65 *vPtrOut = buf[0] != 0; 65 66 66 67 setHasChanged( oldVal != *vPtrOut ); 67 68 68 69 return 1; 69 70 } -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_bool.h
r9347 r9386 2 2 * @file synchronizeable_int.h 3 3 * @brief Definition of SynchronizeableInt 4 */ 5 6 #include "synchronizeable_var/synchronizeable_var.h" 4 */ 7 5 8 6 #ifndef _SYNCHRONIZEABLE_BOOL_H 9 7 #define _SYNCHRONIZEABLE_BOOL_H 8 9 #include "synchronizeable_var.h" 10 10 11 11 class SynchronizeableBool : public SynchronizeableVar { … … 14 14 SynchronizeableBool( bool * ptrIn, bool * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 15 virtual ~SynchronizeableBool(); 16 16 17 17 virtual int writeToBuf( byte * buf, int maxLength ); 18 18 virtual int readFromBuf( byte * buf, int maxLength ); 19 19 20 20 /** 21 21 * check if writeToBuf will return the same size every time … … 23 23 */ 24 24 virtual bool hasStaticSize(){ return true; }; 25 25 26 26 virtual void debug(); 27 27 28 28 private: 29 29 bool * vPtrIn; //!< pointer to data (read) -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_float.cc
r7954 r9386 17 17 #include "synchronizeable_float.h" 18 18 #include "converter.h" 19 #include <cassert> 19 20 20 21 … … 46 47 { 47 48 int res = Converter::floatToByteArray( *vPtrIn, buf, maxLength ); 48 49 49 50 assert( res == FLOATSIZE ); 50 51 51 52 return res; 52 53 } … … 61 62 { 62 63 assert( maxLength >= FLOATSIZE ); 63 64 64 65 float oldVal = *vPtrOut; 65 66 66 67 int res = Converter::byteArrayToFloat( buf, vPtrOut ); 67 68 68 69 setHasChanged( oldVal != *vPtrOut ); 69 70 70 71 assert( res == FLOATSIZE ); 71 72 72 73 return res; 73 74 } -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_float.h
r9347 r9386 2 2 * @file synchronizeable_float.h 3 3 * @brief Definition of SynchronizeableFloat 4 */4 */ 5 5 6 #include "synchronizeable_var/synchronizeable_var.h"7 6 8 7 #ifndef _SYNCHRONIZEABLE_FLOAT_H 9 8 #define _SYNCHRONIZEABLE_FLOAT_H 9 10 #include "synchronizeable_var.h" 10 11 11 12 class SynchronizeableFloat : public SynchronizeableVar { … … 14 15 SynchronizeableFloat( float * ptrIn, float * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 16 virtual ~SynchronizeableFloat(); 16 17 17 18 virtual int writeToBuf( byte * buf, int maxLength ); 18 19 virtual int readFromBuf( byte * buf, int maxLength ); 19 20 20 21 /** 21 22 * check if writeToBuf will return the same size every time … … 23 24 */ 24 25 virtual bool hasStaticSize(){ return true; }; 25 26 26 27 virtual void debug(); 27 28 28 29 private: 29 30 float * vPtrIn; //!< pointer to data (read) -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_int.cc
r7954 r9386 18 18 #include "converter.h" 19 19 20 #include <cassert> 20 21 21 22 /** … … 46 47 { 47 48 int res = Converter::intToByteArray( *vPtrIn, buf, maxLength ); 48 49 49 50 assert( res == INTSIZE ); 50 51 51 52 return res; 52 53 } … … 61 62 { 62 63 assert( maxLength >= INTSIZE ); 63 64 64 65 int oldVal = *vPtrOut; 65 66 66 67 int res = Converter::byteArrayToInt( buf, vPtrOut ); 67 68 68 69 setHasChanged( oldVal != *vPtrOut ); 69 70 70 71 assert( res == INTSIZE ); 71 72 72 73 return res; 73 74 } -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_int.h
r9347 r9386 4 4 */ 5 5 6 #include "synchronizeable_var/synchronizeable_var.h"7 6 8 7 #ifndef _SYNCHRONIZEABLE_INT_H 9 8 #define _SYNCHRONIZEABLE_INT_H 9 10 #include "synchronizeable_var.h" 10 11 11 12 class SynchronizeableInt : public SynchronizeableVar { … … 14 15 SynchronizeableInt( int * ptrIn, int * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 16 virtual ~SynchronizeableInt(); 16 17 17 18 virtual int writeToBuf( byte * buf, int maxLength ); 18 19 virtual int readFromBuf( byte * buf, int maxLength ); 19 20 20 21 /** 21 22 * check if writeToBuf will return the same size every time … … 23 24 */ 24 25 virtual bool hasStaticSize(){ return true; }; 25 26 26 27 virtual void debug(); 27 28 28 29 protected: 29 30 int * vPtrIn; //!< pointer to data (read) -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_ip.cc
r9377 r9386 16 16 #include "synchronizeable_ip.h" 17 17 #include "converter.h" 18 // #include "ip.h" 18 #include "netdefs.h" 19 #include "ip.h" 20 #include <cassert> 19 21 20 22 /** -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_ip.h
r9347 r9386 4 4 */ 5 5 6 #include "synchronizeable_var/synchronizeable_var.h"7 6 8 7 #ifndef _SYNCHRONIZEABLE_IP_H 9 8 #define _SYNCHRONIZEABLE_IP_H 10 9 11 #include " vector.h"10 #include "synchronizeable_var.h" 12 11 13 #include "netdefs.h" 14 #include "ip.h" 12 class IP; 15 13 16 14 class SynchronizeableIP : public SynchronizeableVar { -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_quaternion.cc
r7954 r9386 17 17 #include "synchronizeable_quaternion.h" 18 18 #include "converter.h" 19 #include <cassert> 19 20 20 21 … … 98 99 assert( res > 0 ); 99 100 n += res; 100 101 101 102 Quaternion oldVal = *vPtrOut; 102 103 103 104 *vPtrOut = Quaternion( Vector(x, y, z), w ); 104 105 105 106 setHasChanged( ! ( oldVal == *vPtrOut ) ); 106 107 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_quaternion.h
r9347 r9386 4 4 */ 5 5 6 #include "synchronizeable_var/synchronizeable_var.h"7 8 6 #ifndef _SYNCHRONIZEABLE_QUATERNION_H 9 7 #define _SYNCHRONIZEABLE_QUATERNION_H 8 9 #include "synchronizeable_var.h" 10 10 11 11 #include "quaternion.h" … … 16 16 SynchronizeableQuaternion( Quaternion * ptrIn, Quaternion * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 17 17 virtual ~SynchronizeableQuaternion(); 18 18 19 19 virtual int writeToBuf( byte * buf, int maxLength ); 20 20 virtual int readFromBuf( byte * buf, int maxLength ); 21 21 22 22 /** 23 23 * check if writeToBuf will return the same size every time … … 25 25 */ 26 26 virtual bool hasStaticSize(){ return true; }; 27 27 28 28 virtual void debug(); 29 29 30 30 private: 31 31 Quaternion * vPtrIn; //!< pointer to data (read) -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_string.cc
r8147 r9386 17 17 #include "synchronizeable_string.h" 18 18 #include "converter.h" 19 #include <cassert> 19 20 20 21 … … 46 47 { 47 48 int res = Converter::stringToByteArray( *vPtrIn, buf, maxLength ); 48 49 49 50 assert( res > 0 ); 50 51 assert( res == vPtrIn->length()+INTSIZE ); 51 52 52 53 return res; 54 } 55 56 int SynchronizeableString::getSize() 57 { 58 return vPtrIn->length()+INTSIZE; 53 59 } 54 60 … … 62 68 { 63 69 std::string oldVal = *vPtrOut; 64 70 65 71 int res = Converter::byteArrayToString( buf, *vPtrOut, maxLength ); 66 72 67 73 setHasChanged( oldVal != *vPtrOut ); 68 74 69 75 if ( res < 0 ) 70 76 { … … 72 78 } 73 79 assert( res > 0 ); 74 80 75 81 return res; 76 82 } … … 94 100 { 95 101 std::string t; 96 102 97 103 int res = Converter::byteArrayToString( buf, t, maxLength ); 98 104 99 105 assert( res > 0 ); 100 106 101 107 return res; 102 108 } -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_string.h
r9347 r9386 4 4 */ 5 5 6 #include "synchronizeable_var/synchronizeable_var.h"7 #include "converter.h"8 9 6 #ifndef _SYNCHRONIZEABLE_STRING_H 10 7 #define _SYNCHRONIZEABLE_STRING_H 8 9 #include "synchronizeable_var.h" 11 10 12 11 #include <string> … … 17 16 SynchronizeableString( std::string * ptrIn, std::string * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 18 17 virtual ~SynchronizeableString(); 19 18 20 19 virtual int writeToBuf( byte * buf, int maxLength ); 21 20 virtual int readFromBuf( byte * buf, int maxLength ); 22 23 21 22 24 23 /** 25 24 * check if writeToBuf will return the same size every time … … 27 26 */ 28 27 virtual bool hasStaticSize(){ return false; }; 29 30 virtual int getSize() { return vPtrIn->length()+INTSIZE; }31 28 29 virtual int getSize(); 30 32 31 virtual int getSizeFromBuf( byte * buf, int maxLength ); 33 32 34 33 virtual void debug(); 35 34 36 35 private: 37 36 std::string * vPtrIn; //!< pointer to data (read) -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_uint.h
r9347 r9386 4 4 */ 5 5 6 #include "synchronizeable_var/synchronizeable_int.h"7 6 8 7 #ifndef _SYNCHRONIZEABLE_UINT_H 9 8 #define _SYNCHRONIZEABLE_UINT_H 9 10 #include "synchronizeable_int.h" 10 11 11 12 class SynchronizeableUInt : public SynchronizeableInt { … … 14 15 SynchronizeableUInt( unsigned int * ptrIn, unsigned int * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 16 virtual ~SynchronizeableUInt(); 16 17 17 18 virtual void debug(); 18 19 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_var.cc
r7954 r9386 16 16 17 17 #include "synchronizeable_var.h" 18 18 #include "netdefs.h" 19 #include <cassert> 19 20 20 21 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_var.h
r9347 r9386 7 7 #define _SYNCHRONIZEABLE_VAR_H 8 8 9 #include "net_types.h" 9 10 #include <string> 10 #include "netdefs.h"11 #include <assert.h>12 11 13 12 enum { -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_vector.cc
r7954 r9386 17 17 #include "synchronizeable_vector.h" 18 18 #include "converter.h" 19 #include <cassert> 19 20 20 21 … … 79 80 int res; 80 81 int n = 0; 81 82 82 83 Vector oldVec = *vPtrOut; 83 84 … … 95 96 96 97 *vPtrOut = Vector( x, y, z ); 97 98 98 99 setHasChanged( !(*vPtrOut == oldVec) ); 99 100 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_vector.h
r9347 r9386 4 4 */ 5 5 6 #include "synchronizeable_var/synchronizeable_var.h"7 8 6 #ifndef _SYNCHRONIZEABLE_VECTOR_H 9 7 #define _SYNCHRONIZEABLE_VECTOR_H 8 9 #include "synchronizeable_var.h" 10 10 11 11 #include "vector.h" … … 16 16 SynchronizeableVector( Vector * ptrIn, Vector * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 17 17 virtual ~SynchronizeableVector(); 18 18 19 19 virtual int writeToBuf( byte * buf, int maxLength ); 20 20 virtual int readFromBuf( byte * buf, int maxLength ); 21 21 22 22 /** 23 23 * check if writeToBuf will return the same size every time … … 25 25 */ 26 26 virtual bool hasStaticSize(){ return true; } 27 27 28 28 virtual void debug(); 29 29 30 30 private: 31 31 Vector * vPtrIn; //!< pointer to data (read) -
branches/proxy/src/lib/particles/particle_system.cc
r9371 r9386 460 460 int i = 1; 461 461 Particle* tmpPart = this->deadList; 462 while ( tmpPart = tmpPart->next) { ++i; }462 while ((tmpPart = tmpPart->next) != NULL) { ++i; } 463 463 PRINT(0)("count: %d\n", i); 464 464 }
Note: See TracChangeset
for help on using the changeset viewer.