Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9347 in orxonox.OLD for branches/proxy/src/util


Ignore:
Timestamp:
Jul 20, 2006, 11:43:27 AM (18 years ago)
Author:
bensch
Message:

orxonox/proxy: merged the proxy.old back again, and it seems to work.

Merged with command
svn merge -r9247:HEAD https://svn.orxonox.net/orxonox/branches/proxy.old .

no conflicts

Location:
branches/proxy/src/util
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/util/Makefile.am

    r8068 r9347  
    1414                        singleplayer_shootemup.cc \
    1515                        \
     16                        \
     17                        \
    1618                        mission_goal.cc\
    1719                        kill_target.cc\
     
    2426                        animation/animation_player.cc \
    2527                        \
    26                         track/pilot_node.cc
     28                        track/pilot_node.cc \
     29                        \
     30                        network_stats_widget.cc
    2731
    2832#                       track/track_manager.cc \
     
    5054                        animation/t_animation.h \
    5155                        \
    52                         track/pilot_node.h
     56                        track/pilot_node.h \
     57                        \
     58                        network_stats_widget.h
     59
    5360
    5461#                       track/track_manager.h \
  • branches/proxy/src/util/game_rules.cc

    r9008 r9347  
    8888void GameRules::registerKill(const Kill& kill)
    8989{
    90   if ( !SharedNetworkData::getInstance()->isGameServer() )
     90  if ( !SharedNetworkData::getInstance()->isMasterServer() )
    9191    return;
    9292
  • branches/proxy/src/util/multiplayer_team_deathmatch.cc

    r9235 r9347  
    204204  assignPlayable();
    205205
    206   if ( !SharedNetworkData::getInstance()->isGameServer() )
     206  if ( !SharedNetworkData::getInstance()->isMasterServer() )
    207207    return;
    208208
     
    214214    this->killList.erase( this->killList.begin() );
    215215  }
    216  
     216
    217217
    218218
     
    268268void MultiplayerTeamDeathmatch::checkGameRules()
    269269{
    270   if ( !SharedNetworkData::getInstance()->isGameServer() )
     270  if ( !SharedNetworkData::getInstance()->isMasterServer() )
    271271    return;
    272272
     
    320320      return "maps/male_fiend.pcx";
    321321  }
    322  
     322
    323323  return "";
    324324}
     
    330330    return 10.0f;
    331331  }
    332  
     332
    333333  return 1.0f;
    334334}
     
    680680  char st[10];
    681681  int i = 0;
    682  
     682
    683683  i = 2;
    684684  for ( TeamScoreList::const_iterator it = scoreList[0].begin(); it != scoreList[0].end(); it++ )
     
    719719    return;
    720720  }
    721  
     721
    722722  int killerUserId = killer->getOwner();
    723723  int victimUserId = victim->getOwner();
    724  
     724
    725725  PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassName(), victim->getClassName());
    726726
    727727  PlayerStats & victimStats = *PlayerStats::getStats( victimUserId );
    728728  PlayerStats & killerStats = *PlayerStats::getStats( killerUserId );
    729  
     729
    730730  if ( killerStats.getPlayable() != killer || victimStats.getPlayable() != victim )
    731731  {
  • branches/proxy/src/util/signal_handler.cc

    r9240 r9347  
    2727}
    2828
    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 */
     34void SignalHandler::doCatch( const std::string & appName, const std::string & fileName )
    3035{
    3136  this->appName = appName;
     37  this->fileName = fileName;
     38 
     39  // make sure doCatch is only called once without calling dontCatch
     40  assert( sigRecList.size() == 0 );
    3241
    3342  catchSignal( SIGSEGV );
     
    3544}
    3645
     46/**
     47 * restore previous signal handlers
     48 */
    3749void SignalHandler::dontCatch()
    3850{
     
    4557}
    4658
     59/**
     60 * catch signal sig
     61 * @param sig signal to catch
     62 */
    4763void SignalHandler::catchSignal( int sig )
    4864{
     
    5874}
    5975
     76/**
     77 * sigHandler is called when receiving signals
     78 * @param sig
     79 */
    6080void SignalHandler::sigHandler( int sig )
    6181{
     
    167187        )
    168188          charsFound++;
     189    else
     190      charsFound = 0;
    169191
    170192    if ( charsFound == 6 )
     
    183205  write( sigPipe[1], &someData, sizeof(someData) );
    184206
    185   write( gdbIn[1], "bt\nq\n", 5 );
     207  write( gdbIn[1], "bt\nk\nq\n", 7 );
    186208
    187209 
     
    202224        )
    203225          charsFound++;
     226    else
     227      charsFound = 0;
    204228
    205229    if ( charsFound == 6 )
     
    210234    }
    211235
    212     if ( promptFound == 2 )
     236    if ( promptFound == 3 )
    213237    {
    214238      break;
     
    240264  bt.insert(0, timeString);
    241265 
    242   FILE * f = fopen( GDB_BT_FILE, "a" );
     266  FILE * f = fopen( getInstance()->fileName.c_str(), "a" );
    243267
    244268  if ( !f )
    245269  {
    246     perror("could not append to " GDB_BT_FILE);
     270    perror( ( std::string( "could not append to " ) + getInstance()->fileName ).c_str() );
    247271    exit(EXIT_FAILURE);
    248272  }
     
    250274  if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() )
    251275  {
    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());
    253277    exit(EXIT_FAILURE);
    254278  }
  • branches/proxy/src/util/signal_handler.h

    r9240 r9347  
    99#include <list>
    1010#include <string>
    11 
    12 
    13 #define GDB_BT_FILE "orxonox.backtrace"
    1411
    1512typedef int (*SignalCallback)( void * someData );
     
    4441    void registerCallback( SignalCallback cb, void * someData );
    4542
    46     void doCatch( std::string appName );
     43    void doCatch( const std::string & appName, const std::string & fileName );
    4744    void dontCatch();
    4845
     
    5855
    5956    std::string appName;
     57    std::string fileName;
    6058};
    6159
Note: See TracChangeset for help on using the changeset viewer.