Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6463 in orxonox.OLD for branches/network


Ignore:
Timestamp:
Jan 10, 2006, 1:56:38 PM (19 years ago)
Author:
patrick
Message:

network: implemented a better debug function

Location:
branches/network/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_game_manager.cc

    r6459 r6463  
    478478    PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID());
    479479
    480 
    481     if( !strcmp( s->getClassName(), "SkyBox"))
    482     {
    483       PRINTF(0)("==> Created the Sky!\n");
    484       (dynamic_cast<GameWorld*>(State::getCurrentStoryEntity()))->setSky( dynamic_cast<WorldEntity*>(s) );
    485     }
    486 //       this->sky = dynamic_cast<WorldEntity*>(created);
    487     if( !strcmp( s->getClassName(), "Terrain"))
    488     {
    489       PRINTF(0)("==> Created the Terrain\n");
    490 //       this->terrain = dynamic_cast<Terrain*>(created);
    491 //       CDEngine::getInstance()->setTerrain(terrain);
    492     }
    493 
    494480    return b;
    495481  }
  • branches/network/src/story_entities/multi_player_world.cc

    r6424 r6463  
    2121#include "factory.h"
    2222#include "load_param.h"
     23#include "shell_command.h"
    2324
    2425#include "network_manager.h"
     
    2627
    2728using namespace std;
     29
     30
     31//! Register a command to print some multiplayer world infos
     32SHELL_COMMAND(debug, MultiPlayerWorld, debug);
    2833
    2934
     
    7984}
    8085
     86
     87/**
     88 * some debug ouptut - shell command
     89 */
     90void MultiPlayerWorld::debug()
     91{
     92  ((MultiPlayerWorldData*)this->dataTank)->debug();
     93}
  • branches/network/src/story_entities/multi_player_world.h

    r6424 r6463  
    2727  void loadParams(const TiXmlElement* root);
    2828
     29  void debug();
     30
    2931  protected:
    3032    virtual void synchronize();
  • branches/network/src/story_entities/multi_player_world_data.cc

    r6462 r6463  
    187187    }
    188188
    189     /* some debug output */
    190     PRINT(0)("==================================================\n");
    191     std::list<BaseObject*>::const_iterator entity;
    192     for (entity = playableList->begin(); entity != playableList->end(); entity++)
    193     {
    194       PRINTF(0)("Got a playable, class: %s, name: %s\n", (*entity)->getClassName(), (*entity)->getName());
    195     }
    196 
    197 
    198     PNode* cam = State::getCameraTarget();
    199     PRINT(0)("Camera has target - class: %s, name: %s, uid: %i\n", cam->getClassName(), cam->getName(), cam->getUniqueID());
    200 
    201 
    202     PRINT(0)("==================================================\n");
    203 
    204 
    205189    /* init the pnode tree */
    206190    PNode::getNullParent()->init();
     
    239223}
    240224
     225
     226/**
     227 * some debug output
     228 */
     229void MultiPlayerWorldData::debug()
     230{
     231  PRINT(0)("==================================================\n");
     232  Playable* playable;
     233  const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
     234  assert(playableList != NULL);
     235  std::list<BaseObject*>::const_iterator entity;
     236  for (entity = playableList->begin(); entity != playableList->end(); entity++)
     237  {
     238    Playable* p = dynamic_cast<Playable*>(*entity);
     239    PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassName(), (*entity)->getName(), p->getUniqueID());
     240  }
     241
     242  PNode* cam = State::getCameraTarget();
     243  PRINT(0)("Camera has target - class: %s, name: %s, uid: %i\n", cam->getClassName(), cam->getName(), cam->getUniqueID());
     244
     245  PRINT(0)("==================================================\n");
     246
     247}
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
  • branches/network/src/story_entities/multi_player_world_data.h

    r6424 r6463  
    2424    virtual ErrorMessage init();
    2525
     26    void debug();
     27
    2628
    2729  protected:
  • branches/network/src/world_entities/space_ships/space_ship.cc

    r6426 r6463  
    211211  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
    212212  this->attachCamera();
    213 
    214 
    215213}
    216214
     
    315313
    316314  //readjust
    317  
     315
    318316  /*
    319317    In the game "Yager" the spaceship gets readjusted when the player moves the mouse.
    320318    I (bknecht) go and check it out how they do it, we could probably use this also in Orxonox.
    321319  */
    322   //if (xMouse != 0 && yMouse != 0) 
    323  
     320  //if (xMouse != 0 && yMouse != 0)
     321
    324322  //if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));
    325323  //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));
Note: See TracChangeset for help on using the changeset viewer.