Changeset 9347 in orxonox.OLD for branches/proxy/src/util
- Timestamp:
- Jul 20, 2006, 11:43:27 AM (18 years ago)
- Location:
- branches/proxy/src/util
- Files:
-
- 5 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/util/Makefile.am
r8068 r9347 14 14 singleplayer_shootemup.cc \ 15 15 \ 16 \ 17 \ 16 18 mission_goal.cc\ 17 19 kill_target.cc\ … … 24 26 animation/animation_player.cc \ 25 27 \ 26 track/pilot_node.cc 28 track/pilot_node.cc \ 29 \ 30 network_stats_widget.cc 27 31 28 32 # track/track_manager.cc \ … … 50 54 animation/t_animation.h \ 51 55 \ 52 track/pilot_node.h 56 track/pilot_node.h \ 57 \ 58 network_stats_widget.h 59 53 60 54 61 # track/track_manager.h \ -
branches/proxy/src/util/game_rules.cc
r9008 r9347 88 88 void GameRules::registerKill(const Kill& kill) 89 89 { 90 if ( !SharedNetworkData::getInstance()->is GameServer() )90 if ( !SharedNetworkData::getInstance()->isMasterServer() ) 91 91 return; 92 92 -
branches/proxy/src/util/multiplayer_team_deathmatch.cc
r9235 r9347 204 204 assignPlayable(); 205 205 206 if ( !SharedNetworkData::getInstance()->is GameServer() )206 if ( !SharedNetworkData::getInstance()->isMasterServer() ) 207 207 return; 208 208 … … 214 214 this->killList.erase( this->killList.begin() ); 215 215 } 216 216 217 217 218 218 … … 268 268 void MultiplayerTeamDeathmatch::checkGameRules() 269 269 { 270 if ( !SharedNetworkData::getInstance()->is GameServer() )270 if ( !SharedNetworkData::getInstance()->isMasterServer() ) 271 271 return; 272 272 … … 320 320 return "maps/male_fiend.pcx"; 321 321 } 322 322 323 323 return ""; 324 324 } … … 330 330 return 10.0f; 331 331 } 332 332 333 333 return 1.0f; 334 334 } … … 680 680 char st[10]; 681 681 int i = 0; 682 682 683 683 i = 2; 684 684 for ( TeamScoreList::const_iterator it = scoreList[0].begin(); it != scoreList[0].end(); it++ ) … … 719 719 return; 720 720 } 721 721 722 722 int killerUserId = killer->getOwner(); 723 723 int victimUserId = victim->getOwner(); 724 724 725 725 PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassName(), victim->getClassName()); 726 726 727 727 PlayerStats & victimStats = *PlayerStats::getStats( victimUserId ); 728 728 PlayerStats & killerStats = *PlayerStats::getStats( killerUserId ); 729 729 730 730 if ( killerStats.getPlayable() != killer || victimStats.getPlayable() != victim ) 731 731 { -
branches/proxy/src/util/signal_handler.cc
r9240 r9347 27 27 } 28 28 29 void SignalHandler::doCatch( std::string appName ) 29 /** 30 * register signal handlers for SIGSEGV and SIGABRT 31 * @param appName path to executable eg argv[0] 32 * @param fileName filename to append backtrace to 33 */ 34 void SignalHandler::doCatch( const std::string & appName, const std::string & fileName ) 30 35 { 31 36 this->appName = appName; 37 this->fileName = fileName; 38 39 // make sure doCatch is only called once without calling dontCatch 40 assert( sigRecList.size() == 0 ); 32 41 33 42 catchSignal( SIGSEGV ); … … 35 44 } 36 45 46 /** 47 * restore previous signal handlers 48 */ 37 49 void SignalHandler::dontCatch() 38 50 { … … 45 57 } 46 58 59 /** 60 * catch signal sig 61 * @param sig signal to catch 62 */ 47 63 void SignalHandler::catchSignal( int sig ) 48 64 { … … 58 74 } 59 75 76 /** 77 * sigHandler is called when receiving signals 78 * @param sig 79 */ 60 80 void SignalHandler::sigHandler( int sig ) 61 81 { … … 167 187 ) 168 188 charsFound++; 189 else 190 charsFound = 0; 169 191 170 192 if ( charsFound == 6 ) … … 183 205 write( sigPipe[1], &someData, sizeof(someData) ); 184 206 185 write( gdbIn[1], "bt\n q\n", 5);207 write( gdbIn[1], "bt\nk\nq\n", 7 ); 186 208 187 209 … … 202 224 ) 203 225 charsFound++; 226 else 227 charsFound = 0; 204 228 205 229 if ( charsFound == 6 ) … … 210 234 } 211 235 212 if ( promptFound == 2)236 if ( promptFound == 3 ) 213 237 { 214 238 break; … … 240 264 bt.insert(0, timeString); 241 265 242 FILE * f = fopen( GDB_BT_FILE, "a" );266 FILE * f = fopen( getInstance()->fileName.c_str(), "a" ); 243 267 244 268 if ( !f ) 245 269 { 246 perror( "could not append to " GDB_BT_FILE);270 perror( ( std::string( "could not append to " ) + getInstance()->fileName ).c_str() ); 247 271 exit(EXIT_FAILURE); 248 272 } … … 250 274 if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() ) 251 275 { 252 printf( "could not write %d byte to " GDB_BT_FILE, bt.length());276 printf( ( std::string("could not write %d byte to ") + getInstance()->fileName ).c_str(), bt.length()); 253 277 exit(EXIT_FAILURE); 254 278 } -
branches/proxy/src/util/signal_handler.h
r9240 r9347 9 9 #include <list> 10 10 #include <string> 11 12 13 #define GDB_BT_FILE "orxonox.backtrace"14 11 15 12 typedef int (*SignalCallback)( void * someData ); … … 44 41 void registerCallback( SignalCallback cb, void * someData ); 45 42 46 void doCatch( std::string appName );43 void doCatch( const std::string & appName, const std::string & fileName ); 47 44 void dontCatch(); 48 45 … … 58 55 59 56 std::string appName; 57 std::string fileName; 60 58 }; 61 59
Note: See TracChangeset
for help on using the changeset viewer.